66
77
88class Integration (Resource ):
9- """OAuth integration resource.
10-
11- Attributes
12- ----------
13- id : str
14- The internal numeric identifier of this OAuth integration.
15- guid : str
16- The unique identifier of this OAuth integration which is used in REST API requests.
17- name : str
18- A descriptive name to identify each OAuth integration.
19- description : Optional[str]
20- A brief text to describe each OAuth integration
21- template : str
22- The template to use to configure this OAuth integration.
23- config : dict
24- The OAuth integration configuration based on the template.
25- created_time : str
26- The timestamp (RFC3339) indicating when this OAuth integration was created.
27- updated_time : str
28- The timestamp (RFC3339) indicating when this OAuth integration was last updated.
29- """
30-
31- # CRUD Methods
9+ """OAuth integration resource."""
3210
3311 def delete (self ) -> None :
3412 """Delete the OAuth integration."""
35- path = f"v1/oauth/integrations/{ self . guid } "
36- url = self .url + path
37- self .session .delete (url )
13+ path = f"v1/oauth/integrations/{ self [ ' guid' ] } "
14+ url = self .params . url + path
15+ self .params . session .delete (url )
3816
3917 @overload
4018 def update (
@@ -63,44 +41,10 @@ def update(self, *args, **kwargs) -> None:
6341 def update (self , * args , ** kwargs ) -> None :
6442 """Update the OAuth integration."""
6543 body = dict (* args , ** kwargs )
66- url = self .url + f"v1/oauth/integrations/{ self . guid } "
67- response = self .session .patch (url , json = body )
44+ url = self .params . url + f"v1/oauth/integrations/{ self [ ' guid' ] } "
45+ response = self .params . session .patch (url , json = body )
6846 super ().update (** response .json ())
6947
70- # Properties
71-
72- @property
73- def id (self ) -> str :
74- return self .get ("id" ) # type: ignore
75-
76- @property
77- def guid (self ) -> str :
78- return self .get ("guid" ) # type: ignore
79-
80- @property
81- def name (self ) -> str :
82- return self .get ("name" ) # type: ignore
83-
84- @property
85- def description (self ) -> Optional [str ]:
86- return self .get ("description" ) # type: ignore
87-
88- @property
89- def template (self ) -> str :
90- return self .get ("template" ) # type: ignore
91-
92- @property
93- def config (self ) -> dict :
94- return self .get ("config" ) # type: ignore
95-
96- @property
97- def created_time (self ) -> str :
98- return self .get ("created_time" ) # type: ignore
99-
100- @property
101- def updated_time (self ) -> str :
102- return self .get ("updated_time" ) # type: ignore
103-
10448
10549class Integrations (Resources ):
10650 """Integrations resource."""
@@ -155,8 +99,8 @@ def create(self, **kwargs) -> Integration:
15599 """
156100 ...
157101 path = "v1/oauth/integrations"
158- url = self .url + path
159- response = self .session .post (url , json = kwargs )
102+ url = self .params . url + path
103+ response = self .params . session .post (url , json = kwargs )
160104 return Integration (self .params , ** response .json ())
161105
162106 def find (self ) -> List [Integration ]:
@@ -167,9 +111,9 @@ def find(self) -> List[Integration]:
167111 List[Integration]
168112 """
169113 path = "v1/oauth/integrations"
170- url = self .url + path
114+ url = self .params . url + path
171115
172- response = self .session .get (url )
116+ response = self .params . session .get (url )
173117 return [
174118 Integration (
175119 self .params ,
@@ -190,6 +134,6 @@ def get(self, guid: str) -> Integration:
190134 Integration
191135 """
192136 path = f"v1/oauth/integrations/{ guid } "
193- url = self .url + path
194- response = self .session .get (url )
137+ url = self .params . url + path
138+ response = self .params . session .get (url )
195139 return Integration (self .params , ** response .json ())
0 commit comments