pyegeria 5.3.9.9.3__py3-none-any.whl → 5.5.3.3__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.

Potentially problematic release.


This version of pyegeria might be problematic. Click here for more details.

Files changed (272) hide show
  1. commands/__init__.py +24 -0
  2. commands/cat/Dr-Egeria_md-orig.py +2 -2
  3. commands/cat/__init__.py +1 -17
  4. commands/cat/collection_actions.py +197 -0
  5. commands/cat/dr_egeria_command_help.py +372 -0
  6. commands/cat/dr_egeria_jupyter.py +7 -7
  7. commands/cat/dr_egeria_md.py +27 -182
  8. commands/cat/exp_list_glossaries.py +11 -14
  9. commands/cat/get_asset_graph.py +37 -267
  10. commands/cat/{get_collection.py → get_collection_tree.py} +10 -18
  11. commands/cat/get_project_dependencies.py +14 -14
  12. commands/cat/get_project_structure.py +15 -14
  13. commands/cat/get_tech_type_elements.py +16 -116
  14. commands/cat/glossary_actions.py +145 -298
  15. commands/cat/list_assets.py +3 -11
  16. commands/cat/list_cert_types.py +17 -63
  17. commands/cat/list_collections.py +46 -138
  18. commands/cat/list_deployed_catalogs.py +15 -27
  19. commands/cat/list_deployed_database_schemas.py +27 -43
  20. commands/cat/list_deployed_databases.py +16 -31
  21. commands/cat/list_deployed_servers.py +35 -54
  22. commands/cat/list_glossaries.py +18 -17
  23. commands/cat/list_projects.py +10 -12
  24. commands/cat/list_tech_type_elements.py +21 -37
  25. commands/cat/list_tech_types.py +13 -25
  26. commands/cat/list_terms.py +38 -79
  27. commands/cat/list_todos.py +4 -11
  28. commands/cat/list_user_ids.py +3 -10
  29. commands/cat/my_reports.py +559 -0
  30. commands/cat/run_report.py +394 -0
  31. commands/cat/run_report_orig.py +528 -0
  32. commands/cli/egeria.py +222 -247
  33. commands/cli/egeria_cat.py +68 -81
  34. commands/cli/egeria_my.py +13 -0
  35. commands/cli/egeria_ops.py +69 -74
  36. commands/cli/egeria_tech.py +17 -93
  37. commands/cli/ops_config.py +3 -6
  38. commands/{cat/list_categories.py → deprecated/list_data_designer.py} +53 -64
  39. commands/{cat/list_data_structures.py → deprecated/list_data_structures_full.py} +3 -6
  40. commands/deprecated/old_get_asset_graph.py +315 -0
  41. commands/my/__init__.py +0 -2
  42. commands/my/list_my_profile.py +27 -34
  43. commands/my/list_my_roles.py +1 -7
  44. commands/my/monitor_my_todos.py +1 -7
  45. commands/my/monitor_open_todos.py +6 -7
  46. commands/my/todo_actions.py +4 -5
  47. commands/ops/__init__.py +0 -2
  48. commands/ops/gov_server_actions.py +17 -21
  49. commands/ops/list_archives.py +17 -38
  50. commands/ops/list_catalog_targets.py +33 -40
  51. commands/ops/load_archive.py +35 -26
  52. commands/ops/{monitor_engine_activity_c.py → monitor_active_engine_activity.py} +51 -82
  53. commands/ops/{monitor_integ_daemon_status.py → monitor_daemon_status.py} +35 -55
  54. commands/ops/monitor_engine_activity.py +79 -77
  55. commands/ops/{monitor_gov_eng_status.py → monitor_engine_status.py} +10 -7
  56. commands/ops/monitor_platform_status.py +38 -50
  57. commands/ops/monitor_server_startup.py +6 -11
  58. commands/ops/monitor_server_status.py +7 -11
  59. commands/ops/orig_monitor_server_list.py +8 -8
  60. commands/ops/orig_monitor_server_status.py +1 -5
  61. commands/ops/refresh_integration_daemon.py +5 -5
  62. commands/ops/restart_integration_daemon.py +5 -5
  63. commands/ops/table_integ_daemon_status.py +6 -6
  64. commands/ops/x_engine_actions.py +7 -7
  65. commands/tech/__init__.py +0 -2
  66. commands/tech/{generic_actions.py → element_actions.py} +6 -11
  67. commands/tech/get_element_info.py +20 -29
  68. commands/tech/get_guid_info.py +23 -42
  69. commands/tech/get_tech_details.py +20 -35
  70. commands/tech/get_tech_type_template.py +28 -39
  71. commands/tech/list_all_om_type_elements.py +24 -30
  72. commands/tech/list_all_om_type_elements_x.py +22 -28
  73. commands/tech/list_all_related_elements.py +19 -28
  74. commands/tech/list_anchored_elements.py +22 -30
  75. commands/tech/list_asset_types.py +19 -24
  76. commands/tech/list_elements_by_classification_by_property_value.py +26 -32
  77. commands/tech/list_elements_by_property_value.py +19 -25
  78. commands/tech/list_elements_by_property_value_x.py +20 -28
  79. commands/tech/list_elements_for_classification.py +28 -41
  80. commands/tech/list_gov_action_processes.py +16 -27
  81. commands/tech/list_information_supply_chains.py +22 -30
  82. commands/tech/list_registered_services.py +14 -26
  83. commands/tech/list_related_elements_with_prop_value.py +15 -25
  84. commands/tech/list_related_specification.py +1 -4
  85. commands/tech/list_relationship_types.py +15 -25
  86. commands/tech/list_relationships.py +20 -36
  87. commands/tech/list_solution_blueprints.py +28 -33
  88. commands/tech/list_solution_components.py +23 -29
  89. commands/tech/list_solution_roles.py +21 -32
  90. commands/tech/list_tech_templates.py +51 -54
  91. commands/tech/list_valid_metadata_values.py +5 -9
  92. commands/tech/table_tech_templates.py +2 -6
  93. commands/tech/x_list_related_elements.py +1 -4
  94. examples/GeoSpatial Products Example.py +524 -0
  95. examples/Jupyter Notebooks/P-egeria-server-config.ipynb +2137 -0
  96. examples/Jupyter Notebooks/README.md +2 -0
  97. examples/Jupyter Notebooks/common/P-environment-check.ipynb +115 -0
  98. examples/Jupyter Notebooks/common/__init__.py +14 -0
  99. examples/Jupyter Notebooks/common/common-functions.ipynb +4694 -0
  100. examples/Jupyter Notebooks/common/environment-check.ipynb +52 -0
  101. examples/Jupyter Notebooks/common/globals.ipynb +184 -0
  102. examples/Jupyter Notebooks/common/globals.py +154 -0
  103. examples/Jupyter Notebooks/common/orig_globals.py +152 -0
  104. examples/format_sets/all_format_sets.json +910 -0
  105. examples/format_sets/custom_format_sets.json +268 -0
  106. examples/format_sets/subset_format_sets.json +187 -0
  107. examples/format_sets_save_load_example.py +291 -0
  108. examples/jacquard_data_sets.py +129 -0
  109. examples/output_formats_example.py +193 -0
  110. examples/test_jacquard_data_sets.py +54 -0
  111. examples/test_jacquard_data_sets_scenarios.py +94 -0
  112. md_processing/__init__.py +90 -0
  113. md_processing/command_dispatcher.py +33 -0
  114. md_processing/command_mapping.py +221 -0
  115. md_processing/data/commands/commands_data_designer.json +537 -0
  116. md_processing/data/commands/commands_external_reference.json +733 -0
  117. md_processing/data/commands/commands_feedback.json +155 -0
  118. md_processing/data/commands/commands_general.json +204 -0
  119. md_processing/data/commands/commands_glossary.json +218 -0
  120. md_processing/data/commands/commands_governance.json +3678 -0
  121. md_processing/data/commands/commands_product_manager.json +865 -0
  122. md_processing/data/commands/commands_project.json +642 -0
  123. md_processing/data/commands/commands_solution_architect.json +366 -0
  124. md_processing/data/commands.json +17568 -0
  125. md_processing/data/commands_working.json +30641 -0
  126. md_processing/data/gened_report_specs.py +6584 -0
  127. md_processing/data/generated_format_sets.json +6533 -0
  128. md_processing/data/generated_format_sets_old.json +4137 -0
  129. md_processing/data/generated_format_sets_old.py +45 -0
  130. md_processing/dr_egeria.py +182 -0
  131. md_processing/md_commands/__init__.py +3 -0
  132. md_processing/md_commands/data_designer_commands.py +1276 -0
  133. md_processing/md_commands/ext_ref_commands.py +530 -0
  134. md_processing/md_commands/feedback_commands.py +726 -0
  135. md_processing/md_commands/glossary_commands.py +684 -0
  136. md_processing/md_commands/governance_officer_commands.py +600 -0
  137. md_processing/md_commands/product_manager_commands.py +1266 -0
  138. md_processing/md_commands/project_commands.py +383 -0
  139. md_processing/md_commands/solution_architect_commands.py +1184 -0
  140. md_processing/md_commands/view_commands.py +295 -0
  141. md_processing/md_processing_utils/__init__.py +4 -0
  142. md_processing/md_processing_utils/common_md_proc_utils.py +1249 -0
  143. md_processing/md_processing_utils/common_md_utils.py +578 -0
  144. md_processing/md_processing_utils/determine_width.py +103 -0
  145. md_processing/md_processing_utils/extraction_utils.py +547 -0
  146. md_processing/md_processing_utils/gen_report_specs.py +643 -0
  147. md_processing/md_processing_utils/generate_dr_help.py +193 -0
  148. md_processing/md_processing_utils/generate_md_cmd_templates.py +144 -0
  149. md_processing/md_processing_utils/generate_md_templates.py +83 -0
  150. md_processing/md_processing_utils/md_processing_constants.py +1228 -0
  151. md_processing/md_processing_utils/message_constants.py +19 -0
  152. pyegeria/__init__.py +201 -443
  153. pyegeria/core/__init__.py +40 -0
  154. pyegeria/core/_base_platform_client.py +574 -0
  155. pyegeria/core/_base_server_client.py +573 -0
  156. pyegeria/core/_exceptions.py +457 -0
  157. pyegeria/core/_globals.py +60 -0
  158. pyegeria/core/_server_client.py +6073 -0
  159. pyegeria/core/_validators.py +257 -0
  160. pyegeria/core/config.py +654 -0
  161. pyegeria/{create_tech_guid_lists.py → core/create_tech_guid_lists.py} +0 -1
  162. pyegeria/core/load_config.py +37 -0
  163. pyegeria/core/logging_configuration.py +207 -0
  164. pyegeria/core/mcp_adapter.py +144 -0
  165. pyegeria/core/mcp_server.py +212 -0
  166. pyegeria/core/utils.py +405 -0
  167. pyegeria/deprecated/__init__.py +0 -0
  168. pyegeria/{_client.py → deprecated/_client.py} +62 -24
  169. pyegeria/{_deprecated_gov_engine.py → deprecated/_deprecated_gov_engine.py} +16 -16
  170. pyegeria/{classification_manager_omvs.py → deprecated/classification_manager_omvs.py} +1988 -1878
  171. pyegeria/deprecated/output_formatter_with_machine_keys.py +1127 -0
  172. pyegeria/{runtime_manager_omvs.py → deprecated/runtime_manager_omvs.py} +216 -229
  173. pyegeria/{valid_metadata_omvs.py → deprecated/valid_metadata_omvs.py} +93 -93
  174. pyegeria/{x_action_author_omvs.py → deprecated/x_action_author_omvs.py} +2 -3
  175. pyegeria/egeria_cat_client.py +25 -51
  176. pyegeria/egeria_client.py +140 -98
  177. pyegeria/egeria_config_client.py +48 -24
  178. pyegeria/egeria_tech_client.py +170 -83
  179. pyegeria/models/__init__.py +150 -0
  180. pyegeria/models/collection_models.py +168 -0
  181. pyegeria/models/models.py +654 -0
  182. pyegeria/omvs/__init__.py +84 -0
  183. pyegeria/omvs/action_author.py +342 -0
  184. pyegeria/omvs/actor_manager.py +5980 -0
  185. pyegeria/omvs/asset_catalog.py +842 -0
  186. pyegeria/omvs/asset_maker.py +2736 -0
  187. pyegeria/omvs/automated_curation.py +4403 -0
  188. pyegeria/omvs/classification_manager.py +11213 -0
  189. pyegeria/omvs/collection_manager.py +5780 -0
  190. pyegeria/omvs/community_matters_omvs.py +468 -0
  191. pyegeria/{core_omag_server_config.py → omvs/core_omag_server_config.py} +157 -157
  192. pyegeria/{data_designer_omvs.py → omvs/data_designer.py} +1991 -1691
  193. pyegeria/omvs/data_discovery.py +869 -0
  194. pyegeria/omvs/data_engineer.py +372 -0
  195. pyegeria/omvs/digital_business.py +1133 -0
  196. pyegeria/omvs/external_links.py +1752 -0
  197. pyegeria/omvs/feedback_manager.py +834 -0
  198. pyegeria/{full_omag_server_config.py → omvs/full_omag_server_config.py} +73 -69
  199. pyegeria/omvs/glossary_manager.py +3231 -0
  200. pyegeria/omvs/governance_officer.py +3009 -0
  201. pyegeria/omvs/lineage_linker.py +314 -0
  202. pyegeria/omvs/location_arena.py +1525 -0
  203. pyegeria/omvs/metadata_expert.py +668 -0
  204. pyegeria/omvs/metadata_explorer_omvs.py +2943 -0
  205. pyegeria/omvs/my_profile.py +1042 -0
  206. pyegeria/omvs/notification_manager.py +358 -0
  207. pyegeria/omvs/people_organizer.py +394 -0
  208. pyegeria/{platform_services.py → omvs/platform_services.py} +113 -193
  209. pyegeria/omvs/product_manager.py +1825 -0
  210. pyegeria/omvs/project_manager.py +1907 -0
  211. pyegeria/omvs/reference_data.py +1140 -0
  212. pyegeria/omvs/registered_info.py +334 -0
  213. pyegeria/omvs/runtime_manager.py +2817 -0
  214. pyegeria/omvs/schema_maker.py +446 -0
  215. pyegeria/{server_operations.py → omvs/server_operations.py} +27 -26
  216. pyegeria/omvs/solution_architect.py +6490 -0
  217. pyegeria/omvs/specification_properties.py +37 -0
  218. pyegeria/omvs/subject_area.py +1042 -0
  219. pyegeria/omvs/template_manager_omvs.py +236 -0
  220. pyegeria/omvs/time_keeper.py +1761 -0
  221. pyegeria/omvs/valid_metadata.py +3221 -0
  222. pyegeria/omvs/valid_metadata_lists.py +37 -0
  223. pyegeria/omvs/valid_type_lists.py +37 -0
  224. pyegeria/view/__init__.py +28 -0
  225. pyegeria/view/_output_format_models.py +514 -0
  226. pyegeria/view/_output_formats.py +14 -0
  227. pyegeria/view/base_report_formats.py +2719 -0
  228. pyegeria/view/dr_egeria_reports.py +56 -0
  229. pyegeria/view/format_set_executor.py +397 -0
  230. pyegeria/{md_processing_utils.py → view/md_processing_utils.py} +5 -5
  231. pyegeria/{mermaid_utilities.py → view/mermaid_utilities.py} +2 -154
  232. pyegeria/view/output_formatter.py +1297 -0
  233. pyegeria-5.5.3.3.dist-info/METADATA +218 -0
  234. pyegeria-5.5.3.3.dist-info/RECORD +241 -0
  235. {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info}/WHEEL +2 -1
  236. pyegeria-5.5.3.3.dist-info/entry_points.txt +103 -0
  237. pyegeria-5.5.3.3.dist-info/top_level.txt +4 -0
  238. commands/cat/.DS_Store +0 -0
  239. commands/cat/README.md +0 -16
  240. commands/cli/txt_custom_v2.tcss +0 -19
  241. commands/my/README.md +0 -17
  242. commands/ops/README.md +0 -24
  243. commands/ops/monitor_asset_events.py +0 -108
  244. commands/tech/README.md +0 -24
  245. pyegeria/.DS_Store +0 -0
  246. pyegeria/README.md +0 -35
  247. pyegeria/_globals.py +0 -47
  248. pyegeria/_validators.py +0 -385
  249. pyegeria/asset_catalog_omvs.py +0 -864
  250. pyegeria/automated_curation_omvs.py +0 -3765
  251. pyegeria/collection_manager_omvs.py +0 -2744
  252. pyegeria/dr.egeria spec.md +0 -9
  253. pyegeria/egeria_my_client.py +0 -56
  254. pyegeria/feedback_manager_omvs.py +0 -4573
  255. pyegeria/glossary_browser_omvs.py +0 -3728
  256. pyegeria/glossary_manager_omvs.py +0 -2440
  257. pyegeria/m_test.py +0 -118
  258. pyegeria/md_processing_helpers.py +0 -58
  259. pyegeria/md_processing_utils_orig.py +0 -1103
  260. pyegeria/metadata_explorer_omvs.py +0 -2326
  261. pyegeria/my_profile_omvs.py +0 -1022
  262. pyegeria/output_formatter.py +0 -389
  263. pyegeria/project_manager_omvs.py +0 -1933
  264. pyegeria/registered_info.py +0 -167
  265. pyegeria/solution_architect_omvs.py +0 -2156
  266. pyegeria/template_manager_omvs.py +0 -1414
  267. pyegeria/utils.py +0 -197
  268. pyegeria-5.3.9.9.3.dist-info/METADATA +0 -72
  269. pyegeria-5.3.9.9.3.dist-info/RECORD +0 -143
  270. pyegeria-5.3.9.9.3.dist-info/entry_points.txt +0 -99
  271. /pyegeria/{_exceptions.py → deprecated/_exceptions.py} +0 -0
  272. {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,654 @@
1
+ """
2
+
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+ Pydantic Models representing common request and response bodies.
7
+
8
+ """
9
+ from datetime import datetime
10
+ from enum import Enum, StrEnum
11
+ from typing import Literal, Annotated, Any, Optional, Dict
12
+
13
+ from pydantic import BaseModel, Field, ConfigDict, root_validator, model_validator
14
+
15
+
16
+ class MembershipStatus(StrEnum):
17
+ """
18
+ Represents the various statuses of membership in a system.
19
+
20
+ This class is an enumeration that defines possible states related to the
21
+ membership lifecycle. These statuses are typically used to denote the
22
+ state of an item, resource, or entity within a system, and they assist
23
+ in workflow management or status tracking.
24
+
25
+ Attributes:
26
+ UNKNOWN (MembershipStatus): Status indicating that the current
27
+ state is not known.
28
+ DISCOVERED (MembershipStatus): Status indicating that the entity
29
+ has been identified or uncovered in some way.
30
+ PROPOSED (MembershipStatus): Status indicating that the entity
31
+ has been suggested or submitted for consideration.
32
+ IMPORTED (MembershipStatus): Status indicating that the entity
33
+ has been brought into a system or context from an external
34
+ source.
35
+ VALIDATED (MembershipStatus): Status indicating that the entity
36
+ has been verified or approved.
37
+ DEPRECATED (MembershipStatus): Status indicating that the entity
38
+ is no longer recommended for use and may be phased out.
39
+ OBSOLETE (MembershipStatus): Status indicating that the entity
40
+ is no longer in use and is considered outdated.
41
+ OTHER (MembershipStatus): Status indicating an additional,
42
+ unspecified, or alternate state not covered by the predefined
43
+ statuses.
44
+ """
45
+ UNKNOWN = "UNKNOWN"
46
+ DISCOVERED = "DISCOVERED"
47
+ PROPOSED = "PROPOSED"
48
+ IMPORTED = "IMPORTED"
49
+ VALIDATED = "VALIDATED"
50
+ DEPRECATED = "DEPRECATED"
51
+ OBSOLETE = "OBSOLETE"
52
+ OTHER = "OTHER"
53
+
54
+
55
+ class ValidStatusValues(StrEnum):
56
+ """
57
+ Defines a set of valid status values to represent various states or life-cycle stages.
58
+
59
+ This enumeration is designed to provide a standardized set of named constants for indicating
60
+ statuses related to developmental, operational, or administrative processes. It can be used
61
+ across different domains where such statuses are required. Each value corresponds to a specific
62
+ state and is represented by a meaningful string.
63
+
64
+ Attributes:
65
+ UNKNOWN: Represents an unknown state where the specific status is not defined.
66
+ DRAFT: Indicates that the item or process is in draft mode and not finalized.
67
+ PREPARED: Denotes readiness but not yet officially deployed or used.
68
+ PROPOSED: Represents a state where an idea or plan has been proposed but not yet approved.
69
+ APPROVED: Indicates official approval has been granted for the item or process.
70
+ REJECTED: Refers to a state where approval was denied.
71
+ APPROVED_CONCEPT: Marks approval at a conceptual level, potentially requiring further work.
72
+ UNDER_DEVELOPMENT: Represents an active development stage.
73
+ DEVELOPMENT_COMPLETE: Indicates development has been finalized.
74
+ APPROVED_FOR_DEPLOYMENT: Denotes readiness and approval for deployment.
75
+ STANDBY: Represents a state where the item is ready but not active.
76
+ ACTIVE: Denotes that the item or process is currently in operation.
77
+ FAILED: Indicates that the item or process has failed.
78
+ DISABLED: Represents a state where the item has been intentionally turned off or made inactive.
79
+ COMPLETE: Indicates that the item or process has been successfully completed.
80
+ DEPRECATED: Represents a state where the item is considered obsolete or no longer recommended.
81
+ OTHER: Refers to any state that is not explicitly defined within the enumeration.
82
+ DELETED: Indicates removal or deletion of the item.
83
+ """
84
+ UNKNOWN = "UNKNOWN"
85
+ DRAFT = "DRAFT"
86
+ PREPARED = "PREPARED"
87
+ PROPOSED = "PROPOSED"
88
+ APPROVED = "APPROVED"
89
+ REJECTED = "REJECTED"
90
+ APPROVED_CONCEPT = "APPROVED_CONCEPT"
91
+ UNDER_DEVELOPMENT = "UNDER_DEVELOPMENT"
92
+ DEVELOPMENT_COMPLETE = "DEVELOPMENT_COMPLETE"
93
+ APPROVED_FOR_DEPLOYMENT = "APPROVED_FOR_DEPLOYMENT"
94
+ STANDBY = "STANDBY"
95
+ ACTIVE = "ACTIVE"
96
+ FAILED = "FAILED"
97
+ DISABLED = "DISABLED"
98
+ COMPLETE = "COMPLETE"
99
+ DEPRECATED = "DEPRECATED"
100
+ OTHER = "OTHER"
101
+ DELETED = "DELETED"
102
+
103
+
104
+ class SequencingOrder(StrEnum):
105
+ """
106
+ Defines different types of sequencing orders for data handling and processing.
107
+
108
+ This enumeration represents various possible orders for sequencing data. It
109
+ can be used to determine how a set of data should be sorted or processed
110
+ based on the specified order. The specific orders include universal identifiers
111
+ (GUID), creation metadata (recent or oldest), update metadata (recent or oldest),
112
+ and property-based sorting (ascending or descending).
113
+
114
+ Attributes:
115
+ ANY (str): Represents any sequencing order, providing no specific sorting.
116
+ GUID (str): Sorts based on globally unique identifiers.
117
+ CREATION_DATE_RECENT (str): Sorts by most recent creation date first.
118
+ CREATION_DATE_OLDEST (str): Sorts by oldest creation date first.
119
+ LAST_UPDATE_RECENT (str): Sorts by the most recent update date first.
120
+ LAST_UPDATE_OLDEST (str): Sorts by the oldest update date first.
121
+ PROPERTY_ASCENDING (str): Sorts by properties in ascending order.
122
+ PROPERTY_DESCENDING (str): Sorts by properties in descending order.
123
+ """
124
+ ANY = "ANY"
125
+ GUID = "GUID"
126
+ CREATION_DATE_RECENT = "CREATION_DATE_RECENT"
127
+ CREATION_DATE_OLDEST = "CREATION_DATE_OLDEST"
128
+ LAST_UPDATE_RECENT = "LAST_UPDATE_RECENT"
129
+ LAST_UPDATE_OLDEST = "LAST_UPDATE_OLDEST"
130
+ PROPERTY_ASCENDING = "PROPERTY_ASCENDING"
131
+ PROPERTY_DESCENDING = "PROPERTY_DESCENDING"
132
+
133
+
134
+ class DeleteMethod(StrEnum):
135
+ LOOK_FOR_LINEAGE = "LOOK_FOR_LINEAGE"
136
+ ARCHIVE = "ARCHIVE"
137
+ SOFT_DELETE = "SOFT_DELETE"
138
+ PURGE = "PURGE"
139
+
140
+
141
+
142
+ # Define the camelCase conversion function
143
+ def to_camel_case(snake_str: str) -> str:
144
+ """
145
+ Converts a snake_case string to camelCase, with a special rule
146
+ to keep 'guid' (case-insensitive) as 'GUID' (all uppercase).
147
+ """
148
+ components = snake_str.split('_')
149
+ # Use a list comprehension to process each component
150
+ # The first component remains as is (lowercase)
151
+ # Subsequent components are capitalized, unless they are 'guid'
152
+ camel_case_components = []
153
+ for i, word in enumerate(components):
154
+ if word.lower() == 'guid':
155
+ camel_case_components.append('GUID') # Special case: always uppercase GUID
156
+ elif i == 0:
157
+ camel_case_components.append(word) # First word remains lowercase
158
+ else:
159
+ camel_case_components.append(word.capitalize()) # Subsequent words are capitalized
160
+ return ''.join(camel_case_components)
161
+
162
+
163
+ class PyegeriaModel(BaseModel):
164
+ model_config = ConfigDict(
165
+ alias_generator=to_camel_case,
166
+ serialize_by_alias=True,
167
+ use_enum_values=True,
168
+ populate_by_name=True, # Allow input by either field name or alias
169
+ extra='ignore',
170
+ str_strip_whitespace=True
171
+ )
172
+
173
+
174
+ class OpenMetadataRootProperties(PyegeriaModel):
175
+ effective_from: datetime| None = None
176
+ effective_to: datetime | None = None
177
+ type_name: str | None = None
178
+ extended_properties: dict | None = None
179
+
180
+ @model_validator(mode='before')
181
+ @classmethod
182
+ def preprocess_data(cls, values):
183
+ """
184
+ This model validator performs pre-processing on the entire
185
+ input dictionary before field validation.
186
+ It converts any empty tuples to None and ensures a metadata key exists.
187
+
188
+ This is the modern equivalent of @root_validator(pre=True).
189
+ """
190
+ # Ensure the 'data' key exists before trying to access it.
191
+ if 'data' in values and isinstance(values['data'], dict):
192
+ # Convert empty tuples to None
193
+ processed_data = {}
194
+ for key, value in values['data'].items():
195
+ if isinstance(value, tuple) and not value:
196
+ processed_data[key] = None
197
+ else:
198
+ processed_data[key] = value
199
+ values['data'] = processed_data
200
+
201
+ # Ensure a 'metadata' key is always a dictionary.
202
+ if 'metadata' not in values:
203
+ values['metadata'] = {}
204
+
205
+ return values
206
+
207
+
208
+ class RelationshipBeanProperties(PyegeriaModel):
209
+ effective_from: datetime | None = None
210
+ effective_to: datetime | None = None
211
+ type_name: str = None
212
+ extended_properties: dict | None = None
213
+
214
+
215
+ class ClassificationBeanProperties(PyegeriaModel):
216
+ effective_from: datetime | None = None
217
+ effective_to: datetime | None = None
218
+ type_name: str = None
219
+ extended_properties: dict | None = None
220
+
221
+
222
+ class ReferenceableProperties(OpenMetadataRootProperties):
223
+ class_: str| None = Field(alias="class"),
224
+ qualified_name: str
225
+ display_name: str
226
+ version_identifier: str | None = None
227
+ description: str | None = None
228
+ category: str | None = None
229
+ additional_properties: dict | None = None
230
+
231
+
232
+ class RequestBody(PyegeriaModel):
233
+ external_source_guid: str | None = None
234
+ external_source_name: str | None = None
235
+ effective_time: datetime | None = None
236
+ governance_zone_filter: list[str] | None = None
237
+ for_lineage: bool | None = False
238
+ for_duplicate_processing: bool | None = False
239
+
240
+
241
+ class NewRelationshipRequestBody(RequestBody):
242
+ class_: Annotated[Literal["NewRelationshipRequestBody"], Field(alias="class")]
243
+ make_anchor: bool | None = False
244
+ anchor_scope_guid: str | None = None
245
+ properties: dict | None = None
246
+ relationship_properties: dict | None = Field(default=None, alias="relationshipProperties")
247
+
248
+
249
+ class DeleteRequestBody(RequestBody):
250
+ class_: Annotated[Literal["DeleteRequestBody"], Field(alias="class")]
251
+ cascaded_delete: bool | None = False
252
+ delete_method: DeleteMethod = DeleteMethod.LOOK_FOR_LINEAGE
253
+ archive_date: datetime | None = None
254
+ archive_process: str | None = None
255
+ archive_properties: dict | None = None
256
+
257
+ class DeleteElementRequestBody(RequestBody):
258
+ class_: Annotated[Literal["DeleteElementRequestBody"], Field(alias="class")]
259
+
260
+
261
+ class DeleteRelationshipRequestBody(RequestBody):
262
+ class_: Annotated[Literal["DeleteRelationshipRequestBody"], Field(alias="class")]
263
+
264
+
265
+ class DeleteClassificationRequestBody(RequestBody):
266
+ class_: Annotated[Literal["DeleteClassificationRequestBody"], Field(alias="class")]
267
+
268
+
269
+ class InitialClassifications(PyegeriaModel):
270
+ class_: str = Field(alias="class"),
271
+ other_props: Dict[str, Any] | None = None
272
+
273
+ @model_validator(mode="before")
274
+ @classmethod
275
+ def capture_other_props(cls, data: Dict[str, Any]) -> Dict[str, Any]:
276
+ captured_props = data.copy()
277
+
278
+ class_value = captured_props.pop("class", None)
279
+ other_props_dict = captured_props if captured_props else None
280
+ return {
281
+ "class_": class_value,
282
+ "other_props": other_props_dict
283
+ }
284
+
285
+
286
+ class NewAttachmentRequestBody(RequestBody):
287
+ class_: Annotated[Literal["NewAttachmentRequestBody"], Field(alias="class")]
288
+ initial_classifications: Dict[str, InitialClassifications] | None = None
289
+ parent_relationship_properties: dict | None = None
290
+ properties: dict | None = None
291
+ external_source_guid: str | None = None
292
+ external_source_name: str | None = None
293
+ effective_time: datetime | None = None
294
+ for_lineage: bool | None = False
295
+ for_duplicate_processing: bool | None = False
296
+
297
+
298
+ class NewElementRequestBody(RequestBody):
299
+ class_: Annotated[Literal["NewElementRequestBody"], Field(alias="class")]
300
+ anchor_guid: str | None = None
301
+ is_own_anchor: bool | None = True
302
+ anchor_scope_guid: str | None = None
303
+ initial_classifications: Dict[str, InitialClassifications] | None = None
304
+ # initial_status: ValidStatusValues | str= ValidStatusValues.ACTIVE
305
+ parent_relationship_properties: dict | None = None
306
+ properties: dict | None = None
307
+ parent_guid: str | None = None
308
+ parent_relationship_type_name: str | None = None
309
+ parent_at_end_1: bool | None = True
310
+ properties: dict | None =None
311
+
312
+
313
+ class NewClassificationRequestBody(RequestBody):
314
+ class_: Annotated[Literal["NewClassificationRequestBody"], Field(alias="class")]
315
+ properties: dict | None = None
316
+
317
+
318
+ class UpdateClassificationRequestBody(RequestBody):
319
+ class_: Annotated[Literal["UpdateClassificationRequestBody"], Field(alias="class")]
320
+ properties: dict | None = None
321
+ merge_update: bool | None = True
322
+
323
+
324
+ class UpdateRelationshipRequestBody(RequestBody):
325
+ class_: Annotated[Literal["UpdateRelationshipRequestBody"], Field(alias="class")]
326
+ properties: dict | None = None
327
+ merge_update: bool | None = True
328
+
329
+
330
+ class TemplateRequestBody(PyegeriaModel):
331
+ class_: Annotated[Literal["TemplateRequestBody"], Field(alias="class")]
332
+ anchor_guid: str | None = None
333
+ is_own_anchor: bool | None = True
334
+ anchor_scope_guid: str | None = None
335
+ initial_classifications: dict | None = None # unsure
336
+ parent_guid: str | None = None
337
+ parent_relationship_type_name: str | None = None
338
+ parent_at_end_1: bool | None = True
339
+ template_guid: str
340
+ replacement_properties: dict[str, Any] = {}
341
+ placeholder_property_values: dict[str, Any] = {}
342
+ deep_copy: bool | None = False
343
+ effective_from: datetime | None = None
344
+ effective_to: datetime | None = None
345
+ template_substitute: bool | None = False
346
+ allow_retrieve: bool | None = True
347
+
348
+
349
+ class UpdateElementRequestBody(PyegeriaModel):
350
+ class_: Annotated[Literal["UpdateElementRequestBody"], Field(alias="class")]
351
+ properties: dict[str, Any] = {}
352
+ merge_update: bool | None = True
353
+
354
+
355
+ class UpdatePropertiesRequestBody(RequestBody):
356
+ class_: Annotated[Literal["UpdatePropertiesRequestBody"], Field(alias="class")]
357
+ properties: dict | None = None
358
+ replace_properties: bool | None = False
359
+
360
+
361
+ class MetadataSourceRequestBody(RequestBody):
362
+ class_: Annotated[Literal["MetadataSourceRequestBody"], Field(alias="class")]
363
+
364
+
365
+ class UpdateEffectivityDatesRequestBody(RequestBody):
366
+ class_: Annotated[Literal["UpdateEffectivityDatesRequestBody"], Field(alias="class")]
367
+ effective_from: datetime | None = None
368
+ effective_to: datetime | None = None
369
+
370
+
371
+ class OpenMetadataDeleteRequestBody(RequestBody):
372
+ class_: Annotated[Literal["OpenMetadataDeleteRequestBody"], Field(alias="class")]
373
+
374
+
375
+ class ArchiveRequestBody(RequestBody):
376
+ class_: Annotated[Literal["ArchiveRequestBody"], Field(alias="class")]
377
+ archive_properties: dict | None = None
378
+
379
+
380
+ class NewOpenMetadataElementRequestBody(RequestBody):
381
+ class_: Annotated[Literal["NewOpenMetadataElementRequestBody"], Field(alias="class")]
382
+ type_name: str | None = None
383
+ initial_classifications: Dict[str, InitialClassifications] | None = None
384
+ anchor_guid: str | None = None
385
+ is_own_anchor: bool | None = False
386
+ effective_from: datetime | None = None
387
+ effective_to: datetime | None = None
388
+ properties: dict | None = None
389
+ parent_guid: str | None = None
390
+ parent_relationship_type_name: str | None = None
391
+ parent_relationship_properties: dict | None = None
392
+ parent_at_end_1: bool | None = True
393
+
394
+
395
+ class NewRelatedElementsRequestBody(RequestBody):
396
+ class_: Annotated[Literal["NewRelatedElementsRequestBody"], Field(alias="class")]
397
+ relationship_type_name: str | None = None
398
+ end_1_guid: str | None = None
399
+ end_2_guid: str | None = None
400
+ properties: dict | None = None
401
+
402
+
403
+ # class UpdateStatusRequestBody(PyegeriaModel):
404
+ # class_: Annotated[Literal["UpdateStatusRequestBody"], Field(alias="class")]
405
+ # new_status: str
406
+ # external_source_guid: str | None = None
407
+ # external_source_name: str | None = None
408
+ # effective_time: datetime | None = None
409
+ # for_lineage: bool | None = False
410
+ # for_duplicate_processing: bool | None = False
411
+
412
+
413
+ class GetRequestBody(PyegeriaModel):
414
+ class_: Annotated[Literal["GetRequestBody"], Field(alias="class")]
415
+ metadata_element_type_name: str | None = None
416
+ metadata_element_subtype_names: list[str] | None = None
417
+ skip_relationships: list[str] | None = None
418
+ include_only_relationships: list[str] | None = None
419
+ skip_classified_elements: list[str] | None = None
420
+ include_only_classified_elements: list[str] | None = None
421
+ graph_query_depth: int | None = None
422
+ governance_zone_filter: list[str] | None= None
423
+ as_of_time: datetime | None = None
424
+ effective_time: datetime | None = None
425
+ for_lineage: bool | None = False
426
+ for_duplicate_processing: bool | None = False
427
+ relationship_page_size: int = 0
428
+
429
+
430
+ class ResultsRequestBody(GetRequestBody):
431
+ class_: Annotated[Literal["ResultsRequestBody"], Field(alias="class")]
432
+ limit_results_by_status: list[ValidStatusValues] | None= None # header status
433
+ relationships_page_size: int = 0
434
+ anchor_guid: str | None = None
435
+ sequencing_order: SequencingOrder | None = None
436
+ sequencing_property: str | None = None
437
+ start_from: int = 0
438
+ page_size: int = 0
439
+
440
+ class LevelIdentifierQueryBody(ResultsRequestBody):
441
+ class_: Annotated[Literal["LevelIdentifierQueryProperties"], Field(alias="class")]
442
+ return_specific_level: bool = True
443
+ level_identifier: int
444
+
445
+ class FilterRequestBody(ResultsRequestBody):
446
+ class_: Annotated[Literal["FilterRequestBody"], Field(alias="class")]
447
+ filter_string: Annotated[str, Field(alias="filter")]
448
+
449
+
450
+ class SearchStringRequestBody(ResultsRequestBody):
451
+ class_: Annotated[Literal["SearchStringRequestBody"], Field(alias="class")]
452
+ search_string: str | None = None
453
+ starts_with: bool = True
454
+ ends_with: bool = False
455
+ ignore_case: bool = False
456
+
457
+
458
+ class FindRequestBody(ResultsRequestBody):
459
+ class_: Annotated[Literal["FindRequestBody"], Field(alias="class")]
460
+ metadata_element_type_name: str | None = Field(None, alias="metadataElementTypeName")
461
+ metadata_element_subtype_names: list[str] | None = Field(
462
+ None, alias="metadataElementSubtypeNames"
463
+ )
464
+ search_properties: dict | None = Field(None, alias="searchProperties")
465
+ match_classifications: dict | None = Field(None, alias="matchClassifications")
466
+ as_of_time: datetime | None = Field(None, alias="asOfTime")
467
+ effective_time: datetime | None = Field(None, alias="effectiveTime")
468
+
469
+
470
+ class FindPropertyNamesRequestBody(ResultsRequestBody):
471
+ class_: Annotated[Literal["FindPropertyNamesProperties"], Field(alias="class")]
472
+ property_value: str | None = None
473
+ property_names: list[str] | None = None
474
+
475
+
476
+ class DeploymentStatusSearchString(SearchStringRequestBody):
477
+ class_: Annotated[Literal["DeploymentStatusSearchString"], Field(alias="class")]
478
+ deployment_status: Optional[str] = Field(None, alias="deploymentStatus")
479
+
480
+
481
+ class DeploymentStatusFilterRequestBody(FilterRequestBody):
482
+ class_: Annotated[Literal["DeploymentStatusFilterRequestBody"], Field(alias="class")]
483
+ deployment_status: Optional[str] = Field(None, alias="deploymentStatus")
484
+
485
+
486
+ class ContentStatusSearchString(SearchStringRequestBody):
487
+ class_: Annotated[Literal["ContentStatusSearchString"], Field(alias="class")]
488
+ content_status: Optional[str] = Field(None, alias="contentStatus")
489
+
490
+
491
+ class ContentStatusFilterRequestBody(FilterRequestBody):
492
+ class_: Annotated[Literal["ContentStatusFilterRequestBody"], Field(alias="class")]
493
+ content_status: Optional[str] = Field(None, alias="contentStatus")
494
+
495
+
496
+ class ActivityStatusSearchString(SearchStringRequestBody):
497
+ class_: Annotated[Literal["ActivityStatusSearchString"], Field(alias="class")]
498
+ activity_status: Optional[str] = Field(None, alias="activityStatus")
499
+
500
+
501
+ class ActivityStatusFilterRequestBody(FilterRequestBody):
502
+ class_: Annotated[Literal["ActivityStatusFilterRequestBody"], Field(alias="class")]
503
+ activity_status: Optional[str] = Field(None, alias="activityStatus")
504
+
505
+
506
+ class ActivityStatusRequestBody(ResultsRequestBody):
507
+ class_: Annotated[Literal["ActivityStatusRequestBody"], Field(alias="class")]
508
+ activity_status: Optional[str] = Field(None, alias="activityStatus")
509
+
510
+
511
+ class ActionRequestBody(RequestBody):
512
+ class_: Annotated[Literal["ActionRequestBody"], Field(alias="class")]
513
+ properties: Optional[dict] = None
514
+ action_sponsor_guid: Optional[str] = Field(None, alias="actionSponsorGUID")
515
+ action_executor_guid: Optional[str] = Field(None, alias="actionExecutorGUID")
516
+ action_target_guids: Optional[list[str]] = Field(None, alias="actionTargetGUIDs")
517
+
518
+
519
+
520
+ #######
521
+ # This gets only the fields in the most specific model
522
+ def get_defined_fields(model):
523
+ return {
524
+ field_name: field
525
+ for field_name, field in model.__fields__.items()
526
+ if field_name in model.__annotations__ # Only fields defined in the current model
527
+ }
528
+
529
+ def get_defined_field_values(model_instance):
530
+ # Extract the subset of the model's fields
531
+ defined_fields = get_defined_fields(model_instance.__class__).keys()
532
+ # Return only the defined fields with their values
533
+ return {field: getattr(model_instance, field) for field in defined_fields}
534
+
535
+
536
+
537
+ #######
538
+
539
+ # --- Custom Base Model for JSON Key Conversion ---
540
+
541
+
542
+ # --- Innermost Models ---
543
+
544
+ class TypeInfo(PyegeriaModel):
545
+ """Represents the 'type' subsection."""
546
+ type_id: str
547
+ type_name: str
548
+ supertype__names: list[str] = None
549
+ type_version: int
550
+ type_description: str
551
+ type_category: str
552
+
553
+ class OriginInfo(PyegeriaModel):
554
+ """Represents the 'origin' subsection."""
555
+ source_server: str
556
+ origin_category: str
557
+ home_metadata_collection_id: str
558
+ home_metadata_collection_name: str
559
+ license: list[str] = None # 'license' is optional in some origins
560
+
561
+ class VersionInfo(PyegeriaModel):
562
+ """Represents the 'versions' subsection."""
563
+ created_by: str
564
+ updated_by: str
565
+ create_time: datetime
566
+ update_time: datetime
567
+ version: int
568
+
569
+ class AnchorClassificationProperties(PyegeriaModel):
570
+ """Represents 'classificationProperties' for Anchor."""
571
+ anchortype__name: str
572
+ anchor_domain_name: str
573
+ anchor_scope_guid: list[str] = None # Varies between anchor and anchorScopeGUID
574
+ anchor_guid: list[str] = None # Used in Glossary anchor
575
+
576
+ class SubjectAreaClassificationProperties(PyegeriaModel):
577
+ """Represents 'classificationProperties' for SubjectArea."""
578
+ display_name: list[str] = None
579
+ subject_area_name: list[str] = None
580
+
581
+ class CanonicalVocabularyClassificationProperties(PyegeriaModel):
582
+ """Represents 'classificationProperties' for CanonicalVocabulary."""
583
+ scope: list[str] = None
584
+
585
+ # Using Any for classificationProperties due to varying schemas, or a Union if all types are known
586
+ class ElementClassification(PyegeriaModel):
587
+ """Represents 'ElementClassification' (used for anchor, subjectArea, otherClassifications)."""
588
+ class_: str = Field(alias="class") # Alias 'class' as it's a Python keyword
589
+ header_version: int
590
+ status: str
591
+ type_: TypeInfo = Field(alias="type") # Alias 'type' as it's a Python keyword
592
+ origin: OriginInfo
593
+ versions: VersionInfo
594
+ classification_origin: str
595
+ classification_name: str
596
+ # Use Any or a Union of specific property models if all types are known
597
+ classification_properties: Optional[Any] = None
598
+
599
+ class CollectionProperties(PyegeriaModel):
600
+ """Represents the 'properties' subsection for GlossaryCategory."""
601
+ class_: str = Field(alias="class")
602
+ type_name: str
603
+ extended_properties: Optional[dict[str, Any]] = None
604
+ qualified_name: str
605
+ display_name: str
606
+ description: list[str] = None
607
+
608
+ class GlossaryProperties(PyegeriaModel):
609
+ """Represents the 'properties' subsection for Glossary."""
610
+ display_name: str
611
+ qualified_name: str
612
+ usage: list[str] = None
613
+ description: list[str] = None
614
+ language: list[str] = None
615
+
616
+ # --- Intermediate Models ---
617
+
618
+ class ElementHeader(PyegeriaModel):
619
+ """Represents the 'elementHeader' and 'relationshipHeader' subsections."""
620
+ class_: str = Field(alias="class")
621
+ header_version: int
622
+ status: str
623
+ type_: TypeInfo = Field(alias="type")
624
+ origin: OriginInfo
625
+ versions: VersionInfo
626
+ guid: str
627
+ anchor: Optional[ElementClassification] = None
628
+ subject_area: Optional[ElementClassification] = Field(alias="subjectArea")
629
+ otherclass_ifications: list[ElementClassification] = Field(alias="otherClassifications")
630
+
631
+ class RelatedElement(PyegeriaModel):
632
+ """Represents the 'relatedElement' subsection."""
633
+ element_header: ElementHeader = Field(alias="elementHeader")
634
+ properties: GlossaryProperties
635
+
636
+ class AssociatedGlossaryItem(PyegeriaModel):
637
+ """Represents an item within the 'associatedGlossaries' list."""
638
+ relationship_header: ElementHeader = Field(alias="relationshipHeader")
639
+ related_element: RelatedElement = Field(alias="relatedElement")
640
+ related_element_at_end1: Optional[bool] = Field(alias="relatedElementAtEnd1")
641
+
642
+ # --- Root Model ---
643
+
644
+ class OpenMetadataRootElement(PyegeriaModel):
645
+ """Represents the main object in the JSON array."""
646
+ class_: str = Field(alias="class")
647
+ element_header: ElementHeader = Field(alias="elementHeader")
648
+ associated_glossaries: list[AssociatedGlossaryItem] = Field(alias="associatedGlossaries")
649
+ mermaid_graph: list[str] = Field(alias="mermaidGraph")
650
+ properties: CollectionProperties
651
+
652
+ # --- Overall Payload Type ---
653
+ # The entire JSON is a list of OpenMetadataRootElement
654
+ OpenMetadataPayload = list[OpenMetadataRootElement]