pyegeria 5.4.4.2__py3-none-any.whl → 5.4.4.4__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 (31) hide show
  1. commands/cat/list_format_set.py +6 -2
  2. md_processing/.obsidian/plugins/obsidian-sample-plugin/.git/index +0 -0
  3. md_processing/__init__.py +1 -1
  4. md_processing/dr_egeria.py +5 -0
  5. md_processing/md_commands/data_designer_commands.py +17 -11
  6. md_processing/md_commands/ext_ref_commands.py +9 -6
  7. md_processing/md_commands/glossary_commands.py +6 -2
  8. md_processing/md_commands/governance_officer_commands.py +122 -13
  9. md_processing/md_commands/product_manager_commands.py +10 -6
  10. md_processing/md_commands/project_commands.py +5 -2
  11. md_processing/md_processing_utils/md_processing_constants.py +4 -2
  12. pyegeria/__init__.py +1 -1
  13. pyegeria/_client_new.py +471 -44
  14. pyegeria/_output_formats.py +1384 -143
  15. pyegeria/classification_manager_omvs.py +4 -4
  16. pyegeria/collection_manager.py +2 -2
  17. pyegeria/external_references.py +100 -209
  18. pyegeria/glossary_manager.py +3 -89
  19. pyegeria/governance_officer.py +194 -95
  20. pyegeria/output_formatter.py +4 -0
  21. pyegeria/project_manager.py +1 -0
  22. pyegeria/solution_architect.py +0 -90
  23. pyegeria/utils.py +5 -64
  24. {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/METADATA +1 -1
  25. {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/RECORD +28 -31
  26. commands/cat/debug_log.2025-09-10_13-48-37_153090.log.zip +0 -0
  27. md_processing/dr-egeria-outbox/Business-Imperative-DrE-2025-09-11-21-21-15.md +0 -33
  28. md_processing/md_commands/old_solution_architect_commands.py +0 -1139
  29. {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/LICENSE +0 -0
  30. {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/WHEEL +0 -0
  31. {pyegeria-5.4.4.2.dist-info → pyegeria-5.4.4.4.dist-info}/entry_points.txt +0 -0
pyegeria/_client_new.py CHANGED
@@ -25,18 +25,18 @@ from pydantic import TypeAdapter
25
25
  from pyegeria._exceptions_new import (
26
26
  PyegeriaAPIException, PyegeriaConnectionException, PyegeriaInvalidParameterException,
27
27
  PyegeriaUnknownException, PyegeriaClientException
28
- )
28
+ )
29
29
  from pyegeria._globals import enable_ssl_check, max_paging_size, NO_ELEMENTS_FOUND
30
30
  from pyegeria._validators import (
31
31
  validate_name,
32
32
  validate_server_name,
33
33
  validate_url,
34
34
  validate_user_id,
35
- )
35
+ )
36
36
  from pyegeria.models import SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody, \
37
37
  TemplateRequestBody, UpdateStatusRequestBody, UpdateElementRequestBody, NewRelationshipRequestBody, \
38
38
  DeleteRequestBody, UpdateRelationshipRequestBody, ResultsRequestBody, NewClassificationRequestBody
39
- from pyegeria.utils import body_slimmer
39
+ from pyegeria.utils import body_slimmer, dynamic_catch
40
40
 
41
41
  ...
42
42
 
@@ -91,7 +91,7 @@ class Client2:
91
91
  token_src: str = None,
92
92
  api_key: str = None,
93
93
  page_size: int = max_paging_size,
94
- ):
94
+ ):
95
95
  self.server_name = validate_server_name(server_name)
96
96
  self.platform_url = validate_url(platform_url)
97
97
  self.user_id = user_id
@@ -102,6 +102,7 @@ class Client2:
102
102
  self.exc_type = None
103
103
  self.exc_value = None
104
104
  self.exc_tb = None
105
+ # self.url_marker = "MetadataExpert"
105
106
 
106
107
  #
107
108
  # I'm commenting this out since you should only have to use tokens if you want - just have to
@@ -119,10 +120,10 @@ class Client2:
119
120
 
120
121
  self.headers = {
121
122
  "Content-Type": "application/json",
122
- }
123
+ }
123
124
  self.text_headers = {
124
125
  "Content-Type": "text/plain",
125
- }
126
+ }
126
127
  if self.api_key is not None:
127
128
  self.headers["X-Api-Key"] = self.api_key
128
129
  self.text_headers["X-Api-Key"] = self.api_key
@@ -138,7 +139,7 @@ class Client2:
138
139
  if validate_server_name(server_name):
139
140
  self.server_name = server_name
140
141
  self.session = AsyncClient(verify=enable_ssl_check)
141
-
142
+ self.command_root: str = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/generic"
142
143
  self._search_string_request_adapter = TypeAdapter(SearchStringRequestBody)
143
144
  self._filter_request_adapter = TypeAdapter(FilterRequestBody)
144
145
  self._get_request_adapter = TypeAdapter(GetRequestBody)
@@ -180,7 +181,7 @@ class Client2:
180
181
 
181
182
  async def _async_create_egeria_bearer_token(
182
183
  self, user_id: str = None, password: str = None
183
- ) -> str:
184
+ ) -> str:
184
185
  """Create and set an Egeria Bearer Token for the user. Async version
185
186
  Parameters
186
187
  ----------
@@ -237,7 +238,7 @@ class Client2:
237
238
 
238
239
  def create_egeria_bearer_token(
239
240
  self, user_id: str = None, password: str = None
240
- ) -> str:
241
+ ) -> str:
241
242
  """Create and set an Egeria Bearer Token for the user
242
243
  Parameters
243
244
  ----------
@@ -269,7 +270,7 @@ class Client2:
269
270
  loop = asyncio.get_event_loop()
270
271
  response = loop.run_until_complete(
271
272
  self._async_create_egeria_bearer_token(user_id, password)
272
- )
273
+ )
273
274
  return response
274
275
 
275
276
  async def _async_refresh_egeria_bearer_token(self) -> str:
@@ -296,7 +297,7 @@ class Client2:
296
297
  ):
297
298
  token = await self._async_create_egeria_bearer_token(
298
299
  self.user_id, self.user_pwd
299
- )
300
+ )
300
301
  return token
301
302
  else:
302
303
  additional_info = {"reason": "Invalid token source"}
@@ -383,7 +384,7 @@ class Client2:
383
384
  payload: str | dict = None,
384
385
  time_out: int = 30,
385
386
  is_json: bool = True
386
- ) -> Response | str:
387
+ ) -> Response | str:
387
388
  """Make a request to the Egeria API."""
388
389
  try:
389
390
  loop = asyncio.get_running_loop()
@@ -404,7 +405,7 @@ class Client2:
404
405
  payload: str | dict = None,
405
406
  time_out: int = 30,
406
407
  is_json: bool = True
407
- ) -> Response | str:
408
+ ) -> Response | str:
408
409
  """Make a request to the Egeria API - Async Version
409
410
  Function to make an API call via the self.session Library. Raise an exception if the HTTP response code
410
411
  is not 200/201. IF there is a REST communication exception, raise InvalidParameterException.
@@ -429,17 +430,17 @@ class Client2:
429
430
  if request_type == "GET":
430
431
  response = await self.session.get(
431
432
  endpoint, params=payload, headers=self.headers, timeout=time_out
432
- )
433
+ )
433
434
 
434
435
  elif request_type == "POST":
435
436
  if payload is None:
436
437
  response = await self.session.post(
437
438
  endpoint, headers=self.headers, timeout=time_out
438
- )
439
+ )
439
440
  elif type(payload) is dict:
440
441
  response = await self.session.post(
441
442
  endpoint, json=payload, headers=self.headers, timeout=time_out
442
- )
443
+ )
443
444
  elif type(payload) is str:
444
445
  # if is_json:
445
446
  # response = await self.session.post(
@@ -451,7 +452,7 @@ class Client2:
451
452
  headers=self.headers,
452
453
  content=payload,
453
454
  timeout=time_out,
454
- )
455
+ )
455
456
  else:
456
457
  # response = await self.session.post(
457
458
  # endpoint, headers=self.headers, json=payload, timeout=time_out)
@@ -462,12 +463,12 @@ class Client2:
462
463
  if True:
463
464
  response = await self.session.post(
464
465
  endpoint, headers=self.headers, data=payload, timeout=time_out
465
- )
466
+ )
466
467
  elif request_type == "DELETE":
467
468
  if True:
468
469
  response = await self.session.delete(
469
470
  endpoint, headers=self.headers, timeout=time_out
470
- )
471
+ )
471
472
  response.raise_for_status()
472
473
 
473
474
  status_code = response.status_code
@@ -520,7 +521,7 @@ class Client2:
520
521
  context['caught_exception'] = e
521
522
  raise PyegeriaInvalidParameterException(
522
523
  response, context, e=e
523
- )
524
+ )
524
525
 
525
526
  def build_global_guid_lists(self) -> None:
526
527
  global template_guids, integration_guids
@@ -579,7 +580,7 @@ class Client2:
579
580
  property_name: str = "qualifiedName",
580
581
  qualified_name: str = None,
581
582
  tech_type: str = None,
582
- ) -> str:
583
+ ) -> str:
583
584
  """Helper function to return a server_guid - one of server_guid, qualified_name or display_name should
584
585
  contain information. If all are None, an exception will be thrown. If all contain
585
586
  values, server_guid will be used first, followed by qualified_name. If the tech_type is supplied and the
@@ -602,7 +603,7 @@ class Client2:
602
603
  "forLineage": False,
603
604
  "forDuplicateProcessing": False,
604
605
  "effectiveTime": None,
605
- }
606
+ }
606
607
  url = (
607
608
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
608
609
  f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
@@ -626,7 +627,7 @@ class Client2:
626
627
  "forLineage": False,
627
628
  "forDuplicateProcessing": False,
628
629
  "effectiveTime": None,
629
- }
630
+ }
630
631
  url = (
631
632
  f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
632
633
  f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
@@ -642,7 +643,7 @@ class Client2:
642
643
  "forLineage": False,
643
644
  "forDuplicateProcessing": False,
644
645
  "effectiveTime": None,
645
- }
646
+ }
646
647
  url = (
647
648
  f"{self.platform_url}/servers/{view_server}/api/open-metadata/classification-manager/"
648
649
  f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
@@ -655,7 +656,7 @@ class Client2:
655
656
  "reason": "Neither server_guid nor server_name were provided - please provide.",
656
657
  "parameters": (f"GUID={guid}, display_name={display_name}, property_name={property_name},"
657
658
  f"qualified_name={qualified_name}, tech_type={tech_type}")
658
- }
659
+ }
659
660
  raise PyegeriaInvalidParameterException(None, None, additional_info)
660
661
 
661
662
  def __get_guid__(
@@ -665,7 +666,7 @@ class Client2:
665
666
  property_name: str = "qualifiedName",
666
667
  qualified_name: str = None,
667
668
  tech_type: str = None,
668
- ) -> str:
669
+ ) -> str:
669
670
  """Helper function to return a server_guid - one of server_guid, qualified_name or display_name should
670
671
  contain information. If all are None, an exception will be thrown. If all contain
671
672
  values, server_guid will be used first, followed by qualified_name. If the tech_type is supplied and the
@@ -680,8 +681,8 @@ class Client2:
680
681
  result = loop.run_until_complete(
681
682
  self.__async_get_guid__(
682
683
  guid, display_name, property_name, qualified_name, tech_type
683
- )
684
684
  )
685
+ )
685
686
  return result
686
687
 
687
688
  def __create_qualified_name__(self, type: str, display_name: str, local_qualifier: str = None,
@@ -728,7 +729,7 @@ class Client2:
728
729
  body = {
729
730
  "class": "EffectiveTimeQueryRequestBody",
730
731
  "effectiveTime": None,
731
- }
732
+ }
732
733
 
733
734
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/elements/"
734
735
  f"{element_guid}?forLineage=false&forDuplicateProcessing=false")
@@ -759,7 +760,7 @@ class Client2:
759
760
  return validated_body
760
761
 
761
762
  def validate_new_element_from_template_request(self, body: dict | TemplateRequestBody
762
- ) -> NewElementRequestBody | None:
763
+ ) -> NewElementRequestBody | None:
763
764
  if isinstance(body, TemplateRequestBody):
764
765
  validated_body = body
765
766
 
@@ -791,7 +792,7 @@ class Client2:
791
792
  return validated_body
792
793
 
793
794
  def validate_new_classification_request(self, body: dict | NewClassificationRequestBody,
794
- prop: str = None) -> NewClassificationRequestBody | None:
795
+ prop: str = None) -> NewClassificationRequestBody | None:
795
796
  if isinstance(body, NewClassificationRequestBody):
796
797
  if (prop and body.properties.class_ == prop) or (prop is None):
797
798
  validated_body = body
@@ -816,12 +817,12 @@ class Client2:
816
817
  validated_body = body
817
818
  elif isinstance(body, dict):
818
819
  validated_body = self._delete_request_adapter.validate_python(body)
819
- else: # handle case where body not provided
820
- body= {
820
+ else: # handle case where body not provided
821
+ body = {
821
822
  "class": "DeleteRequestBody",
822
823
  "cascadeDelete": cascade_delete
823
- }
824
- validated_body= DeleteRequestBody.model_validate(body)
824
+ }
825
+ validated_body = DeleteRequestBody.model_validate(body)
825
826
  return validated_body
826
827
 
827
828
  def validate_update_element_request(self, body: dict | UpdateElementRequestBody,
@@ -855,7 +856,7 @@ class Client2:
855
856
  body = {
856
857
  "class": "UpdateStatusRequestBody",
857
858
  "newStatus": status
858
- }
859
+ }
859
860
  validated_body = UpdateStatusRequestBody.model_validate(body)
860
861
  else:
861
862
  raise PyegeriaInvalidParameterException(additional_info={"reason": "invalid parameters"})
@@ -905,7 +906,7 @@ class Client2:
905
906
  "page_size": page_size,
906
907
  "include_only_classified_elements": classification_names,
907
908
  "metadata_element_subtype_names": metadata_element_types,
908
- }
909
+ }
909
910
  validated_body = SearchStringRequestBody.model_validate(body)
910
911
 
911
912
  # classification_names = validated_body.include_only_classified_elements
@@ -944,7 +945,7 @@ class Client2:
944
945
  "start_from": start_from,
945
946
  "page_size": page_size,
946
947
  "include_only_classified_elements": classification_names,
947
- }
948
+ }
948
949
  validated_body = FilterRequestBody.model_validate(body)
949
950
 
950
951
  # classification_names = validated_body.include_only_classified_elements
@@ -976,7 +977,7 @@ class Client2:
976
977
  body = {
977
978
  "class": "GetRequestBody",
978
979
  "metadataElementTypeName": _type
979
- }
980
+ }
980
981
  validated_body = GetRequestBody.model_validate(body)
981
982
 
982
983
  json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
@@ -1005,7 +1006,7 @@ class Client2:
1005
1006
  "class": "ResultsRequestBody",
1006
1007
  "start_from": start_from,
1007
1008
  "page_size": page_size,
1008
- }
1009
+ }
1009
1010
  validated_body = ResultsRequestBody.model_validate(body)
1010
1011
 
1011
1012
  json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
@@ -1069,7 +1070,7 @@ class Client2:
1069
1070
  await self._async_make_request("POST", url)
1070
1071
 
1071
1072
  async def _async_new_classification_request(self, url: str, prop: str,
1072
- body: dict | NewRelationshipRequestBody = None) -> None:
1073
+ body: dict | NewRelationshipRequestBody = None) -> None:
1073
1074
  validated_body = self.validate_new_classification_request(body, prop)
1074
1075
  if validated_body:
1075
1076
  json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
@@ -1088,9 +1089,8 @@ class Client2:
1088
1089
  else:
1089
1090
  await self._async_make_request("POST", url)
1090
1091
 
1091
-
1092
1092
  async def _async_update_relationship_request(self, url: str, prop: str,
1093
- body: dict | UpdateRelationshipRequestBody = None) -> None:
1093
+ body: dict | UpdateRelationshipRequestBody = None) -> None:
1094
1094
  validated_body = self.validate_update_relationship_request(body, prop)
1095
1095
  if validated_body:
1096
1096
  json_body = validated_body.model_dump_json(indent=2, exclude_none=True)
@@ -1099,6 +1099,433 @@ class Client2:
1099
1099
  else:
1100
1100
  await self._async_make_request("POST", url)
1101
1101
 
1102
+ @dynamic_catch
1103
+ async def _async_update_element_status(self, guid: str, status: str = None,
1104
+ body: dict | UpdateStatusRequestBody = None) -> None:
1105
+ """ Update the status of an element. Async version.
1106
+
1107
+ Parameters
1108
+ ----------
1109
+ guid: str
1110
+ The guid of the element to update.
1111
+ status: str, optional
1112
+ The new lifecycle status for the element. Ignored, if the body is provided.
1113
+ body: dict | UpdateStatusRequestBody, optional
1114
+ A structure representing the details of the element status to update. If supplied, these details
1115
+ supersede the status parameter provided.
1116
+
1117
+ Returns
1118
+ -------
1119
+ Nothing
1120
+
1121
+ Raises
1122
+ ------
1123
+ PyegeriaException
1124
+ ValidationError
1125
+
1126
+ Notes
1127
+ -----
1128
+ JSON Structure looks like:
1129
+ {
1130
+ "class": "UpdateStatusRequestBody",
1131
+ "newStatus": "APPROVED",
1132
+ "externalSourceGUID": "add guid here",
1133
+ "externalSourceName": "add qualified name here",
1134
+ "effectiveTime": "{{$isoTimestamp}}",
1135
+ "forLineage": false,
1136
+ "forDuplicateProcessing": false
1137
+ }
1138
+ """
1139
+
1140
+ url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/"
1141
+ f"{self.url_marker}/metadata-elements/{guid}/update-status")
1142
+ await self._async_update_status_request(url, status, body)
1143
+
1144
+ @dynamic_catch
1145
+ def update_element_status(self, guid: str, status: str = None,
1146
+ body: dict | UpdateStatusRequestBody = None) -> None:
1147
+ """ Update the status of an element. Async version.
1148
+
1149
+ Parameters
1150
+ ----------
1151
+ guid: str
1152
+ The guid of the element to update.
1153
+ status: str, optional
1154
+ The new lifecycle status for the element. Ignored, if the body is provided.
1155
+ body: dict | UpdateStatusRequestBody, optional
1156
+ A structure representing the details of the element status to update. If supplied, these details
1157
+ supersede the status parameter provided.
1158
+
1159
+ Returns
1160
+ -------
1161
+ Nothing
1162
+
1163
+ Raises
1164
+ ------
1165
+ PyegeriaException
1166
+ ValidationError
1167
+
1168
+ Notes
1169
+ -----
1170
+ JSON Structure looks like:
1171
+ {
1172
+ "class": "UpdateStatusRequestBody",
1173
+ "newStatus": "APPROVED",
1174
+ "externalSourceGUID": "add guid here",
1175
+ "externalSourceName": "add qualified name here",
1176
+ "effectiveTime": "{{$isoTimestamp}}",
1177
+ "forLineage": false,
1178
+ "forDuplicateProcessing": false
1179
+ }
1180
+ """
1181
+ loop = asyncio.get_event_loop()
1182
+ loop.run_until_complete(self._async_update_element_status(guid, status, body))
1183
+
1184
+ @dynamic_catch
1185
+ async def _async_update_element_effectivity(self, guid: str, effectivity_time: str = None, body: dict = None) -> None:
1186
+ """ Update the status of an element. Async version.
1187
+
1188
+ Parameters
1189
+ ----------
1190
+ guid: str
1191
+ The guid of the element to update.
1192
+ effectivity_time: str, optional
1193
+ The new effectivity time for the element.
1194
+ body: dict, optional
1195
+ A structure representing the details of the effectivity time to update. If supplied, these details
1196
+ supersede the effectivity time parameter provided.
1197
+
1198
+ Returns
1199
+ -------
1200
+ Nothing
1201
+
1202
+ Raises
1203
+ ------
1204
+ PyegeriaException
1205
+ ValidationError
1206
+
1207
+ Notes
1208
+ -----
1209
+ JSON Structure looks like:
1210
+ {
1211
+ "class" : "UpdateEffectivityDatesRequestBody",
1212
+ "externalSourceGUID" : "",
1213
+ "externalSourceName" : "",
1214
+ "effectiveFrom" : "{{$isoTimestamp}}",
1215
+ "effectiveTo": "{{$isoTimestamp}}",
1216
+ "forLineage" : false,
1217
+ "forDuplicateProcessing" : false,
1218
+ "effectiveTime" : "{{$isoTimestamp}}"
1219
+ }
1220
+ """
1102
1221
 
1103
- if __name__ == "__main__":
1104
- print("Main-__client")
1222
+ url = f"{self.command_root}/metadata-elements/{guid}/update-effectivity"
1223
+ if body is None:
1224
+ body = {
1225
+ "class": "UpdateEffectivityRequestBody",
1226
+ "effectiveTime": effectivity_time
1227
+ }
1228
+ logger.info(body)
1229
+ await self._async_make_request("POST", url, body)
1230
+
1231
+
1232
+
1233
+ @dynamic_catch
1234
+ def update_element_effectivity(self, guid: str, status: str = None,
1235
+ body: dict = None) -> None:
1236
+ """ Update the status of an element. Async version.
1237
+
1238
+ Parameters
1239
+ ----------
1240
+ guid: str
1241
+ The guid of the element to update.
1242
+ effectivity_time: str, optional
1243
+ The new effectivity time for the element.
1244
+ body: dict, optional
1245
+ A structure representing the details of the effectivity time to update. If supplied, these details
1246
+ supersede the effectivity time parameter provided.
1247
+
1248
+ Returns
1249
+ -------
1250
+ Nothing
1251
+
1252
+ Raises
1253
+ ------
1254
+ PyegeriaException
1255
+ ValidationError
1256
+
1257
+ Notes
1258
+ -----
1259
+ JSON Structure looks like:
1260
+ {
1261
+ "class" : "UpdateEffectivityDatesRequestBody",
1262
+ "externalSourceGUID" : "",
1263
+ "externalSourceName" : "",
1264
+ "effectiveFrom" : "{{$isoTimestamp}}",
1265
+ "effectiveTo": "{{$isoTimestamp}}",
1266
+ "forLineage" : false,
1267
+ "forDuplicateProcessing" : false,
1268
+ "effectiveTime" : "{{$isoTimestamp}}"
1269
+ }
1270
+ """
1271
+ loop = asyncio.get_event_loop()
1272
+ loop.run_until_complete(self._async_update_element_status(guid, status, body))
1273
+ #
1274
+ # @dynamic_catch
1275
+ # async def _async_classify_element(self, guid: str, status: str = None,
1276
+ # body: dict | UpdateStatusRequestBody = None) -> None:
1277
+ # """ Update the status of an element. Async version.
1278
+ #
1279
+ # Parameters
1280
+ # ----------
1281
+ # guid: str
1282
+ # The guid of the element to update.
1283
+ # status: str, optional
1284
+ # The new lifecycle status for the element. Ignored, if the body is provided.
1285
+ # body: dict | UpdateStatusRequestBody, optional
1286
+ # A structure representing the details of the element status to update. If supplied, these details
1287
+ # supersede the status parameter provided.
1288
+ #
1289
+ # Returns
1290
+ # -------
1291
+ # Nothing
1292
+ #
1293
+ # Raises
1294
+ # ------
1295
+ # PyegeriaException
1296
+ # ValidationError
1297
+ #
1298
+ # Notes
1299
+ # -----
1300
+ # JSON Structure looks like:
1301
+ # {
1302
+ # "class": "UpdateStatusRequestBody",
1303
+ # "newStatus": "APPROVED",
1304
+ # "externalSourceGUID": "add guid here",
1305
+ # "externalSourceName": "add qualified name here",
1306
+ # "effectiveTime": "{{$isoTimestamp}}",
1307
+ # "forLineage": false,
1308
+ # "forDuplicateProcessing": false
1309
+ # }
1310
+ # """
1311
+ #
1312
+ # url = f"{self.command_root}/metadata-elements/{guid}/update-status"
1313
+ # await self._async_update_status_request(url, status, body)
1314
+ #
1315
+ # @dynamic_catch
1316
+ # def classify_element(self, guid: str, status: str = None,
1317
+ # body: dict | UpdateStatusRequestBody = None) -> None:
1318
+ # """ Update the status of an element. Async version.
1319
+ #
1320
+ # Parameters
1321
+ # ----------
1322
+ # guid: str
1323
+ # The guid of the element to update.
1324
+ # status: str, optional
1325
+ # The new lifecycle status for the element. Ignored, if the body is provided.
1326
+ # body: dict | UpdateStatusRequestBody, optional
1327
+ # A structure representing the details of the element status to update. If supplied, these details
1328
+ # supersede the status parameter provided.
1329
+ #
1330
+ # Returns
1331
+ # -------
1332
+ # Nothing
1333
+ #
1334
+ # Raises
1335
+ # ------
1336
+ # PyegeriaException
1337
+ # ValidationError
1338
+ #
1339
+ # Notes
1340
+ # -----
1341
+ # JSON Structure looks like:
1342
+ # {
1343
+ # "class": "UpdateStatusRequestBody",
1344
+ # "newStatus": "APPROVED",
1345
+ # "externalSourceGUID": "add guid here",
1346
+ # "externalSourceName": "add qualified name here",
1347
+ # "effectiveTime": "{{$isoTimestamp}}",
1348
+ # "forLineage": false,
1349
+ # "forDuplicateProcessing": false
1350
+ # }
1351
+ # """
1352
+ # loop = asyncio.get_event_loop()
1353
+ # loop.run_until_complete(self._async_update_element_status(guid, status, body))
1354
+ #
1355
+ # @dynamic_catch
1356
+ # async def _async_reclassify_element(self, guid: str, effectivity_time: str = None,
1357
+ # body: dict = None) -> None:
1358
+ # """ Update the status of an element. Async version.
1359
+ #
1360
+ # Parameters
1361
+ # ----------
1362
+ # guid: str
1363
+ # The guid of the element to update.
1364
+ # effectivity_time: str, optional
1365
+ # The new effectivity time for the element.
1366
+ # body: dict, optional
1367
+ # A structure representing the details of the effectivity time to update. If supplied, these details
1368
+ # supersede the effectivity time parameter provided.
1369
+ #
1370
+ # Returns
1371
+ # -------
1372
+ # Nothing
1373
+ #
1374
+ # Raises
1375
+ # ------
1376
+ # PyegeriaException
1377
+ # ValidationError
1378
+ #
1379
+ # Notes
1380
+ # -----
1381
+ # JSON Structure looks like:
1382
+ # {
1383
+ # "class" : "UpdateEffectivityDatesRequestBody",
1384
+ # "externalSourceGUID" : "",
1385
+ # "externalSourceName" : "",
1386
+ # "effectiveFrom" : "{{$isoTimestamp}}",
1387
+ # "effectiveTo": "{{$isoTimestamp}}",
1388
+ # "forLineage" : false,
1389
+ # "forDuplicateProcessing" : false,
1390
+ # "effectiveTime" : "{{$isoTimestamp}}"
1391
+ # }
1392
+ # """
1393
+ #
1394
+ # url = f"{self.command_root}/metadata-elements/{guid}/update-effectivity"
1395
+ # if body is None:
1396
+ # body = {
1397
+ # "class": "UpdateEffectivityRequestBody",
1398
+ # "effectiveTime": effectivity_time
1399
+ # }
1400
+ # logger.info(body)
1401
+ # await self._async_make_request("POST", url, body)
1402
+ #
1403
+ # @dynamic_catch
1404
+ # def reclassify_element(self, guid: str, status: str = None,
1405
+ # body: dict = None) -> None:
1406
+ # """ Update the status of an element. Async version.
1407
+ #
1408
+ # Parameters
1409
+ # ----------
1410
+ # guid: str
1411
+ # The guid of the element to update.
1412
+ # effectivity_time: str, optional
1413
+ # The new effectivity time for the element.
1414
+ # body: dict, optional
1415
+ # A structure representing the details of the effectivity time to update. If supplied, these details
1416
+ # supersede the effectivity time parameter provided.
1417
+ #
1418
+ # Returns
1419
+ # -------
1420
+ # Nothing
1421
+ #
1422
+ # Raises
1423
+ # ------
1424
+ # PyegeriaException
1425
+ # ValidationError
1426
+ #
1427
+ # Notes
1428
+ # -----
1429
+ # JSON Structure looks like:
1430
+ # {
1431
+ # "class" : "UpdateEffectivityDatesRequestBody",
1432
+ # "externalSourceGUID" : "",
1433
+ # "externalSourceName" : "",
1434
+ # "effectiveFrom" : "{{$isoTimestamp}}",
1435
+ # "effectiveTo": "{{$isoTimestamp}}",
1436
+ # "forLineage" : false,
1437
+ # "forDuplicateProcessing" : false,
1438
+ # "effectiveTime" : "{{$isoTimestamp}}"
1439
+ # }
1440
+ # """
1441
+ # loop = asyncio.get_event_loop()
1442
+ # loop.run_until_complete(self._async_update_element_status(guid, status, body))
1443
+ #
1444
+ # @dynamic_catch
1445
+ # async def _async_declassify_element(self, guid: str, effectivity_time: str = None,
1446
+ # body: dict = None) -> None:
1447
+ # """ Update the status of an element. Async version.
1448
+ #
1449
+ # Parameters
1450
+ # ----------
1451
+ # guid: str
1452
+ # The guid of the element to update.
1453
+ # effectivity_time: str, optional
1454
+ # The new effectivity time for the element.
1455
+ # body: dict, optional
1456
+ # A structure representing the details of the effectivity time to update. If supplied, these details
1457
+ # supersede the effectivity time parameter provided.
1458
+ #
1459
+ # Returns
1460
+ # -------
1461
+ # Nothing
1462
+ #
1463
+ # Raises
1464
+ # ------
1465
+ # PyegeriaException
1466
+ # ValidationError
1467
+ #
1468
+ # Notes
1469
+ # -----
1470
+ # JSON Structure looks like:
1471
+ # {
1472
+ # "class" : "UpdateEffectivityDatesRequestBody",
1473
+ # "externalSourceGUID" : "",
1474
+ # "externalSourceName" : "",
1475
+ # "effectiveFrom" : "{{$isoTimestamp}}",
1476
+ # "effectiveTo": "{{$isoTimestamp}}",
1477
+ # "forLineage" : false,
1478
+ # "forDuplicateProcessing" : false,
1479
+ # "effectiveTime" : "{{$isoTimestamp}}"
1480
+ # }
1481
+ # """
1482
+ #
1483
+ # url = f"{self.command_root}/metadata-elements/{guid}/update-effectivity"
1484
+ # if body is None:
1485
+ # body = {
1486
+ # "class": "UpdateEffectivityRequestBody",
1487
+ # "effectiveTime": effectivity_time
1488
+ # }
1489
+ # logger.info(body)
1490
+ # await self._async_make_request("POST", url, body)
1491
+ #
1492
+ # @dynamic_catch
1493
+ # def declassify_element(self, guid: str, status: str = None,
1494
+ # body: dict = None) -> None:
1495
+ # """ Update the status of an element. Async version.
1496
+ #
1497
+ # Parameters
1498
+ # ----------
1499
+ # guid: str
1500
+ # The guid of the element to update.
1501
+ # effectivity_time: str, optional
1502
+ # The new effectivity time for the element.
1503
+ # body: dict, optional
1504
+ # A structure representing the details of the effectivity time to update. If supplied, these details
1505
+ # supersede the effectivity time parameter provided.
1506
+ #
1507
+ # Returns
1508
+ # -------
1509
+ # Nothing
1510
+ #
1511
+ # Raises
1512
+ # ------
1513
+ # PyegeriaException
1514
+ # ValidationError
1515
+ #
1516
+ # Notes
1517
+ # -----
1518
+ # JSON Structure looks like:
1519
+ # {
1520
+ # "class" : "UpdateEffectivityDatesRequestBody",
1521
+ # "externalSourceGUID" : "",
1522
+ # "externalSourceName" : "",
1523
+ # "effectiveFrom" : "{{$isoTimestamp}}",
1524
+ # "effectiveTo": "{{$isoTimestamp}}",
1525
+ # "forLineage" : false,
1526
+ # "forDuplicateProcessing" : false,
1527
+ # "effectiveTime" : "{{$isoTimestamp}}"
1528
+ # }
1529
+ # """
1530
+ # loop = asyncio.get_event_loop()
1531
+ # loop.run_until_complete(self._async_update_element_status(guid, status, body))