pyegeria 0.7.45.1__py3-none-any.whl → 0.8.0__py3-none-any.whl

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.
Files changed (47) hide show
  1. examples/widgets/cat/list_cert_types.py +61 -43
  2. examples/widgets/cat/list_projects.py +1 -1
  3. examples/widgets/my/my_profile_actions.py +51 -32
  4. examples/widgets/ops/engine_actions.py +35 -23
  5. examples/widgets/ops/integration_daemon_actions.py +51 -32
  6. examples/widgets/tech/get_element_info.py +63 -38
  7. examples/widgets/tech/get_guid_info.py +50 -27
  8. examples/widgets/tech/list_asset_types.py +33 -23
  9. examples/widgets/tech/list_elements.py +44 -34
  10. examples/widgets/tech/list_elements_x.py +69 -49
  11. examples/widgets/tech/list_registered_services.py +44 -24
  12. examples/widgets/tech/list_related_specification.py +70 -45
  13. examples/widgets/tech/list_relationship_types.py +50 -31
  14. examples/widgets/tech/list_valid_metadata_values.py +57 -28
  15. examples/widgets/tech/x_list_related_elements.py +54 -34
  16. pyegeria/Xloaded_resources_omvs.py +43 -41
  17. pyegeria/__init__.py +5 -1
  18. pyegeria/_client.py +142 -102
  19. pyegeria/_deprecated_gov_engine.py +218 -167
  20. pyegeria/action_author_omvs.py +107 -88
  21. pyegeria/asset_catalog_omvs.py +467 -395
  22. pyegeria/automated_curation_omvs.py +2 -2
  23. pyegeria/classification_manager_omvs.py +3 -9
  24. pyegeria/collection_manager_omvs.py +1957 -1519
  25. pyegeria/core_omag_server_config.py +310 -192
  26. pyegeria/egeria_cat_client.py +88 -0
  27. pyegeria/egeria_config_client.py +37 -0
  28. pyegeria/egeria_my_client.py +47 -0
  29. pyegeria/egeria_ops_client.py +67 -0
  30. pyegeria/egeria_tech_client.py +77 -0
  31. pyegeria/feedback_manager_omvs.py +633 -631
  32. pyegeria/full_omag_server_config.py +330 -158
  33. pyegeria/glossary_browser_omvs.py +927 -474
  34. pyegeria/glossary_manager_omvs.py +1033 -543
  35. pyegeria/my_profile_omvs.py +714 -574
  36. pyegeria/platform_services.py +228 -176
  37. pyegeria/project_manager_omvs.py +1158 -903
  38. pyegeria/registered_info.py +76 -74
  39. pyegeria/runtime_manager_omvs.py +749 -670
  40. pyegeria/server_operations.py +123 -85
  41. pyegeria/valid_metadata_omvs.py +268 -168
  42. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
  43. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/RECORD +46 -42
  44. pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  45. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
  46. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
  47. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -35,17 +35,21 @@ class MyProfile(Client):
35
35
  """
36
36
 
37
37
  def __init__(
38
- self,
39
- server_name: str,
40
- platform_url: str,
41
- token: str = None,
42
- user_id: str = None,
43
- user_pwd: str = None,
44
- sync_mode: bool = True
38
+ self,
39
+ server_name: str,
40
+ platform_url: str,
41
+ token: str = None,
42
+ user_id: str = None,
43
+ user_pwd: str = None,
45
44
  ):
46
-
47
- Client.__init__(self, server_name, platform_url, user_id=user_id, user_pwd=user_pwd,
48
- token=token, async_mode=sync_mode)
45
+ Client.__init__(
46
+ self,
47
+ server_name,
48
+ platform_url,
49
+ user_id=user_id,
50
+ user_pwd=user_pwd,
51
+ token=token,
52
+ )
49
53
  self.my_profile_command_root: str = f"{platform_url}/servers"
50
54
 
51
55
  #
@@ -53,7 +57,7 @@ class MyProfile(Client):
53
57
  #
54
58
 
55
59
  async def _async_get_my_profile(self, server_name: str = None) -> dict | str:
56
- """ Get the profile of the user associated with the token used.
60
+ """Get the profile of the user associated with the token used.
57
61
 
58
62
  Parameters
59
63
  ----------
@@ -79,44 +83,52 @@ class MyProfile(Client):
79
83
  """
80
84
  if server_name is None:
81
85
  server_name = self.server_name
82
- url = f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile"
86
+ url = (
87
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile"
88
+ )
83
89
 
84
90
  response = await self._async_make_request("GET", url)
85
91
  return response
86
92
 
87
93
  def get_my_profile(self, server_name: str = None) -> dict | str:
88
- """ Get the profile of the user associated with the token used.
89
-
90
- Parameters
91
- ----------
92
- server_name : str, optional
93
- The name of the server to configure.
94
- If not provided, the server name associated with the instance is used.
95
-
96
- Returns
97
- -------
98
- List | str
99
-
100
- Profile details as a dict.
101
-
102
- Raises
103
- ------
104
-
105
- InvalidParameterException
106
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
107
- PropertyServerException
108
- Raised by the server when an issue arises in processing a valid request
109
- NotAuthorizedException
110
- The principle specified by the user_id does not have authorization for the requested action
111
- """
94
+ """Get the profile of the user associated with the token used.
95
+
96
+ Parameters
97
+ ----------
98
+ server_name : str, optional
99
+ The name of the server to configure.
100
+ If not provided, the server name associated with the instance is used.
101
+
102
+ Returns
103
+ -------
104
+ List | str
105
+
106
+ Profile details as a dict.
107
+
108
+ Raises
109
+ ------
110
+
111
+ InvalidParameterException
112
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
113
+ PropertyServerException
114
+ Raised by the server when an issue arises in processing a valid request
115
+ NotAuthorizedException
116
+ The principle specified by the user_id does not have authorization for the requested action
117
+ """
112
118
  loop = asyncio.get_event_loop()
113
119
  response = loop.run_until_complete(self._async_get_my_profile(server_name))
114
120
 
115
121
  return response.json().get("personalProfile", "No one found")
116
122
 
117
- async def _async_get_assigned_actions(self, actor_guid: str, status: str = "OPEN", server_name: str = None,
118
- start_from: int = 0, page_size: int = 100) -> list | str:
119
- """ Get assigned actions for the actor. Async version.
123
+ async def _async_get_assigned_actions(
124
+ self,
125
+ actor_guid: str,
126
+ status: str = "OPEN",
127
+ server_name: str = None,
128
+ start_from: int = 0,
129
+ page_size: int = 100,
130
+ ) -> list | str:
131
+ """Get assigned actions for the actor. Async version.
120
132
 
121
133
  Parameters
122
134
  ----------
@@ -153,16 +165,24 @@ class MyProfile(Client):
153
165
 
154
166
  body = {"status": status}
155
167
 
156
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/actors/{actor_guid}"
157
- f"/assigned/to-dos?startFrom={start_from}&pageSize={page_size}&")
168
+ url = (
169
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/actors/{actor_guid}"
170
+ f"/assigned/to-dos?startFrom={start_from}&pageSize={page_size}&"
171
+ )
158
172
 
159
173
  response = await self._async_make_request("POST", url, body)
160
174
 
161
175
  return response.json().get("elements", "No entries found")
162
176
 
163
- def get_assigned_actions(self, actor_guid: str, status: str = "OPEN", server_name: str = None, start_from: int = 0,
164
- page_size: int = 100) -> list | str:
165
- """ Get assigned actions for the actor.
177
+ def get_assigned_actions(
178
+ self,
179
+ actor_guid: str,
180
+ status: str = "OPEN",
181
+ server_name: str = None,
182
+ start_from: int = 0,
183
+ page_size: int = 100,
184
+ ) -> list | str:
185
+ """Get assigned actions for the actor.
166
186
  Parameters
167
187
  ----------
168
188
  actor_guid: str
@@ -192,44 +212,50 @@ class MyProfile(Client):
192
212
  """
193
213
  loop = asyncio.get_event_loop()
194
214
  response = loop.run_until_complete(
195
- self._async_get_assigned_actions(actor_guid, status, server_name,
196
- start_from, page_size)
215
+ self._async_get_assigned_actions(
216
+ actor_guid, status, server_name, start_from, page_size
217
+ )
197
218
  )
198
219
 
199
220
  return response
200
221
 
201
- async def _async_get_actions_for_action_target(self, element_guid: str, status: str = "OPEN",
202
- server_name: str = None,
203
- start_from: int = 0, page_size: int = 100) -> list | str:
204
- """ Get actions assigned to the action target. Async version.
222
+ async def _async_get_actions_for_action_target(
223
+ self,
224
+ element_guid: str,
225
+ status: str = "OPEN",
226
+ server_name: str = None,
227
+ start_from: int = 0,
228
+ page_size: int = 100,
229
+ ) -> list | str:
230
+ """Get actions assigned to the action target. Async version.
205
231
 
206
- Parameters
207
- ----------
208
- element_guid: str
209
- The GUID of the target whose assigned actions are to be retrieved.
210
- status: str
211
- The status of teh action to filter on. Default value is "OPEN".
212
- server_name: str, optional
213
- The name of the server. If not provided, the value of self.server_name will be used.
214
- start_from: int, optional
215
- The index from which to start retrieving the assigned actions. Default is 0.
216
- page_size: int, optional
217
- The number of assigned actions to retrieve per page. Default is 100.
232
+ Parameters
233
+ ----------
234
+ element_guid: str
235
+ The GUID of the target whose assigned actions are to be retrieved.
236
+ status: str
237
+ The status of teh action to filter on. Default value is "OPEN".
238
+ server_name: str, optional
239
+ The name of the server. If not provided, the value of self.server_name will be used.
240
+ start_from: int, optional
241
+ The index from which to start retrieving the assigned actions. Default is 0.
242
+ page_size: int, optional
243
+ The number of assigned actions to retrieve per page. Default is 100.
218
244
 
219
- Returns
220
- -------
221
- list or str
222
- A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
245
+ Returns
246
+ -------
247
+ list or str
248
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
223
249
 
224
- Raises
225
- ------
226
- InvalidParameterException
227
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
228
- PropertyServerException
229
- Raised by the server when an issue arises in processing a valid request
230
- NotAuthorizedException
231
- The principle specified by the user_id does not have authorization for the requested action
232
- """
250
+ Raises
251
+ ------
252
+ InvalidParameterException
253
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
254
+ PropertyServerException
255
+ Raised by the server when an issue arises in processing a valid request
256
+ NotAuthorizedException
257
+ The principle specified by the user_id does not have authorization for the requested action
258
+ """
233
259
  if server_name is None:
234
260
  server_name = self.server_name
235
261
 
@@ -237,82 +263,97 @@ class MyProfile(Client):
237
263
 
238
264
  body = {"status": status}
239
265
 
240
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
241
- f"/action-targets/to-dos?start-from={start_from}&page-size={page_size}")
266
+ url = (
267
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
268
+ f"/action-targets/to-dos?start-from={start_from}&page-size={page_size}"
269
+ )
242
270
 
243
271
  response = await self._async_make_request("POST", url, body)
244
272
  return response.json() if response is not None else "No Results"
245
273
 
246
- def get_actions_for_action_target(self, element_guid: str, status: str = "OPEN", server_name: str = None,
247
- start_from: int = 0, page_size: int = 100) -> list | str:
248
- """ Get actions assigned to the action target.
274
+ def get_actions_for_action_target(
275
+ self,
276
+ element_guid: str,
277
+ status: str = "OPEN",
278
+ server_name: str = None,
279
+ start_from: int = 0,
280
+ page_size: int = 100,
281
+ ) -> list | str:
282
+ """Get actions assigned to the action target.
249
283
 
250
- Parameters
251
- ----------
252
- element_guid: str
253
- The GUID of the target whose assigned actions are to be retrieved.
254
- status: str
255
- The status of teh action to filter on. Default value is "OPEN"
256
- server_name: str, optional
257
- The name of the server. If not provided, the value of self.server_name will be used.
258
- start_from: int, optional
259
- The index from which to start retrieving the assigned actions. Default is 0.
260
- page_size: int, optional
261
- The number of assigned actions to retrieve per page. Default is 100.
284
+ Parameters
285
+ ----------
286
+ element_guid: str
287
+ The GUID of the target whose assigned actions are to be retrieved.
288
+ status: str
289
+ The status of teh action to filter on. Default value is "OPEN"
290
+ server_name: str, optional
291
+ The name of the server. If not provided, the value of self.server_name will be used.
292
+ start_from: int, optional
293
+ The index from which to start retrieving the assigned actions. Default is 0.
294
+ page_size: int, optional
295
+ The number of assigned actions to retrieve per page. Default is 100.
262
296
 
263
- Returns
264
- -------
265
- list or str
266
- A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
297
+ Returns
298
+ -------
299
+ list or str
300
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
267
301
 
268
- Raises
269
- ------
270
- InvalidParameterException
271
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
272
- PropertyServerException
273
- Raised by the server when an issue arises in processing a valid request
274
- NotAuthorizedException
275
- The principle specified by the user_id does not have authorization for the requested action
276
- """
302
+ Raises
303
+ ------
304
+ InvalidParameterException
305
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
306
+ PropertyServerException
307
+ Raised by the server when an issue arises in processing a valid request
308
+ NotAuthorizedException
309
+ The principle specified by the user_id does not have authorization for the requested action
310
+ """
277
311
  loop = asyncio.get_event_loop()
278
312
  response = loop.run_until_complete(
279
- self._async_get_actions_for_action_target(element_guid, status, server_name,
280
- start_from, page_size)
313
+ self._async_get_actions_for_action_target(
314
+ element_guid, status, server_name, start_from, page_size
315
+ )
281
316
  )
282
317
 
283
318
  return response
284
319
 
285
- async def _async_get_actions_for_sponsor(self, element_guid: str, status: str = "", server_name: str = None,
286
- start_from: int = 0, page_size: int = 100) -> list | str:
287
- """ Get actions assigned to an owner. Async version.
320
+ async def _async_get_actions_for_sponsor(
321
+ self,
322
+ element_guid: str,
323
+ status: str = "",
324
+ server_name: str = None,
325
+ start_from: int = 0,
326
+ page_size: int = 100,
327
+ ) -> list | str:
328
+ """Get actions assigned to an owner. Async version.
288
329
 
289
- Parameters
290
- ----------
291
- element_guid: str
292
- The GUID of the target whose assigned actions are to be retrieved.
293
- status: str
294
- The status of the action to filter on. Default value is "OPEN".
295
- server_name: str, optional
296
- The name of the server. If not provided, the value of self.server_name will be used.
297
- start_from: int, optional
298
- The index from which to start retrieving the assigned actions. Default is 0.
299
- page_size: int, optional
300
- The number of assigned actions to retrieve per page. Default is 100.
330
+ Parameters
331
+ ----------
332
+ element_guid: str
333
+ The GUID of the target whose assigned actions are to be retrieved.
334
+ status: str
335
+ The status of the action to filter on. Default value is "OPEN".
336
+ server_name: str, optional
337
+ The name of the server. If not provided, the value of self.server_name will be used.
338
+ start_from: int, optional
339
+ The index from which to start retrieving the assigned actions. Default is 0.
340
+ page_size: int, optional
341
+ The number of assigned actions to retrieve per page. Default is 100.
301
342
 
302
- Returns
303
- -------
304
- list or str
305
- A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
343
+ Returns
344
+ -------
345
+ list or str
346
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
306
347
 
307
- Raises
308
- ------
309
- InvalidParameterException
310
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
311
- PropertyServerException
312
- Raised by the server when an issue arises in processing a valid request
313
- NotAuthorizedException
314
- The principle specified by the user_id does not have authorization for the requested action
315
- """
348
+ Raises
349
+ ------
350
+ InvalidParameterException
351
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
352
+ PropertyServerException
353
+ Raised by the server when an issue arises in processing a valid request
354
+ NotAuthorizedException
355
+ The principle specified by the user_id does not have authorization for the requested action
356
+ """
316
357
  if server_name is None:
317
358
  server_name = self.server_name
318
359
 
@@ -320,50 +361,60 @@ class MyProfile(Client):
320
361
 
321
362
  body = {"status": status}
322
363
 
323
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
324
- f"/sponsored/to-dos?startFrom={start_from}&pageSize={page_size}")
364
+ url = (
365
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/elements/{element_guid}"
366
+ f"/sponsored/to-dos?startFrom={start_from}&pageSize={page_size}"
367
+ )
325
368
 
326
369
  response = await self._async_make_request("POST", url, body)
327
370
  return response.json() if response is not None else "No Results"
328
371
 
329
- def get_actions_for_sponsor(self, element_guid: str, status: str = "OPEN", server_name: str = None,
330
- start_from: int = 0, page_size: int = 100) -> list | str:
331
- """ Get actions assigned to an owner.
332
- Parameters
333
- ----------
334
- element_guid: str
335
- The GUID of the target whose assigned actions are to be retrieved.
336
- status: str
337
- The status of teh action to filter on. Default value is "OPEN".
338
- server_name: str, optional
339
- The name of the server. If not provided, the value of self.server_name will be used.
340
- start_from: int, optional
341
- The index from which to start retrieving the assigned actions. Default is 0.
342
- page_size: int, optional
343
- The number of assigned actions to retrieve per page. Default is 100.
372
+ def get_actions_for_sponsor(
373
+ self,
374
+ element_guid: str,
375
+ status: str = "OPEN",
376
+ server_name: str = None,
377
+ start_from: int = 0,
378
+ page_size: int = 100,
379
+ ) -> list | str:
380
+ """Get actions assigned to an owner.
381
+ Parameters
382
+ ----------
383
+ element_guid: str
384
+ The GUID of the target whose assigned actions are to be retrieved.
385
+ status: str
386
+ The status of teh action to filter on. Default value is "OPEN".
387
+ server_name: str, optional
388
+ The name of the server. If not provided, the value of self.server_name will be used.
389
+ start_from: int, optional
390
+ The index from which to start retrieving the assigned actions. Default is 0.
391
+ page_size: int, optional
392
+ The number of assigned actions to retrieve per page. Default is 100.
344
393
 
345
- Returns
346
- -------
347
- list or str
348
- A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
394
+ Returns
395
+ -------
396
+ list or str
397
+ A list of assigned actions is returned. If there aren't any, a string is returned indicating that.
349
398
 
350
- Raises
351
- ------
352
- InvalidParameterException
353
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
354
- PropertyServerException
355
- Raised by the server when an issue arises in processing a valid request
356
- NotAuthorizedException
357
- The principle specified by the user_id does not have authorization for the requested action
358
- """
399
+ Raises
400
+ ------
401
+ InvalidParameterException
402
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
403
+ PropertyServerException
404
+ Raised by the server when an issue arises in processing a valid request
405
+ NotAuthorizedException
406
+ The principle specified by the user_id does not have authorization for the requested action
407
+ """
359
408
  loop = asyncio.get_event_loop()
360
- response = loop.run_until_complete(self._async_get_actions_for_sponsor(
361
- element_guid, status, server_name, start_from, page_size)
409
+ response = loop.run_until_complete(
410
+ self._async_get_actions_for_sponsor(
411
+ element_guid, status, server_name, start_from, page_size
412
+ )
362
413
  )
363
414
  return response
364
415
 
365
416
  async def _async_create_to_do(self, body: dict, server_name: str = None) -> str:
366
- """ Create a To-Do item. Async version.
417
+ """Create a To-Do item. Async version.
367
418
  Parameters
368
419
  ----------
369
420
  body : dict
@@ -394,7 +445,7 @@ class MyProfile(Client):
394
445
  return response.json().get("guid", "No guid returned")
395
446
 
396
447
  def create_to_do(self, body: dict, server_name: str = None) -> str:
397
- """ Create a To-Do item.
448
+ """Create a To-Do item.
398
449
  Parameters
399
450
  ----------
400
451
  body : dict
@@ -434,37 +485,37 @@ class MyProfile(Client):
434
485
  },
435
486
  "assignToActorGUID": erins_guid
436
487
  }
437
- """
488
+ """
438
489
  loop = asyncio.get_event_loop()
439
- response = loop.run_until_complete(
440
- self._async_create_to_do(body, server_name)
441
- )
490
+ response = loop.run_until_complete(self._async_create_to_do(body, server_name))
442
491
  return response
443
492
 
444
- async def _async_get_to_do(self, todo_guid: str, server_name: str = None) -> dict | str:
445
- """ Get a To-Do item. Async version.
446
- Parameters
447
- ----------
448
- todo_guid: str
449
- Identifier of the To-Do item.
450
- server_name : str, optional
451
- The name of the server where the to-do item will be created. If not provided,
452
- the default server name associated with the instance of the class will be used.
453
-
454
- Returns
455
- -------
456
- None
457
- This method does not return any value.
458
-
459
- Raises
460
- ------
461
- InvalidParameterException
462
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
463
- PropertyServerException
464
- Raised by the server when an issue arises in processing a valid request
465
- NotAuthorizedException
466
- The principle specified by the user_id does not have authorization for the requested action
467
- """
493
+ async def _async_get_to_do(
494
+ self, todo_guid: str, server_name: str = None
495
+ ) -> dict | str:
496
+ """Get a To-Do item. Async version.
497
+ Parameters
498
+ ----------
499
+ todo_guid: str
500
+ Identifier of the To-Do item.
501
+ server_name : str, optional
502
+ The name of the server where the to-do item will be created. If not provided,
503
+ the default server name associated with the instance of the class will be used.
504
+
505
+ Returns
506
+ -------
507
+ None
508
+ This method does not return any value.
509
+
510
+ Raises
511
+ ------
512
+ InvalidParameterException
513
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
514
+ PropertyServerException
515
+ Raised by the server when an issue arises in processing a valid request
516
+ NotAuthorizedException
517
+ The principle specified by the user_id does not have authorization for the requested action
518
+ """
468
519
  if server_name is None:
469
520
  server_name = self.server_name
470
521
 
@@ -477,61 +528,68 @@ class MyProfile(Client):
477
528
  return json.loads(response.text).get("elements", "No TODO returned")
478
529
 
479
530
  def get_to_do(self, todo_guid: str, server_name: str = None) -> dict | str:
480
- """ Get a To-Do item. Async version.
481
- Parameters
482
- ----------
483
- todo_guid: str
484
- Identifier of the To-Do item.
485
- server_name : str, optional
486
- The name of the server where the to-do item will be created. If not provided,
487
- the default server name associated with the instance of the class will be used.
488
-
489
- Returns
490
- -------
491
- None
492
- This method does not return any value.
493
-
494
- Raises
495
- ------
496
- InvalidParameterException
497
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
498
- PropertyServerException
499
- Raised by the server when an issue arises in processing a valid request
500
- NotAuthorizedException
501
- The principle specified by the user_id does not have authorization for the requested action
502
- """
531
+ """Get a To-Do item. Async version.
532
+ Parameters
533
+ ----------
534
+ todo_guid: str
535
+ Identifier of the To-Do item.
536
+ server_name : str, optional
537
+ The name of the server where the to-do item will be created. If not provided,
538
+ the default server name associated with the instance of the class will be used.
539
+
540
+ Returns
541
+ -------
542
+ None
543
+ This method does not return any value.
544
+
545
+ Raises
546
+ ------
547
+ InvalidParameterException
548
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
549
+ PropertyServerException
550
+ Raised by the server when an issue arises in processing a valid request
551
+ NotAuthorizedException
552
+ The principle specified by the user_id does not have authorization for the requested action
553
+ """
503
554
  loop = asyncio.get_event_loop()
504
- response = loop.run_until_complete(self._async_get_to_do(todo_guid, server_name))
555
+ response = loop.run_until_complete(
556
+ self._async_get_to_do(todo_guid, server_name)
557
+ )
505
558
 
506
559
  return response
507
560
 
508
- async def _async_update_to_do(self, todo_guid: str, body: dict, is_merge_update: bool = True,
509
- server_name: str = None) -> None:
510
- """ Update a To-Do item. Async version.
511
- Parameters
512
- ----------
513
- todo_guid: str
514
- Identifier of the To-Do item.
515
- body: str
516
- The details to update the to-do item with.
517
- server_name : str, optional
518
- The name of the server where the to-do item will be created. If not provided,
519
- the default server name associated with the instance of the class will be used.
561
+ async def _async_update_to_do(
562
+ self,
563
+ todo_guid: str,
564
+ body: dict,
565
+ is_merge_update: bool = True,
566
+ server_name: str = None,
567
+ ) -> None:
568
+ """Update a To-Do item. Async version.
569
+ Parameters
570
+ ----------
571
+ todo_guid: str
572
+ Identifier of the To-Do item.
573
+ body: str
574
+ The details to update the to-do item with.
575
+ server_name : str, optional
576
+ The name of the server where the to-do item will be created. If not provided,
577
+ the default server name associated with the instance of the class will be used.
520
578
 
521
- Returns
522
- -------
523
- None
524
- This method does not return any value.
579
+ Returns
580
+ -------
581
+ None
582
+ This method does not return any value.
525
583
 
526
- Raises
527
- ------
528
- InvalidParameterException
529
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
530
- PropertyServerException
531
- Raised by the server when an issue arises in processing a valid request
532
- NotAuthorizedException
533
- The principle specified by the user_id does not have authorization for the requested action
534
- """
584
+ Raises
585
+ ------
586
+ InvalidParameterException
587
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
588
+ PropertyServerException
589
+ Raised by the server when an issue arises in processing a valid request
590
+ NotAuthorizedException
591
+ The principle specified by the user_id does not have authorization for the requested action
592
+ """
535
593
  if server_name is None:
536
594
  server_name = self.server_name
537
595
 
@@ -539,138 +597,153 @@ class MyProfile(Client):
539
597
 
540
598
  validate_name(todo_guid)
541
599
 
542
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
543
- f"{todo_guid}?isMergeUpdate={is_merge_update_t}")
600
+ url = (
601
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
602
+ f"{todo_guid}?isMergeUpdate={is_merge_update_t}"
603
+ )
544
604
 
545
605
  await self._async_make_request("POST", url, body)
546
606
  return
547
607
 
548
- def update_to_do(self, todo_guid: str, body: dict, is_merge_update: bool = True,
549
- server_name: str = None) -> None:
550
- """ Update a To-Do item.
551
- Parameters
552
- ----------
553
- todo_guid: str
554
- Identifier of the To-Do item.
555
- body: str
556
- The details to update the to-do item with.
557
- is_merge_update: bool [default: True]
558
- If true then merges the updated information, otherwise replace the existing information.
559
- server_name : str, optional
560
- The name of the server where the to-do item will be created. If not provided,
561
- the default server name associated with the instance of the class will be used.
608
+ def update_to_do(
609
+ self,
610
+ todo_guid: str,
611
+ body: dict,
612
+ is_merge_update: bool = True,
613
+ server_name: str = None,
614
+ ) -> None:
615
+ """Update a To-Do item.
616
+ Parameters
617
+ ----------
618
+ todo_guid: str
619
+ Identifier of the To-Do item.
620
+ body: str
621
+ The details to update the to-do item with.
622
+ is_merge_update: bool [default: True]
623
+ If true then merges the updated information, otherwise replace the existing information.
624
+ server_name : str, optional
625
+ The name of the server where the to-do item will be created. If not provided,
626
+ the default server name associated with the instance of the class will be used.
562
627
 
563
- Returns
564
- -------
565
- None
566
- This method does not return any value.
628
+ Returns
629
+ -------
630
+ None
631
+ This method does not return any value.
567
632
 
568
- Raises
569
- ------
570
- InvalidParameterException
571
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
572
- PropertyServerException
573
- Raised by the server when an issue arises in processing a valid request
574
- NotAuthorizedException
575
- The principle specified by the user_id does not have authorization for the requested action
576
- """
633
+ Raises
634
+ ------
635
+ InvalidParameterException
636
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
637
+ PropertyServerException
638
+ Raised by the server when an issue arises in processing a valid request
639
+ NotAuthorizedException
640
+ The principle specified by the user_id does not have authorization for the requested action
641
+ """
577
642
 
578
643
  loop = asyncio.get_event_loop()
579
- loop.run_until_complete(self._async_update_to_do(todo_guid, body, is_merge_update, server_name))
644
+ loop.run_until_complete(
645
+ self._async_update_to_do(todo_guid, body, is_merge_update, server_name)
646
+ )
580
647
  return
581
648
 
582
- async def _async_delete_to_do(self, todo_guid: str, server_name: str = None) -> None:
583
- """ Delete a To-Do item. Async version.
584
- Parameters
585
- ----------
586
- todo_guid: str
587
- Identifier of the To-Do item.
588
- server_name : str, optional
589
- The name of the server where the to-do item will be created. If not provided,
590
- the default server name associated with the instance of the class will be used.
649
+ async def _async_delete_to_do(
650
+ self, todo_guid: str, server_name: str = None
651
+ ) -> None:
652
+ """Delete a To-Do item. Async version.
653
+ Parameters
654
+ ----------
655
+ todo_guid: str
656
+ Identifier of the To-Do item.
657
+ server_name : str, optional
658
+ The name of the server where the to-do item will be created. If not provided,
659
+ the default server name associated with the instance of the class will be used.
591
660
 
592
- Returns
593
- -------
594
- None
595
- This method does not return any value.
661
+ Returns
662
+ -------
663
+ None
664
+ This method does not return any value.
596
665
 
597
- Raises
598
- ------
599
- InvalidParameterException
600
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
601
- PropertyServerException
602
- Raised by the server when an issue arises in processing a valid request
603
- NotAuthorizedException
604
- The principle specified by the user_id does not have authorization for the requested action
605
- """
666
+ Raises
667
+ ------
668
+ InvalidParameterException
669
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
670
+ PropertyServerException
671
+ Raised by the server when an issue arises in processing a valid request
672
+ NotAuthorizedException
673
+ The principle specified by the user_id does not have authorization for the requested action
674
+ """
606
675
  if server_name is None:
607
676
  server_name = self.server_name
608
677
 
609
678
  validate_name(todo_guid)
610
679
 
611
-
612
680
  url = f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/{todo_guid}/delete"
613
681
 
614
682
  await self._async_make_request("POST", url)
615
683
  return
616
684
 
617
685
  def delete_to_do(self, todo_guid: str, server_name: str = None) -> None:
618
- """ Delete a To-Do item.
619
- Parameters
620
- ----------
621
- todo_guid: str
622
- Identifier of the To-Do item.
623
- server_name : str, optional
624
- The name of the server where the to-do item will be created. If not provided,
625
- the default server name associated with the instance of the class will be used.
686
+ """Delete a To-Do item.
687
+ Parameters
688
+ ----------
689
+ todo_guid: str
690
+ Identifier of the To-Do item.
691
+ server_name : str, optional
692
+ The name of the server where the to-do item will be created. If not provided,
693
+ the default server name associated with the instance of the class will be used.
626
694
 
627
- Returns
628
- -------
629
- None
630
- This method does not return any value.
695
+ Returns
696
+ -------
697
+ None
698
+ This method does not return any value.
631
699
 
632
- Raises
633
- ------
634
- InvalidParameterException
635
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
636
- PropertyServerException
637
- Raised by the server when an issue arises in processing a valid request
638
- NotAuthorizedException
639
- The principle specified by the user_id does not have authorization for the requested action
640
- """
700
+ Raises
701
+ ------
702
+ InvalidParameterException
703
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
704
+ PropertyServerException
705
+ Raised by the server when an issue arises in processing a valid request
706
+ NotAuthorizedException
707
+ The principle specified by the user_id does not have authorization for the requested action
708
+ """
641
709
  loop = asyncio.get_event_loop()
642
710
  loop.run_until_complete(self._async_delete_to_do(todo_guid, server_name))
643
711
  return
644
712
 
645
- async def _async_reassign_to_do(self, todo_guid: str, actor_guid: str, status: str = "OPEN",
646
- server_name: str = None) -> None:
647
- """ Reassign a To-Do item. Async version.
648
- Parameters
649
- ----------
650
- todo_guid: str
651
- Identifier of the To-Do item.
652
- actor_guid: str
653
- The actor to receive the reassigned to-do item.
654
- status: str [default = "OPEN"]
655
- Filter items to match this status.
656
- server_name : str, optional
657
- The name of the server where the to-do item will be created. If not provided,
658
- the default server name associated with the instance of the class will be used.
713
+ async def _async_reassign_to_do(
714
+ self,
715
+ todo_guid: str,
716
+ actor_guid: str,
717
+ status: str = "OPEN",
718
+ server_name: str = None,
719
+ ) -> None:
720
+ """Reassign a To-Do item. Async version.
721
+ Parameters
722
+ ----------
723
+ todo_guid: str
724
+ Identifier of the To-Do item.
725
+ actor_guid: str
726
+ The actor to receive the reassigned to-do item.
727
+ status: str [default = "OPEN"]
728
+ Filter items to match this status.
729
+ server_name : str, optional
730
+ The name of the server where the to-do item will be created. If not provided,
731
+ the default server name associated with the instance of the class will be used.
659
732
 
660
- Returns
661
- -------
662
- None
663
- This method does not return any value.
733
+ Returns
734
+ -------
735
+ None
736
+ This method does not return any value.
664
737
 
665
- Raises
666
- ------
667
- InvalidParameterException
668
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
669
- PropertyServerException
670
- Raised by the server when an issue arises in processing a valid request
671
- NotAuthorizedException
672
- The principle specified by the user_id does not have authorization for the requested action
673
- """
738
+ Raises
739
+ ------
740
+ InvalidParameterException
741
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
742
+ PropertyServerException
743
+ Raised by the server when an issue arises in processing a valid request
744
+ NotAuthorizedException
745
+ The principle specified by the user_id does not have authorization for the requested action
746
+ """
674
747
  if server_name is None:
675
748
  server_name = self.server_name
676
749
 
@@ -678,77 +751,95 @@ class MyProfile(Client):
678
751
  validate_name(actor_guid)
679
752
  body = {"status": status}
680
753
 
681
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
682
- f"{todo_guid}/reassign/{actor_guid}")
754
+ url = (
755
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
756
+ f"{todo_guid}/reassign/{actor_guid}"
757
+ )
683
758
 
684
759
  await self._async_make_request("POST", url, body)
685
760
  return
686
761
 
687
- def reassign_to_do(self, todo_guid: str, actor_guid: str, status: str = "OPEN", server_name: str = None) -> None:
688
- """ Reassign a To-Do item.
689
- Parameters
690
- ----------
691
- todo_guid: str
692
- Identifier of the To-Do item.
693
- actor_guid: str
694
- The actor to receive the reassigned to-do item.
695
- status: str [default = "OPEN"]
696
- Filter items to match this status.
697
- server_name : str, optional
698
- The name of the server where the to-do item will be created. If not provided,
699
- the default server name associated with the instance of the class will be used.
762
+ def reassign_to_do(
763
+ self,
764
+ todo_guid: str,
765
+ actor_guid: str,
766
+ status: str = "OPEN",
767
+ server_name: str = None,
768
+ ) -> None:
769
+ """Reassign a To-Do item.
770
+ Parameters
771
+ ----------
772
+ todo_guid: str
773
+ Identifier of the To-Do item.
774
+ actor_guid: str
775
+ The actor to receive the reassigned to-do item.
776
+ status: str [default = "OPEN"]
777
+ Filter items to match this status.
778
+ server_name : str, optional
779
+ The name of the server where the to-do item will be created. If not provided,
780
+ the default server name associated with the instance of the class will be used.
700
781
 
701
- Returns
702
- -------
703
- None
704
- This method does not return any value.
782
+ Returns
783
+ -------
784
+ None
785
+ This method does not return any value.
705
786
 
706
- Raises
707
- ------
708
- InvalidParameterException
709
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
710
- PropertyServerException
711
- Raised by the server when an issue arises in processing a valid request
712
- NotAuthorizedException
713
- The principle specified by the user_id does not have authorization for the requested action
714
- """
787
+ Raises
788
+ ------
789
+ InvalidParameterException
790
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
791
+ PropertyServerException
792
+ Raised by the server when an issue arises in processing a valid request
793
+ NotAuthorizedException
794
+ The principle specified by the user_id does not have authorization for the requested action
795
+ """
715
796
  loop = asyncio.get_event_loop()
716
- loop.run_until_complete(self._async_reassign_to_do(todo_guid, actor_guid, status, server_name))
797
+ loop.run_until_complete(
798
+ self._async_reassign_to_do(todo_guid, actor_guid, status, server_name)
799
+ )
717
800
  return
718
801
 
719
- async def _async_find_to_do(self, search_string: str = "*", server_name: str = "None", status: str = None,
720
- starts_with: bool = False, ends_with: bool = False, ignore_case: bool = True,
721
- start_from: int = 0, page_size: int = 100) -> list | str:
722
- """ find To-Do items. Async version.
723
- Parameters
724
- ----------
725
- search_string: str
726
- String to search against. If '*' then all to-do items will match.
727
- server_name : str, optional
728
- The name of the server where the to-do item will be created. If not provided,
729
- the default server name associated with the instance of the class will be used.
730
- status: str
731
- Filter items to match this status. Defaults to "OPEN"
732
- starts_with : bool, [default=False], optional
733
- Starts with the supplied string.
734
- ends_with : bool, [default=False], optional
735
- Ends with the supplied string
736
- ignore_case : bool, [default=False], optional
737
- Ignore case when searching
738
- Returns
739
- -------
740
- None
741
- List of To-Do items that match the criteria
742
-
743
- Raises
744
- ------
745
- InvalidParameterException
746
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
747
- PropertyServerException
748
- Raised by the server when an issue arises in processing a valid request
749
- NotAuthorizedException
750
- The principle specified by the user_id does not have authorization for the requested action
751
- """
802
+ async def _async_find_to_do(
803
+ self,
804
+ search_string: str = "*",
805
+ server_name: str = "None",
806
+ status: str = None,
807
+ starts_with: bool = False,
808
+ ends_with: bool = False,
809
+ ignore_case: bool = True,
810
+ start_from: int = 0,
811
+ page_size: int = 100,
812
+ ) -> list | str:
813
+ """find To-Do items. Async version.
814
+ Parameters
815
+ ----------
816
+ search_string: str
817
+ String to search against. If '*' then all to-do items will match.
818
+ server_name : str, optional
819
+ The name of the server where the to-do item will be created. If not provided,
820
+ the default server name associated with the instance of the class will be used.
821
+ status: str
822
+ Filter items to match this status. Defaults to "OPEN"
823
+ starts_with : bool, [default=False], optional
824
+ Starts with the supplied string.
825
+ ends_with : bool, [default=False], optional
826
+ Ends with the supplied string
827
+ ignore_case : bool, [default=False], optional
828
+ Ignore case when searching
829
+ Returns
830
+ -------
831
+ None
832
+ List of To-Do items that match the criteria
833
+
834
+ Raises
835
+ ------
836
+ InvalidParameterException
837
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
838
+ PropertyServerException
839
+ Raised by the server when an issue arises in processing a valid request
840
+ NotAuthorizedException
841
+ The principle specified by the user_id does not have authorization for the requested action
842
+ """
752
843
  if server_name is None:
753
844
  server_name = self.server_name
754
845
 
@@ -756,175 +847,216 @@ class MyProfile(Client):
756
847
  ends_with_s = str(ends_with).lower()
757
848
  ignore_case_s = str(ignore_case).lower()
758
849
 
759
- if search_string == '*':
850
+ if search_string == "*":
760
851
  search_string = " "
761
852
 
762
853
  body = {
763
854
  "class": "ToDoStatusSearchString",
764
855
  "toDoStatus": status,
765
- "searchString": search_string
856
+ "searchString": search_string,
766
857
  }
767
858
 
768
859
  validate_search_string(search_string)
769
860
 
770
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
771
- f"find-by-search-string?startFrom={start_from}&pageSize={page_size}&"
772
- f"startsWith={starts_with_s}&endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
861
+ url = (
862
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
863
+ f"find-by-search-string?startFrom={start_from}&pageSize={page_size}&"
864
+ f"startsWith={starts_with_s}&endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
865
+ )
773
866
 
774
867
  response = await self._async_make_request("POST", url, body_slimmer(body))
775
868
  # return response.text
776
869
  return response.json().get("elements", "No ToDos found")
777
870
 
778
- def find_to_do(self, search_string: str, server_name: str = None, status: str = "OPEN",
779
- starts_with: bool = False, ends_with: bool = False, ignore_case: bool = True,
780
- start_from: int = 0, page_size: int = 100) -> list | str:
781
- """ find To-Do items.
782
- Parameters
783
- ----------
784
- search_string: str
785
- String to search against. If '*' then all to-do items will match.
786
- server_name : str, optional
787
- The name of the server where the to-do item will be created. If not provided,
788
- the default server name associated with the instance of the class will be used.
789
- status: str
790
- Filter items to match this status. Defaults to "OPEN"
791
- starts_with : bool, [default=False], optional
792
- Starts with the supplied string.
793
- ends_with : bool, [default=False], optional
794
- Ends with the supplied string
795
- ignore_case : bool, [default=False], optional
796
- Ignore case when searching
797
- start_from: int, [default=0], optional
798
- When multiple pages of results are available, the page number to start from.
799
- page_size: int, [default=None]
800
- The number of items to return in a single page. If not specified, the default will be taken from
801
- the class instance.
802
- Returns
803
- -------
804
- None
805
- List of To-Do items that match the criteria
871
+ def find_to_do(
872
+ self,
873
+ search_string: str,
874
+ server_name: str = None,
875
+ status: str = "OPEN",
876
+ starts_with: bool = False,
877
+ ends_with: bool = False,
878
+ ignore_case: bool = True,
879
+ start_from: int = 0,
880
+ page_size: int = 100,
881
+ ) -> list | str:
882
+ """find To-Do items.
883
+ Parameters
884
+ ----------
885
+ search_string: str
886
+ String to search against. If '*' then all to-do items will match.
887
+ server_name : str, optional
888
+ The name of the server where the to-do item will be created. If not provided,
889
+ the default server name associated with the instance of the class will be used.
890
+ status: str
891
+ Filter items to match this status. Defaults to "OPEN"
892
+ starts_with : bool, [default=False], optional
893
+ Starts with the supplied string.
894
+ ends_with : bool, [default=False], optional
895
+ Ends with the supplied string
896
+ ignore_case : bool, [default=False], optional
897
+ Ignore case when searching
898
+ start_from: int, [default=0], optional
899
+ When multiple pages of results are available, the page number to start from.
900
+ page_size: int, [default=None]
901
+ The number of items to return in a single page. If not specified, the default will be taken from
902
+ the class instance.
903
+ Returns
904
+ -------
905
+ None
906
+ List of To-Do items that match the criteria
806
907
 
807
- Raises
808
- ------
809
- InvalidParameterException
810
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
811
- PropertyServerException
812
- Raised by the server when an issue arises in processing a valid request
813
- NotAuthorizedException
814
- The principle specified by the user_id does not have authorization for the requested action
815
- """
908
+ Raises
909
+ ------
910
+ InvalidParameterException
911
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
912
+ PropertyServerException
913
+ Raised by the server when an issue arises in processing a valid request
914
+ NotAuthorizedException
915
+ The principle specified by the user_id does not have authorization for the requested action
916
+ """
816
917
  loop = asyncio.get_event_loop()
817
- response = loop.run_until_complete(self._async_find_to_do(search_string, server_name, status, starts_with,
818
- ends_with, ignore_case, start_from, page_size))
918
+ response = loop.run_until_complete(
919
+ self._async_find_to_do(
920
+ search_string,
921
+ server_name,
922
+ status,
923
+ starts_with,
924
+ ends_with,
925
+ ignore_case,
926
+ start_from,
927
+ page_size,
928
+ )
929
+ )
819
930
  return response
820
931
 
821
- async def _async_get_to_dos_by_type(self, todo_type: str, server_name: str = None, status: str = "OPEN",
822
- start_from: int = 0, page_size: int = 100) -> list | str:
823
- """ Get To-Do items by type. Async version
824
- Parameters
825
- ----------
826
- todo_type: str
827
- Type of to-do to find
828
- server_name : str, optional
829
- The name of the server where the to-do item will be created. If not provided,
830
- the default server name associated with the instance of the class will be used.
831
- status: str
832
- Filter items to match this status. Defaults to "OPEN"
833
- start_from: int, [default=0], optional
834
- When multiple pages of results are available, the page number to start from.
835
- page_size: int, [default=None]
836
- The number of items to return in a single page. If not specified, the default will be taken from
837
- the class instance.
838
- Returns
839
- -------
840
- List of To-Do items that match the criteria
932
+ async def _async_get_to_dos_by_type(
933
+ self,
934
+ todo_type: str,
935
+ server_name: str = None,
936
+ status: str = "OPEN",
937
+ start_from: int = 0,
938
+ page_size: int = 100,
939
+ ) -> list | str:
940
+ """Get To-Do items by type. Async version
941
+ Parameters
942
+ ----------
943
+ todo_type: str
944
+ Type of to-do to find
945
+ server_name : str, optional
946
+ The name of the server where the to-do item will be created. If not provided,
947
+ the default server name associated with the instance of the class will be used.
948
+ status: str
949
+ Filter items to match this status. Defaults to "OPEN"
950
+ start_from: int, [default=0], optional
951
+ When multiple pages of results are available, the page number to start from.
952
+ page_size: int, [default=None]
953
+ The number of items to return in a single page. If not specified, the default will be taken from
954
+ the class instance.
955
+ Returns
956
+ -------
957
+ List of To-Do items that match the criteria
841
958
 
842
- Raises
843
- ------
844
- InvalidParameterException
845
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
846
- PropertyServerException
847
- Raised by the server when an issue arises in processing a valid request
848
- NotAuthorizedException
849
- The principle specified by the user_id does not have authorization for the requested action
850
- """
959
+ Raises
960
+ ------
961
+ InvalidParameterException
962
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
963
+ PropertyServerException
964
+ Raised by the server when an issue arises in processing a valid request
965
+ NotAuthorizedException
966
+ The principle specified by the user_id does not have authorization for the requested action
967
+ """
851
968
  if server_name is None:
852
969
  server_name = self.server_name
853
970
 
854
971
  validate_name(todo_type)
855
972
  body = {
856
973
  "status": status,
857
-
858
974
  }
859
975
 
860
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/types/"
861
- f"{todo_type}?startFrom={start_from}&pageSize={page_size}")
976
+ url = (
977
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/types/"
978
+ f"{todo_type}?startFrom={start_from}&pageSize={page_size}"
979
+ )
862
980
 
863
981
  response = await self._async_make_request("POST", url, body)
864
982
  return response.json().get("elements", "No ToDos found")
865
983
 
866
- def get_to_dos_by_type(self, todo_type: str, server_name: str = None, status: str = "OPEN",
867
- start_from: int = 0, page_size: int = 100) -> list | str:
868
- """ Get To-Do items by type.
869
- Parameters
870
- ----------
871
- todo_type: str
872
- Type of to-do to find
873
- server_name : str, optional
874
- The name of the server where the to-do item will be created. If not provided,
875
- the default server name associated with the instance of the class will be used.
876
- status: str
877
- Filter items to match this status. Defaults to "OPEN"
878
- start_from: int, [default=0], optional
879
- When multiple pages of results are available, the page number to start from.
880
- page_size: int, [default=None]
881
- The number of items to return in a single page. If not specified, the default will be taken from
882
- the class instance.
883
- Returns
884
- -------
885
- List of To-Do items that match the criteria
984
+ def get_to_dos_by_type(
985
+ self,
986
+ todo_type: str,
987
+ server_name: str = None,
988
+ status: str = "OPEN",
989
+ start_from: int = 0,
990
+ page_size: int = 100,
991
+ ) -> list | str:
992
+ """Get To-Do items by type.
993
+ Parameters
994
+ ----------
995
+ todo_type: str
996
+ Type of to-do to find
997
+ server_name : str, optional
998
+ The name of the server where the to-do item will be created. If not provided,
999
+ the default server name associated with the instance of the class will be used.
1000
+ status: str
1001
+ Filter items to match this status. Defaults to "OPEN"
1002
+ start_from: int, [default=0], optional
1003
+ When multiple pages of results are available, the page number to start from.
1004
+ page_size: int, [default=None]
1005
+ The number of items to return in a single page. If not specified, the default will be taken from
1006
+ the class instance.
1007
+ Returns
1008
+ -------
1009
+ List of To-Do items that match the criteria
886
1010
 
887
- Raises
888
- ------
889
- InvalidParameterException
890
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
891
- PropertyServerException
892
- Raised by the server when an issue arises in processing a valid request
893
- NotAuthorizedException
894
- The principle specified by the user_id does not have authorization for the requested action
895
- """
1011
+ Raises
1012
+ ------
1013
+ InvalidParameterException
1014
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1015
+ PropertyServerException
1016
+ Raised by the server when an issue arises in processing a valid request
1017
+ NotAuthorizedException
1018
+ The principle specified by the user_id does not have authorization for the requested action
1019
+ """
896
1020
  loop = asyncio.get_event_loop()
897
- response = loop.run_until_complete(self._async_get_to_dos_by_type(todo_type, server_name, status,
898
- start_from, page_size))
1021
+ response = loop.run_until_complete(
1022
+ self._async_get_to_dos_by_type(
1023
+ todo_type, server_name, status, start_from, page_size
1024
+ )
1025
+ )
899
1026
  return response
900
1027
 
901
- async def _async_update_action_target_properties(self, action_target_guid: str, body: dict,
902
- is_merge_update: bool = True, server_name: str = None) -> None:
903
- """ Get To-Do items by type. Async version
904
- Parameters
905
- ----------
906
- action_target_guid: str
907
- Identity of the action target to update.
908
- body: dict
909
- Details of the updates to make.
910
- is_merge_update : bool, [default=True], optional
911
- indicates if the update should be a merge or replacement.
912
- server_name : str, optional
913
- The name of the server where the to-do item will be created. If not provided,
914
- the default server name associated with the instance of the class will be used.
915
- Returns
916
- -------
917
- None
1028
+ async def _async_update_action_target_properties(
1029
+ self,
1030
+ action_target_guid: str,
1031
+ body: dict,
1032
+ is_merge_update: bool = True,
1033
+ server_name: str = None,
1034
+ ) -> None:
1035
+ """Get To-Do items by type. Async version
1036
+ Parameters
1037
+ ----------
1038
+ action_target_guid: str
1039
+ Identity of the action target to update.
1040
+ body: dict
1041
+ Details of the updates to make.
1042
+ is_merge_update : bool, [default=True], optional
1043
+ indicates if the update should be a merge or replacement.
1044
+ server_name : str, optional
1045
+ The name of the server where the to-do item will be created. If not provided,
1046
+ the default server name associated with the instance of the class will be used.
1047
+ Returns
1048
+ -------
1049
+ None
918
1050
 
919
- Raises
920
- ------
921
- InvalidParameterException
922
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
923
- PropertyServerException
924
- Raised by the server when an issue arises in processing a valid request
925
- NotAuthorizedException
926
- The principle specified by the user_id does not have authorization for the requested action
927
- """
1051
+ Raises
1052
+ ------
1053
+ InvalidParameterException
1054
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1055
+ PropertyServerException
1056
+ Raised by the server when an issue arises in processing a valid request
1057
+ NotAuthorizedException
1058
+ The principle specified by the user_id does not have authorization for the requested action
1059
+ """
928
1060
  if server_name is None:
929
1061
  server_name = self.server_name
930
1062
 
@@ -932,42 +1064,50 @@ class MyProfile(Client):
932
1064
 
933
1065
  validate_name(action_target_guid)
934
1066
 
935
- url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
936
- f"action-targets/{action_target_guid}?isMergeUpdate={is_merge_update_t}")
1067
+ url = (
1068
+ f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
1069
+ f"action-targets/{action_target_guid}?isMergeUpdate={is_merge_update_t}"
1070
+ )
937
1071
 
938
1072
  await self._async_make_request("POST", url, body)
939
1073
  return
940
1074
 
941
- def update_action_target_properties(self, action_target_guid: str, body: dict,
942
- is_merge_update: bool = True, server_name: str = None) -> None:
943
- """ Get To-Do items by type.
944
- Parameters
945
- ----------
946
- action_target_guid: str
947
- Identity of the action target to update.
948
- body: dict
949
- Details of the updates to make.
950
- is_merge_update : bool, [default=True], optional
951
- indicates if the update should be a merge or replacement.
952
- server_name : str, optional
953
- The name of the server where the to-do item will be created. If not provided,
954
- the default server name associated with the instance of the class will be used.
955
- Returns
956
- -------
957
- None
1075
+ def update_action_target_properties(
1076
+ self,
1077
+ action_target_guid: str,
1078
+ body: dict,
1079
+ is_merge_update: bool = True,
1080
+ server_name: str = None,
1081
+ ) -> None:
1082
+ """Get To-Do items by type.
1083
+ Parameters
1084
+ ----------
1085
+ action_target_guid: str
1086
+ Identity of the action target to update.
1087
+ body: dict
1088
+ Details of the updates to make.
1089
+ is_merge_update : bool, [default=True], optional
1090
+ indicates if the update should be a merge or replacement.
1091
+ server_name : str, optional
1092
+ The name of the server where the to-do item will be created. If not provided,
1093
+ the default server name associated with the instance of the class will be used.
1094
+ Returns
1095
+ -------
1096
+ None
958
1097
 
959
- Raises
960
- ------
961
- InvalidParameterException
962
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
963
- PropertyServerException
964
- Raised by the server when an issue arises in processing a valid request
965
- NotAuthorizedException
966
- The principle specified by the user_id does not have authorization for the requested action
967
- """
1098
+ Raises
1099
+ ------
1100
+ InvalidParameterException
1101
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1102
+ PropertyServerException
1103
+ Raised by the server when an issue arises in processing a valid request
1104
+ NotAuthorizedException
1105
+ The principle specified by the user_id does not have authorization for the requested action
1106
+ """
968
1107
  loop = asyncio.get_event_loop()
969
- loop.run_until_complete(self._async_update_action_target_properties(action_target_guid,
970
- body, is_merge_update,
971
- server_name))
1108
+ loop.run_until_complete(
1109
+ self._async_update_action_target_properties(
1110
+ action_target_guid, body, is_merge_update, server_name
1111
+ )
1112
+ )
972
1113
  return
973
-