brynq-sdk-brynq 3.0.3__tar.gz → 3.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of brynq-sdk-brynq might be problematic. Click here for more details.

Files changed (26) hide show
  1. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/PKG-INFO +1 -1
  2. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/brynq.py +7 -6
  3. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/credentials.py +6 -4
  4. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/customers.py +7 -4
  5. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/interfaces.py +27 -18
  6. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/mappings.py +3 -2
  7. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/organization_chart.py +27 -18
  8. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/roles.py +27 -18
  9. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/source_systems.py +21 -14
  10. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/users.py +42 -28
  11. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/PKG-INFO +1 -1
  12. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/setup.py +1 -1
  13. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/__init__.py +0 -0
  14. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/__init__.py +0 -0
  15. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/credentials.py +0 -0
  16. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/customers.py +0 -0
  17. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/interfaces.py +0 -0
  18. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/organization_chart.py +0 -0
  19. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/roles.py +0 -0
  20. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq/schemas/users.py +0 -0
  21. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/SOURCES.txt +0 -0
  22. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/dependency_links.txt +0 -0
  23. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/not-zip-safe +0 -0
  24. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/requires.txt +0 -0
  25. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/brynq_sdk_brynq.egg-info/top_level.txt +0 -0
  26. {brynq_sdk_brynq-3.0.3 → brynq_sdk_brynq-3.0.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_brynq
3
- Version: 3.0.3
3
+ Version: 3.0.5
4
4
  Summary: BrynQ SDK for the BrynQ.com platform
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -18,6 +18,7 @@ class BrynQ:
18
18
  self.subdomain = os.getenv("BRYNQ_SUBDOMAIN", subdomain)
19
19
  self.api_token = os.getenv("BRYNQ_API_TOKEN", api_token)
20
20
  self.environment = os.getenv("BRYNQ_ENVIRONMENT", staging)
21
+ self.timeout = 3600
21
22
 
22
23
  if any([self.subdomain is None, self.api_token is None]):
23
24
  raise ValueError("Set the subdomain, api_token either in your .env file or provide the subdomain and api_token parameters")
@@ -28,17 +29,17 @@ class BrynQ:
28
29
 
29
30
  self.url = 'https://app.brynq-staging.com/api/v2/' if self.environment == 'dev' else 'https://app.brynq.com/api/v2/'
30
31
 
31
- # Initialize session with retry strategy
32
- self.session = requests.Session()
32
+ # Initialize session with retry strategy. This is called brynq_session and not session as to not conflict with other SDKs that use self.session
33
+ self.brynq_session = requests.Session()
33
34
  retry_strategy = Retry(
34
35
  total=3, # number of retries
35
36
  backoff_factor=0.5, # wait 0.5s * (2 ** (retry - 1)) between retries
36
37
  status_forcelist=[500, 502, 503, 504] # HTTP status codes to retry on
37
38
  )
38
39
  adapter = HTTPAdapter(max_retries=retry_strategy)
39
- self.session.mount("http://", adapter)
40
- self.session.mount("https://", adapter)
41
- self.session.headers.update(self._get_headers())
40
+ self.brynq_session.mount("http://", adapter)
41
+ self.brynq_session.mount("https://", adapter)
42
+ self.brynq_session.headers.update(self._get_headers())
42
43
 
43
44
  # Initialize components
44
45
  self.users = Users(self)
@@ -280,4 +281,4 @@ class BrynQ:
280
281
  def close(self):
281
282
  """Close the session and cleanup resources"""
282
283
  if hasattr(self, 'session'):
283
- self.session.close()
284
+ self.brynq_session.close()
@@ -24,8 +24,9 @@ class Credentials:
24
24
  DEPRECATED: Use brynq.interfaces.credentials.get() instead
25
25
  """
26
26
  warnings.warn("This function is deprecated and will be removed in a future version.", DeprecationWarning, stacklevel=2)
27
- response = self._brynq.session.get(
27
+ response = self._brynq.brynq_session.get(
28
28
  url=f'{self._brynq.url}apps/{system}',
29
+ timeout=self._brynq.timeout
29
30
  )
30
31
  response.raise_for_status()
31
32
  credentials = response.json()
@@ -46,7 +47,7 @@ class Credentials:
46
47
 
47
48
  return credentials[0]
48
49
 
49
- def get(self,interface_id: str,system: str,system_type: Optional[str] = None,test_environment: bool = False) -> Union[dict, List[dict]]:
50
+ def get(self,interface_id: str, system: str,system_type: Optional[str] = None,test_environment: bool = False) -> Union[dict, List[dict]]:
50
51
  """
51
52
  This method retrieves authentication credentials from BrynQ for a specific interface and system.
52
53
 
@@ -142,8 +143,9 @@ class Credentials:
142
143
  ValueError: If the response data is invalid.
143
144
  requests.exceptions.RequestException: If the API request fails.
144
145
  """
145
- response = self._brynq.session.get(
146
- url=f'{self._brynq.url}interfaces/{interface_id}/config/auth'
146
+ response = self._brynq.brynq_session.get(
147
+ url=f'{self._brynq.url}interfaces/{interface_id}/config/auth',
148
+ timeout=self._brynq.timeout
147
149
  )
148
150
  response.raise_for_status()
149
151
 
@@ -25,8 +25,9 @@ class Customers:
25
25
  requests.exceptions.RequestException: If the API request fails
26
26
  ValueError: If the response data doesn't match the expected schema
27
27
  """
28
- response = self.brynq.session.get(
29
- f"{self.brynq.url}customers",
28
+ response = self.brynq.brynq_session.get(
29
+ url=f"{self.brynq.url}customers",
30
+ timeout=self.brynq.timeout
30
31
  )
31
32
  response.raise_for_status()
32
33
 
@@ -47,8 +48,9 @@ class Customers:
47
48
  requests.exceptions.RequestException: If the API request fails
48
49
  ValueError: If the response data doesn't match the expected schema
49
50
  """
50
- response = self.brynq.session.get(
51
+ response = self.brynq.brynq_session.get(
51
52
  f"{self.brynq.url}customers/contract-details",
53
+ timeout=self.brynq.timeout
52
54
  )
53
55
  response.raise_for_status()
54
56
 
@@ -72,8 +74,9 @@ class Customers:
72
74
  ValueError: If the response data is invalid.
73
75
  requests.exceptions.RequestException: If the API request fails.
74
76
  """
75
- response = self.brynq.session.get(
77
+ response = self.brynq.brynq_session.get(
76
78
  f"{self.brynq.url}customers/{customer_id}/contract-details",
79
+ timeout=self.brynq.timeout
77
80
  )
78
81
  response.raise_for_status()
79
82
 
@@ -35,8 +35,9 @@ class Interfaces:
35
35
  ValueError: If the response data is invalid
36
36
  requests.exceptions.RequestException: If the API request fails
37
37
  """
38
- response = self._brynq.session.get(
39
- f"{self._brynq.url}interfaces"
38
+ response = self._brynq.brynq_session.get(
39
+ f"{self._brynq.url}interfaces",
40
+ timeout=self._brynq.timeout
40
41
  )
41
42
  response.raise_for_status()
42
43
 
@@ -69,8 +70,9 @@ class Interfaces:
69
70
  if not isinstance(interface_id, int) or interface_id <= 0:
70
71
  raise ValueError("interface_id must be a positive integer")
71
72
 
72
- response = self._brynq.session.get(
73
- f"{self._brynq.url}interfaces/{interface_id}"
73
+ response = self._brynq.brynq_session.get(
74
+ f"{self._brynq.url}interfaces/{interface_id}",
75
+ timeout=self._brynq.timeout
74
76
  )
75
77
  response.raise_for_status()
76
78
 
@@ -100,8 +102,9 @@ class Interfaces:
100
102
  if not isinstance(interface_id, int) or interface_id <= 0:
101
103
  raise ValueError("interface_id must be a positive integer")
102
104
 
103
- response = self._brynq.session.get(
104
- f"{self._brynq.url}interfaces/{interface_id}/config"
105
+ response = self._brynq.brynq_session.get(
106
+ f"{self._brynq.url}interfaces/{interface_id}/config",
107
+ timeout=self._brynq.timeout
105
108
  )
106
109
  response.raise_for_status()
107
110
 
@@ -125,8 +128,9 @@ class Interfaces:
125
128
  Raises:
126
129
  requests.exceptions.RequestException: If the API request fails
127
130
  """
128
- response = self._brynq.session.get(
129
- url=f'{self._brynq.url}interfaces/{interface_id}/config/flush'
131
+ response = self._brynq.brynq_session.get(
132
+ url=f'{self._brynq.url}interfaces/{interface_id}/config/flush',
133
+ timeout=self._brynq.timeout
130
134
  )
131
135
  response.raise_for_status()
132
136
  return response
@@ -144,8 +148,9 @@ class Interfaces:
144
148
  Raises:
145
149
  requests.exceptions.RequestException: If the API request fails
146
150
  """
147
- response = self._brynq.session.get(
148
- url=f'{self._brynq.url}interfaces/{interface_id}/config/dataflows'
151
+ response = self._brynq.brynq_session.get(
152
+ url=f'{self._brynq.url}interfaces/{interface_id}/config/dataflows',
153
+ timeout=self._brynq.timeout
149
154
  )
150
155
  response.raise_for_status()
151
156
  return response.json()
@@ -176,8 +181,9 @@ class Interfaces:
176
181
  if not isinstance(interface_id, int) or interface_id <= 0:
177
182
  raise ValueError("interface_id must be a positive integer")
178
183
 
179
- response = self._brynq.session.get(
180
- f"{self._brynq.url}interfaces/{interface_id}/config/schedule"
184
+ response = self._brynq.brynq_session.get(
185
+ f"{self._brynq.url}interfaces/{interface_id}/config/schedule",
186
+ timeout=self._brynq.timeout
181
187
  )
182
188
  response.raise_for_status()
183
189
 
@@ -201,8 +207,9 @@ class Interfaces:
201
207
  Raises:
202
208
  requests.exceptions.RequestException: If the API request fails
203
209
  """
204
- response = self._brynq.session.get(
205
- url=f'{self._brynq.url}interfaces/{interface_id}/template-config'
210
+ response = self._brynq.brynq_session.get(
211
+ url=f'{self._brynq.url}interfaces/{interface_id}/template-config',
212
+ timeout=self._brynq.timeout
206
213
  )
207
214
  response.raise_for_status()
208
215
  return response.json()
@@ -226,8 +233,9 @@ class Interfaces:
226
233
  if not isinstance(interface_id, int) or interface_id <= 0:
227
234
  raise ValueError("interface_id must be a positive integer")
228
235
 
229
- response = self._brynq.session.get(
230
- f"{self._brynq.url}interfaces/{interface_id}/scope"
236
+ response = self._brynq.brynq_session.get(
237
+ f"{self._brynq.url}interfaces/{interface_id}/scope",
238
+ timeout=self._brynq.timeout
231
239
  )
232
240
  response.raise_for_status()
233
241
 
@@ -259,8 +267,9 @@ class Interfaces:
259
267
  if not isinstance(interface_id, int) or interface_id <= 0:
260
268
  raise ValueError("interface_id must be a positive integer")
261
269
 
262
- response = self._brynq.session.get(
263
- url=f"{self._brynq.url}interfaces/{interface_id}/config/dev-settings"
270
+ response = self._brynq.brynq_session.get(
271
+ url=f"{self._brynq.url}interfaces/{interface_id}/config/dev-settings",
272
+ timeout=self._brynq.timeout
264
273
  )
265
274
  response.raise_for_status()
266
275
 
@@ -39,8 +39,9 @@ class Mappings:
39
39
  if not isinstance(interface_id, int) or interface_id <= 0:
40
40
  raise ValueError("interface_id must be a positive integer")
41
41
 
42
- response = self._brynq.session.get(
43
- f"{self._brynq.url}interfaces/{interface_id}/config/mapping"
42
+ response = self._brynq.brynq_session.get(
43
+ f"{self._brynq.url}interfaces/{interface_id}/config/mapping",
44
+ timeout=self._brynq.timeout
44
45
  )
45
46
  response.raise_for_status()
46
47
 
@@ -45,9 +45,10 @@ class OrganizationChart:
45
45
  if layout not in ["nested", "flat"]:
46
46
  raise ValueError('layout must be either "nested" or "flat"')
47
47
 
48
- response = self._brynq.session.get(
48
+ response = self._brynq.brynq_session.get(
49
49
  f"{self._brynq.url}organization-chart",
50
- params={"layout": layout}
50
+ params={"layout": layout},
51
+ timeout=self._brynq.timeout
51
52
  )
52
53
  response.raise_for_status()
53
54
 
@@ -71,8 +72,9 @@ class OrganizationChart:
71
72
  requests.exceptions.RequestException: If the API request fails
72
73
  ValueError: If the response data is invalid
73
74
  """
74
- response = self._brynq.session.get(
75
- f"{self._brynq.url}organization-chart/layers"
75
+ response = self._brynq.brynq_session.get(
76
+ f"{self._brynq.url}organization-chart/layers",
77
+ timeout=self._brynq.timeout
76
78
  )
77
79
  response.raise_for_status()
78
80
 
@@ -101,9 +103,10 @@ class OrganizationChart:
101
103
  """
102
104
  valid_data, _ = Functions.validate_pydantic_data(data, schema=OrganizationLayerCreate)
103
105
 
104
- response = self._brynq.session.post(
106
+ response = self._brynq.brynq_session.post(
105
107
  f"{self._brynq.url}organization-chart/layers",
106
- json=valid_data[0]
108
+ json=valid_data[0],
109
+ timeout=self._brynq.timeout
107
110
  )
108
111
  response.raise_for_status()
109
112
  return response
@@ -127,9 +130,10 @@ class OrganizationChart:
127
130
  """
128
131
  valid_data, _ = Functions.validate_pydantic_data(data, schema=OrganizationLayerUpdate)
129
132
 
130
- response = self._brynq.session.put(
133
+ response = self._brynq.brynq_session.put(
131
134
  f"{self._brynq.url}organization-chart/layers/{data['id']}",
132
- json=valid_data[0]
135
+ json=valid_data[0],
136
+ timeout=self._brynq.timeout
133
137
  )
134
138
  response.raise_for_status()
135
139
  return response
@@ -147,8 +151,9 @@ class OrganizationChart:
147
151
  if not isinstance(layer_id, int):
148
152
  raise ValueError("layer_id must be an integer")
149
153
 
150
- response = self._brynq.session.delete(
151
- f"{self._brynq.url}organization-chart/layers/{layer_id}"
154
+ response = self._brynq.brynq_session.delete(
155
+ f"{self._brynq.url}organization-chart/layers/{layer_id}",
156
+ timeout=self._brynq.timeout
152
157
  )
153
158
  response.raise_for_status()
154
159
  return response
@@ -166,8 +171,9 @@ class OrganizationChart:
166
171
  requests.exceptions.RequestException: If the API request fails
167
172
  ValueError: If the response data is invalid
168
173
  """
169
- response = self._brynq.session.get(
170
- url=f'{self._brynq.url}organization-chart/nodes'
174
+ response = self._brynq.brynq_session.get(
175
+ url=f'{self._brynq.url}organization-chart/nodes',
176
+ timeout=self._brynq.timeout
171
177
  )
172
178
  response.raise_for_status()
173
179
  valid_data, _ = Functions.validate_pydantic_data(response.json(), schema=OrganizationNode)
@@ -193,9 +199,10 @@ class OrganizationChart:
193
199
 
194
200
  valid_data, _ = Functions.validate_pydantic_data(data, schema=OrganizationNodeCreate)
195
201
 
196
- response = self._brynq.session.post(
202
+ response = self._brynq.brynq_session.post(
197
203
  f"{self._brynq.url}organization-chart/nodes",
198
- json=valid_data[0]
204
+ json=valid_data[0],
205
+ timeout=self._brynq.timeout
199
206
  )
200
207
  response.raise_for_status()
201
208
  return response
@@ -215,9 +222,10 @@ class OrganizationChart:
215
222
  """
216
223
  valid_data, _ = Functions.validate_pydantic_data(data, schema=OrganizationNodeUpdate)
217
224
 
218
- response = self._brynq.session.put(
225
+ response = self._brynq.brynq_session.put(
219
226
  f"{self._brynq.url}organization-chart/nodes/{data['id']}",
220
- json=valid_data[0]
227
+ json=valid_data[0],
228
+ timeout=self._brynq.timeout
221
229
  )
222
230
  response.raise_for_status()
223
231
  return response
@@ -235,8 +243,9 @@ class OrganizationChart:
235
243
  if not isinstance(node_id, int):
236
244
  raise ValueError("node_id must be an integer")
237
245
 
238
- response = self._brynq.session.delete(
239
- f"{self._brynq.url}organization-chart/nodes/{node_id}"
246
+ response = self._brynq.brynq_session.delete(
247
+ f"{self._brynq.url}organization-chart/nodes/{node_id}",
248
+ timeout=self._brynq.timeout
240
249
  )
241
250
  response.raise_for_status()
242
251
  return response
@@ -25,8 +25,9 @@ class Roles:
25
25
  requests.HTTPError: If the API request fails
26
26
  ValueError: If the role data is invalid
27
27
  """
28
- response = self._brynq.session.get(
29
- url=f'{self._brynq.url}roles'
28
+ response = self._brynq.brynq_session.get(
29
+ url=f'{self._brynq.url}roles',
30
+ timeout=self._brynq.timeout
30
31
  )
31
32
  response.raise_for_status()
32
33
 
@@ -53,8 +54,9 @@ class Roles:
53
54
  ValueError: If the response data is invalid.
54
55
  requests.exceptions.RequestException: If the API request fails.
55
56
  """
56
- response = self._brynq.session.get(
57
- f"{self._brynq.url}roles/{role_id}"
57
+ response = self._brynq.brynq_session.get(
58
+ f"{self._brynq.url}roles/{role_id}",
59
+ timeout=self._brynq.timeout
58
60
  )
59
61
  response.raise_for_status()
60
62
 
@@ -83,9 +85,10 @@ class Roles:
83
85
  try:
84
86
  valid_data, _ = Functions.validate_pydantic_data(data, schema=CreateRoleRequest)
85
87
  if valid_data:
86
- response = self._brynq.session.post(
88
+ response = self._brynq.brynq_session.post(
87
89
  f"{self._brynq.url}roles",
88
- json=valid_data[0]
90
+ json=valid_data[0],
91
+ timeout=self._brynq.timeout
89
92
  )
90
93
  response.raise_for_status()
91
94
  return response
@@ -113,9 +116,10 @@ class Roles:
113
116
  try:
114
117
  valid_data, _ = Functions.validate_pydantic_data(data, schema=RoleSchema)
115
118
  if valid_data:
116
- response = self._brynq.session.put(
119
+ response = self._brynq.brynq_session.put(
117
120
  f"{self._brynq.url}roles/{data['id']}",
118
- json=valid_data[0]
121
+ json=valid_data[0],
122
+ timeout=self._brynq.timeout
119
123
  )
120
124
  response.raise_for_status()
121
125
  return response
@@ -140,9 +144,10 @@ class Roles:
140
144
  raise ValueError("role_id must be a positive integer")
141
145
 
142
146
  params = {"force": "true" if force else "false"}
143
- response = self._brynq.session.delete(
147
+ response = self._brynq.brynq_session.delete(
144
148
  f"{self._brynq.url}roles/{role_id}",
145
- params=params
149
+ params=params,
150
+ timeout=self._brynq.timeout
146
151
  )
147
152
  response.raise_for_status()
148
153
  return response
@@ -164,8 +169,9 @@ class Roles:
164
169
  if not isinstance(role_id, int) or role_id <= 0:
165
170
  raise ValueError("role_id must be a positive integer")
166
171
 
167
- response = self._brynq.session.get(
168
- f"{self._brynq.url}roles/{role_id}/users"
172
+ response = self._brynq.brynq_session.get(
173
+ f"{self._brynq.url}roles/{role_id}/users",
174
+ timeout=self._brynq.timeout
169
175
  )
170
176
  response.raise_for_status()
171
177
 
@@ -196,9 +202,10 @@ class Roles:
196
202
 
197
203
  try:
198
204
  valid_data, _ = Functions.validate_pydantic_data(dashboard_rights, schema=DashboardRight)
199
- response = self._brynq.session.post(
205
+ response = self._brynq.brynq_session.post(
200
206
  f"{self._brynq.url}roles/{role_id}/dashboards",
201
- json=valid_data[0]
207
+ json=valid_data[0],
208
+ timeout=self._brynq.timeout
202
209
  )
203
210
  response.raise_for_status()
204
211
  return response
@@ -226,9 +233,10 @@ class Roles:
226
233
 
227
234
  try:
228
235
  valid_data, _ = Functions.validate_pydantic_data(qlik_dashboard_rights, schema=QlikDashboardRight)
229
- response = self._brynq.session.post(
236
+ response = self._brynq.brynq_session.post(
230
237
  f"{self._brynq.url}roles/{role_id}/dashboards/qlik",
231
- json=valid_data[0]
238
+ json=valid_data[0],
239
+ timeout=self._brynq.timeout
232
240
  )
233
241
  response.raise_for_status()
234
242
  return response
@@ -255,9 +263,10 @@ class Roles:
255
263
  payload = {"qlikDashboards": qlik_dashboards}
256
264
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=QlikDashboardRight)
257
265
 
258
- response = self._brynq.session.post(
266
+ response = self._brynq.brynq_session.post(
259
267
  f"{self._brynq.url}roles/{role_id}/dashboards/qlik",
260
- json=valid_data[0]
268
+ json=valid_data[0],
269
+ timeout=self._brynq.timeout
261
270
  )
262
271
  response.raise_for_status()
263
272
  return response.json()
@@ -25,8 +25,9 @@ class SourceSystems:
25
25
  Raises:
26
26
  requests.exceptions.RequestException: If the API request fails
27
27
  """
28
- response = self._brynq.session.get(
29
- url=f'{self._brynq.url}source-systems'
28
+ response = self._brynq.brynq_session.get(
29
+ url=f'{self._brynq.url}source-systems',
30
+ timeout=self._brynq.timeout
30
31
  )
31
32
  response.raise_for_status()
32
33
  return response.json()
@@ -49,9 +50,10 @@ class SourceSystems:
49
50
  'name': name,
50
51
  'entities': entities or []
51
52
  }
52
- response = self._brynq.session.post(
53
+ response = self._brynq.brynq_session.post(
53
54
  url=f'{self._brynq.url}source-systems',
54
- json=data
55
+ json=data,
56
+ timeout=self._brynq.timeout
55
57
  )
56
58
  response.raise_for_status()
57
59
  return response.json()
@@ -66,8 +68,9 @@ class SourceSystems:
66
68
  Raises:
67
69
  requests.exceptions.RequestException: If the API request fails
68
70
  """
69
- response = self._brynq.session.delete(
70
- url=f'{self._brynq.url}source-systems/{system_id}'
71
+ response = self._brynq.brynq_session.delete(
72
+ url=f'{self._brynq.url}source-systems/{system_id}',
73
+ timeout=self._brynq.timeout
71
74
  )
72
75
  response.raise_for_status()
73
76
 
@@ -91,9 +94,10 @@ class SourceSystems:
91
94
  'name': name,
92
95
  'entities': entities or []
93
96
  }
94
- response = self._brynq.session.put(
97
+ response = self._brynq.brynq_session.put(
95
98
  url=f'{self._brynq.url}source-systems/{system_id}',
96
- json=data
99
+ json=data,
100
+ timeout=self._brynq.timeout
97
101
  )
98
102
  response.raise_for_status()
99
103
  return response.json()
@@ -111,8 +115,9 @@ class SourceSystems:
111
115
  Raises:
112
116
  requests.exceptions.RequestException: If the API request fails
113
117
  """
114
- response = self._brynq.session.get(
115
- url=f'{self._brynq.url}source-systems/{system_id}/entities'
118
+ response = self._brynq.brynq_session.get(
119
+ url=f'{self._brynq.url}source-systems/{system_id}/entities',
120
+ timeout=self._brynq.timeout
116
121
  )
117
122
  response.raise_for_status()
118
123
  return response.json()
@@ -133,9 +138,10 @@ class SourceSystems:
133
138
  requests.exceptions.HTTPError: If source system is not found (404)
134
139
  """
135
140
  data = {'entities': entities}
136
- response = self._brynq.session.post(
141
+ response = self._brynq.brynq_session.post(
137
142
  url=f'{self._brynq.url}source-systems/{system_id}/entities',
138
- json=data
143
+ json=data,
144
+ timeout=self._brynq.timeout
139
145
  )
140
146
  response.raise_for_status()
141
147
  return response.json()
@@ -160,9 +166,10 @@ class SourceSystems:
160
166
  'name': name,
161
167
  'code': code
162
168
  }
163
- response = self._brynq.session.put(
169
+ response = self._brynq.brynq_session.put(
164
170
  url=f'{self._brynq.url}source-systems/entities/{entity_id}',
165
- json=data
171
+ json=data,
172
+ timeout=self._brynq.timeout
166
173
  )
167
174
  response.raise_for_status()
168
175
  return response.json()
@@ -39,8 +39,9 @@ class Users:
39
39
  requests.exceptions.RequestException: If the API request fails
40
40
  ValueError: If the response data is invalid
41
41
  """
42
- response = self._brynq.session.get(
43
- url=f'{self._brynq.url}users'
42
+ response = self._brynq.brynq_session.get(
43
+ url=f'{self._brynq.url}users',
44
+ timeout=self._brynq.timeout
44
45
  )
45
46
  response.raise_for_status()
46
47
 
@@ -61,8 +62,9 @@ class Users:
61
62
  requests.exceptions.RequestException: If the API request fails
62
63
  requests.exceptions.HTTPError: If user is not found (404)
63
64
  """
64
- response = self._brynq.session.get(
65
- url=f'{self._brynq.url}users/{user_id}'
65
+ response = self._brynq.brynq_session.get(
66
+ url=f'{self._brynq.url}users/{user_id}',
67
+ timeout=self._brynq.timeout
66
68
  )
67
69
  response.raise_for_status()
68
70
  valid_data, _ = Functions.validate_pydantic_data(response.json(), schema=User)
@@ -88,9 +90,10 @@ class Users:
88
90
  """
89
91
  valid_data, _ = Functions.validate_pydantic_data(user_data, schema=UserInvite)
90
92
 
91
- response = self._brynq.session.post(
93
+ response = self._brynq.brynq_session.post(
92
94
  url=f'{self._brynq.url}users',
93
- json=valid_data[0]
95
+ json=valid_data[0],
96
+ timeout=self._brynq.timeout
94
97
  )
95
98
  response.raise_for_status()
96
99
  return response
@@ -126,9 +129,10 @@ class Users:
126
129
 
127
130
  valid_data, _ = Functions.validate_pydantic_data(user_data, schema=UserUpdate)
128
131
 
129
- response = self._brynq.session.put(
132
+ response = self._brynq.brynq_session.put(
130
133
  url=f'{self._brynq.url}users/{user_id}',
131
- json=valid_data[0]
134
+ json=valid_data[0],
135
+ timeout=self._brynq.timeout
132
136
  )
133
137
  response.raise_for_status()
134
138
 
@@ -141,8 +145,9 @@ class Users:
141
145
  """
142
146
  if not isinstance(user_id, int):
143
147
  raise ValueError("user_id must be an integer")
144
- response = self._brynq.session.delete(
145
- url=f'{self._brynq.url}users/{user_id}'
148
+ response = self._brynq.brynq_session.delete(
149
+ url=f'{self._brynq.url}users/{user_id}',
150
+ timeout=self._brynq.timeout
146
151
  )
147
152
  response.raise_for_status()
148
153
  return response
@@ -174,9 +179,10 @@ class Users:
174
179
  }
175
180
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=DashboardRightsPayload)
176
181
 
177
- response = self._brynq.session.post(
182
+ response = self._brynq.brynq_session.post(
178
183
  url=f'{self._brynq.url}users/{user_id}/dashboards',
179
- json=valid_data[0]
184
+ json=valid_data[0],
185
+ timeout=self._brynq.timeout
180
186
  )
181
187
  response.raise_for_status()
182
188
  return response
@@ -200,9 +206,10 @@ class Users:
200
206
  payload = {"roles": roles}
201
207
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=UserRolesPayload)
202
208
 
203
- response = self._brynq.session.post(
209
+ response = self._brynq.brynq_session.post(
204
210
  url=f'{self._brynq.url}users/{user_id}/roles',
205
- json=valid_data[0]
211
+ json=valid_data[0],
212
+ timeout=self._brynq.timeout
206
213
  )
207
214
  response.raise_for_status()
208
215
  return response
@@ -225,9 +232,10 @@ class Users:
225
232
  raise ValueError("user_id must be an integer")
226
233
  payload = {"organigramEntities": organigram_entities}
227
234
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=UserEntitiesPayload)
228
- response = self._brynq.session.post(
235
+ response = self._brynq.brynq_session.post(
229
236
  url=f"{self._brynq.url}users/{user_id}/organigram-entities",
230
- json=valid_data[0]
237
+ json=valid_data[0],
238
+ timeout=self._brynq.timeout
231
239
  )
232
240
  response.raise_for_status()
233
241
  return response.json()
@@ -250,9 +258,10 @@ class Users:
250
258
  raise ValueError("user_id must be an integer")
251
259
  payload = {"qlikDashboardRights": qlik_dashboard_rights}
252
260
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=QlikDashboardRightsPayload)
253
- response = self._brynq.session.post(
261
+ response = self._brynq.brynq_session.post(
254
262
  url=f"{self._brynq.url}users/{user_id}/dashboards/qlik",
255
- json=valid_data[0]
263
+ json=valid_data[0],
264
+ timeout=self._brynq.timeout
256
265
  )
257
266
  response.raise_for_status()
258
267
  return response.json()
@@ -285,9 +294,10 @@ class Users:
285
294
  }
286
295
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=QlikDashboardRightsPayload)
287
296
 
288
- response = self._brynq.session.post(
297
+ response = self._brynq.brynq_session.post(
289
298
  url=f'{self._brynq.url}users/{user_id}/dashboards/qlik',
290
- json=valid_data[0]
299
+ json=valid_data[0],
300
+ timeout=self._brynq.timeout
291
301
  )
292
302
  response.raise_for_status()
293
303
  return response
@@ -312,8 +322,9 @@ class Users:
312
322
  requests.exceptions.RequestException: If the API request fails
313
323
  ValueError: If the input data is invalid
314
324
  """
315
- response = self._brynq.session.get(
316
- url=f'{self._brynq.url}/qlik/{guid}/users'
325
+ response = self._brynq.brynq_session.get(
326
+ url=f'{self._brynq.url}/qlik/{guid}/users',
327
+ timeout=self._brynq.timeout
317
328
  )
318
329
  response.raise_for_status()
319
330
 
@@ -340,9 +351,10 @@ class Users:
340
351
  payload = {"entities": entity_ids}
341
352
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=UserEntitiesPayload)
342
353
 
343
- response = self._brynq.session.post(
354
+ response = self._brynq.brynq_session.post(
344
355
  url=f'{self._brynq.url}users/{user_id}/organigram-entities',
345
- json=valid_data[0]
356
+ json=valid_data[0],
357
+ timeout=self._brynq.timeout
346
358
  )
347
359
  response.raise_for_status()
348
360
  return response
@@ -366,9 +378,10 @@ class Users:
366
378
  payload = {"entities": entity_ids}
367
379
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=UserEntitiesPayload)
368
380
 
369
- response = self._brynq.session.put(
381
+ response = self._brynq.brynq_session.put(
370
382
  url=f'{self._brynq.url}users/{user_id}/organigram-entities',
371
- json=valid_data[0]
383
+ json=valid_data[0],
384
+ timeout=self._brynq.timeout
372
385
  )
373
386
  response.raise_for_status()
374
387
  return response
@@ -392,9 +405,10 @@ class Users:
392
405
  payload = {"entities": entity_ids}
393
406
  valid_data, _ = Functions.validate_pydantic_data(payload, schema=UserEntitiesPayload)
394
407
 
395
- response = self._brynq.session.delete(
408
+ response = self._brynq.brynq_session.delete(
396
409
  url=f'{self._brynq.url}users/{user_id}/organigram-entities',
397
- json=valid_data[0]
410
+ json=valid_data[0],
411
+ timeout=self._brynq.timeout
398
412
  )
399
413
  response.raise_for_status()
400
414
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-brynq
3
- Version: 3.0.3
3
+ Version: 3.0.5
4
4
  Summary: BrynQ SDK for the BrynQ.com platform
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_brynq',
5
- version='3.0.3',
5
+ version='3.0.5',
6
6
  description='BrynQ SDK for the BrynQ.com platform',
7
7
  long_description='BrynQ SDK for the BrynQ.com platform',
8
8
  author='BrynQ',