pyegeria 5.4.0.18__py3-none-any.whl → 5.4.0.19__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.
- commands/cat/list_collections.py +6 -6
- commands/ops/load_archive.py +4 -2
- md_processing/md_commands/data_designer_commands.py +5 -5
- md_processing/md_commands/governance_officer_commands.py +1 -1
- md_processing/md_commands/product_manager_commands.py +3 -3
- pyegeria/__init__.py +6 -1
- pyegeria/_client_new.py +31 -10
- pyegeria/_exceptions_new.py +15 -9
- pyegeria/classification_manager_omvs.py +1 -1
- pyegeria/collection_manager.py +6250 -0
- pyegeria/collection_manager_omvs.py +6 -6
- pyegeria/collection_models.py +168 -0
- pyegeria/load_config.py +4 -4
- pyegeria/models.py +468 -0
- pyegeria/runtime_manager_omvs.py +12 -9
- {pyegeria-5.4.0.18.dist-info → pyegeria-5.4.0.19.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.18.dist-info → pyegeria-5.4.0.19.dist-info}/RECORD +20 -116
- commands/cat/.DS_Store +0 -0
- commands/cat/.env +0 -8
- commands/cat/debug_log.log +0 -0
- commands/cat/logs/pyegeria.log +0 -27
- commands/cli/debug_log.log +0 -0
- commands/ops/logs/pyegeria.log +0 -0
- md_processing/.DS_Store +0 -0
- md_processing/dr_egeria_inbox/Derive-Dr-Gov-Defs.md +0 -8
- md_processing/dr_egeria_inbox/Dr.Egeria Templates.md +0 -873
- md_processing/dr_egeria_inbox/arch_test.md +0 -57
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +0 -696
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +0 -298
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +0 -608
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +0 -94
- md_processing/dr_egeria_inbox/archive/freddie_intro.md +0 -284
- md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +0 -275
- md_processing/dr_egeria_inbox/archive/test-term.md +0 -110
- md_processing/dr_egeria_inbox/cat_test.md +0 -100
- md_processing/dr_egeria_inbox/collections.md +0 -39
- md_processing/dr_egeria_inbox/data_designer_debug.log +0 -6
- md_processing/dr_egeria_inbox/data_designer_out.md +0 -60
- md_processing/dr_egeria_inbox/data_designer_search_test.md +0 -11
- md_processing/dr_egeria_inbox/data_field.md +0 -54
- md_processing/dr_egeria_inbox/data_spec.md +0 -77
- md_processing/dr_egeria_inbox/data_spec_test.md +0 -2406
- md_processing/dr_egeria_inbox/data_test.md +0 -179
- md_processing/dr_egeria_inbox/data_test2.md +0 -429
- md_processing/dr_egeria_inbox/data_test3.md +0 -462
- md_processing/dr_egeria_inbox/dr_egeria_data_designer_1.md +0 -124
- md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +0 -168
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +0 -280
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +0 -313
- md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +0 -1073
- md_processing/dr_egeria_inbox/dr_egeria_isc1.md +0 -44
- md_processing/dr_egeria_inbox/generated_help_report.md +0 -9
- md_processing/dr_egeria_inbox/glossary_list.md +0 -5
- md_processing/dr_egeria_inbox/glossary_search_test.md +0 -40
- md_processing/dr_egeria_inbox/glossary_test1.md +0 -324
- md_processing/dr_egeria_inbox/gov_def.md +0 -424
- md_processing/dr_egeria_inbox/gov_def2.md +0 -447
- md_processing/dr_egeria_inbox/product.md +0 -50
- md_processing/dr_egeria_inbox/rel.md +0 -8
- md_processing/dr_egeria_inbox/sb.md +0 -119
- md_processing/dr_egeria_inbox/solution-components.md +0 -136
- md_processing/dr_egeria_inbox/solution_blueprints.md +0 -118
- md_processing/dr_egeria_inbox/synonym_test.md +0 -42
- md_processing/dr_egeria_inbox/t2.md +0 -268
- md_processing/dr_egeria_outbox/.obsidian/app.json +0 -1
- md_processing/dr_egeria_outbox/.obsidian/appearance.json +0 -1
- md_processing/dr_egeria_outbox/.obsidian/community-plugins.json +0 -6
- md_processing/dr_egeria_outbox/.obsidian/core-plugins.json +0 -31
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/data.json +0 -10
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/main.js +0 -4459
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/manifest.json +0 -10
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/data.json +0 -3
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/main.js +0 -153
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/manifest.json +0 -11
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/styles.css +0 -1
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/main.js +0 -500
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +0 -12
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/styles.css +0 -1
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/main.js +0 -37
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/manifest.json +0 -11
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/styles.css +0 -220
- md_processing/dr_egeria_outbox/.obsidian/types.json +0 -28
- md_processing/dr_egeria_outbox/.obsidian/workspace.json +0 -220
- md_processing/dr_egeria_outbox/Untitled.canvas +0 -1
- md_processing/dr_egeria_outbox/friday/processed-2025-07-18 15:00-product.md +0 -62
- md_processing/dr_egeria_outbox/friday/processed-2025-07-18 15:13-product.md +0 -62
- md_processing/dr_egeria_outbox/friday/processed-2025-07-20 13:23-product.md +0 -47
- md_processing/dr_egeria_outbox/friday/processed-2025-08-01 11:55-data_test3.md +0 -503
- md_processing/dr_egeria_outbox/monday/processed-2025-07-14 12:38-data_designer_out.md +0 -663
- md_processing/dr_egeria_outbox/monday/processed-2025-07-21 10:52-generated_help_report.md +0 -2744
- md_processing/dr_egeria_outbox/monday/processed-2025-07-21 18:38-collections.md +0 -62
- md_processing/dr_egeria_outbox/monday/processed-2025-08-01 11:34-gov_def.md +0 -444
- md_processing/dr_egeria_outbox/processed-2025-08-03 16:05-glossary_list.md +0 -37
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 14:55-product.md +0 -77
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:05-product.md +0 -75
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:11-product.md +0 -74
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 20:40-collections.md +0 -49
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:08-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:10-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:53-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:54-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:03-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:06-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:10-gov_def2.md +0 -486
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -485
- md_processing/md_processing_utils/debug_log.log +0 -0
- md_processing/md_processing_utils/solution_architect_log.log +0 -0
- pyegeria/.DS_Store +0 -0
- {pyegeria-5.4.0.18.dist-info → pyegeria-5.4.0.19.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.18.dist-info → pyegeria-5.4.0.19.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.18.dist-info → pyegeria-5.4.0.19.dist-info}/entry_points.txt +0 -0
@@ -425,9 +425,9 @@ class CollectionManager(Client2):
|
|
425
425
|
The principle specified by the user_id does not have authorization for the requested action
|
426
426
|
|
427
427
|
"""
|
428
|
-
|
428
|
+
search_string = search_string if search_string != "*" else None
|
429
429
|
body = {
|
430
|
-
"class": "
|
430
|
+
"class": "SearchStringRequestBody", "searchString": search_string
|
431
431
|
}
|
432
432
|
|
433
433
|
resp = await self._async_find_collections_w_body(body, classification_name, starts_with, ends_with, ignore_case,
|
@@ -615,11 +615,11 @@ class CollectionManager(Client2):
|
|
615
615
|
Parameters
|
616
616
|
----------
|
617
617
|
collection_type: str
|
618
|
-
|
618
|
+
category to use to find matching collections.
|
619
619
|
classification_name: str, optional
|
620
620
|
An optional filter on the search, e.g., DataSpec
|
621
621
|
body: dict, optional, default = None
|
622
|
-
Provides, a full request body. If specified, the body filter parameter supercedes the
|
622
|
+
Provides, a full request body. If specified, the body filter parameter supercedes the category
|
623
623
|
parameter.
|
624
624
|
start_from: int, [default=0], optional
|
625
625
|
When multiple pages of results are available, the page number to start from.
|
@@ -701,11 +701,11 @@ class CollectionManager(Client2):
|
|
701
701
|
Parameters
|
702
702
|
----------
|
703
703
|
collection_type: str
|
704
|
-
|
704
|
+
category to use to find matching collections.
|
705
705
|
classification_name: str, optional
|
706
706
|
An optional filter on the search, e.g., DataSpec
|
707
707
|
body: dict, optional, default = None
|
708
|
-
Provides, a full request body. If specified, the body filter parameter supersedes the
|
708
|
+
Provides, a full request body. If specified, the body filter parameter supersedes the category
|
709
709
|
parameter.
|
710
710
|
start_from: int, [default=0], optional
|
711
711
|
When multiple pages of results are available, the page number to start from.
|
@@ -0,0 +1,168 @@
|
|
1
|
+
"""
|
2
|
+
Pydantic models representing collection-related JSON structures from Egeria.
|
3
|
+
|
4
|
+
These models represent a subset of the JSON payload structure found in the Egeria API responses,
|
5
|
+
focusing on collections and their related components.
|
6
|
+
"""
|
7
|
+
|
8
|
+
from datetime import datetime
|
9
|
+
from typing import List, Dict, Optional, Any, Literal
|
10
|
+
|
11
|
+
from pydantic import BaseModel, Field
|
12
|
+
|
13
|
+
from pyegeria.models import PyegeriaModel
|
14
|
+
|
15
|
+
|
16
|
+
# --- Basic Type Models ---
|
17
|
+
|
18
|
+
class TypeInfo(PyegeriaModel):
|
19
|
+
"""Represents type information for an element."""
|
20
|
+
type_id: str
|
21
|
+
type_name: str
|
22
|
+
super_type_names: Optional[List[str]] = None
|
23
|
+
type_version: int
|
24
|
+
type_description: str
|
25
|
+
type_category: str
|
26
|
+
|
27
|
+
|
28
|
+
class OriginInfo(PyegeriaModel):
|
29
|
+
"""Represents origin information for an element."""
|
30
|
+
source_server: str
|
31
|
+
origin_category: str
|
32
|
+
home_metadata_collection_id: str
|
33
|
+
home_metadata_collection_name: str
|
34
|
+
license: Optional[str] = None
|
35
|
+
|
36
|
+
|
37
|
+
class VersionInfo(PyegeriaModel):
|
38
|
+
"""Represents version information for an element."""
|
39
|
+
created_by: str
|
40
|
+
updated_by: str
|
41
|
+
create_time: datetime
|
42
|
+
update_time: datetime
|
43
|
+
version: int
|
44
|
+
|
45
|
+
|
46
|
+
# --- Classification Models ---
|
47
|
+
|
48
|
+
class ClassificationProperties(PyegeriaModel):
|
49
|
+
"""Base model for classification properties."""
|
50
|
+
pass
|
51
|
+
|
52
|
+
|
53
|
+
class AnchorClassificationProperties(ClassificationProperties):
|
54
|
+
"""Properties for Anchors classification."""
|
55
|
+
anchor_type_name: str
|
56
|
+
anchor_domain_name: str
|
57
|
+
anchor_guid: Optional[str] = None
|
58
|
+
anchor_scope_guid: Optional[str] = None
|
59
|
+
|
60
|
+
|
61
|
+
class SubjectAreaClassificationProperties(ClassificationProperties):
|
62
|
+
"""Properties for SubjectArea classification."""
|
63
|
+
display_name: Optional[str] = None
|
64
|
+
subject_area_name: Optional[str] = None
|
65
|
+
|
66
|
+
|
67
|
+
class CanonicalVocabularyClassificationProperties(ClassificationProperties):
|
68
|
+
"""Properties for CanonicalVocabulary classification."""
|
69
|
+
scope: str
|
70
|
+
|
71
|
+
|
72
|
+
class ConnectorTypeDirectoryClassificationProperties(ClassificationProperties):
|
73
|
+
"""Properties for ConnectorTypeDirectory classification."""
|
74
|
+
pass
|
75
|
+
|
76
|
+
|
77
|
+
class ElementClassification(PyegeriaModel):
|
78
|
+
"""Represents a classification applied to an element."""
|
79
|
+
class_: str = Field(alias="class")
|
80
|
+
header_version: int
|
81
|
+
status: str
|
82
|
+
type_: TypeInfo = Field(alias="type")
|
83
|
+
origin: OriginInfo
|
84
|
+
versions: VersionInfo
|
85
|
+
classification_origin: str
|
86
|
+
classification_name: str
|
87
|
+
classification_properties: Optional[Dict[str, Any]] = None
|
88
|
+
|
89
|
+
|
90
|
+
# --- Properties Models ---
|
91
|
+
|
92
|
+
class CollectionProperties(PyegeriaModel):
|
93
|
+
"""Represents the properties of a Collection."""
|
94
|
+
class_: str = Field(alias="class")
|
95
|
+
type_name: str
|
96
|
+
extended_properties: Optional[Dict[str, Any]] = {}
|
97
|
+
qualified_name: str
|
98
|
+
display_name: str
|
99
|
+
description: Optional[str] = None
|
100
|
+
|
101
|
+
|
102
|
+
class GlossaryProperties(PyegeriaModel):
|
103
|
+
"""Represents the properties of a Glossary."""
|
104
|
+
display_name: str
|
105
|
+
qualified_name: str
|
106
|
+
usage: Optional[List[str]] = None
|
107
|
+
description: Optional[List[str]] = None
|
108
|
+
language: Optional[List[str]] = None
|
109
|
+
|
110
|
+
|
111
|
+
# --- Header Models ---
|
112
|
+
|
113
|
+
class ElementHeader(PyegeriaModel):
|
114
|
+
"""Represents the header information for an element."""
|
115
|
+
class_: str = Field(alias="class")
|
116
|
+
header_version: int
|
117
|
+
status: str
|
118
|
+
type_: TypeInfo = Field(alias="type")
|
119
|
+
origin: OriginInfo
|
120
|
+
versions: VersionInfo
|
121
|
+
guid: str
|
122
|
+
anchor: Optional[ElementClassification] = None
|
123
|
+
subject_area: Optional[ElementClassification] = Field(None, alias="subjectArea")
|
124
|
+
other_classifications: Optional[List[ElementClassification]] = Field([], alias="otherClassifications")
|
125
|
+
collection_categories: Optional[List[ElementClassification]] = Field(None, alias="collectionCategories")
|
126
|
+
|
127
|
+
|
128
|
+
# --- Relationship Models ---
|
129
|
+
|
130
|
+
class RelationshipHeader(ElementHeader):
|
131
|
+
"""Represents the header information for a relationship."""
|
132
|
+
pass
|
133
|
+
|
134
|
+
|
135
|
+
class RelatedElement(PyegeriaModel):
|
136
|
+
"""Represents a related element in a relationship."""
|
137
|
+
element_header: ElementHeader = Field(alias="elementHeader")
|
138
|
+
properties: GlossaryProperties
|
139
|
+
|
140
|
+
|
141
|
+
class AssociatedGlossaryItem(PyegeriaModel):
|
142
|
+
"""Represents an associated glossary item."""
|
143
|
+
relationship_header: RelationshipHeader = Field(alias="relationshipHeader")
|
144
|
+
related_element: RelatedElement = Field(alias="relatedElement")
|
145
|
+
related_element_at_end1: Optional[bool] = Field(None, alias="relatedElementAtEnd1")
|
146
|
+
|
147
|
+
|
148
|
+
class CollectionMember(PyegeriaModel):
|
149
|
+
"""Represents a member of a collection."""
|
150
|
+
relationship_header: RelationshipHeader = Field(alias="relationshipHeader")
|
151
|
+
related_element: RelatedElement = Field(alias="relatedElement")
|
152
|
+
related_element_at_end1: Optional[bool] = Field(None, alias="relatedElementAtEnd1")
|
153
|
+
|
154
|
+
|
155
|
+
# --- Root Models ---
|
156
|
+
|
157
|
+
class OpenMetadataRootElement(PyegeriaModel):
|
158
|
+
"""Represents the root element in the JSON payload."""
|
159
|
+
class_: str = Field(alias="class")
|
160
|
+
element_header: ElementHeader = Field(alias="elementHeader")
|
161
|
+
associated_glossaries: Optional[List[AssociatedGlossaryItem]] = Field(None, alias="associatedGlossaries")
|
162
|
+
collection_members: Optional[List[CollectionMember]] = Field(None, alias="collectionMembers")
|
163
|
+
mermaid_graph: Optional[str] = Field(None, alias="mermaidGraph")
|
164
|
+
properties: CollectionProperties
|
165
|
+
|
166
|
+
|
167
|
+
# --- Overall Payload Type ---
|
168
|
+
CollectionPayload = List[OpenMetadataRootElement]
|
pyegeria/load_config.py
CHANGED
@@ -52,8 +52,8 @@ class PyegeriaSettings(BaseSettings):
|
|
52
52
|
# Additional settings that can be loaded from .env
|
53
53
|
pyegeria_console_width: int = 200
|
54
54
|
pyegeria_user_format_sets_dir: str = "~/.pyegeria/format_sets"
|
55
|
-
egeria_user_name: str = "
|
56
|
-
egeria_user_password: str = "
|
55
|
+
egeria_user_name: str = ""
|
56
|
+
egeria_user_password: str = ""
|
57
57
|
|
58
58
|
model_config = SettingsConfigDict(
|
59
59
|
env_file=".env",
|
@@ -148,8 +148,8 @@ class UserProfileConfig(BaseModel):
|
|
148
148
|
egeria_home_collection: str = Field(default="MyHome", alias="Egeria Home Collection")
|
149
149
|
egeria_home_glossary_name: str = Field(default="Egeria-Markdown", alias="Egeria Home Glossary Name")
|
150
150
|
egeria_local_qualifier: str = Field(default="PDR", alias="Egeria Local Qualifier")
|
151
|
-
user_name: str = "erinoverview"
|
152
|
-
user_pwd: str = "secret"
|
151
|
+
user_name: Optional[str] = "erinoverview"
|
152
|
+
user_pwd: Optional[str] = "secret"
|
153
153
|
|
154
154
|
@validator('user_name')
|
155
155
|
def validate_user_name(cls, v):
|
pyegeria/models.py
ADDED
@@ -0,0 +1,468 @@
|
|
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
|
+
|
181
|
+
class RelationshipBeanProperties(PyegeriaModel):
|
182
|
+
effective_from: datetime | None = None
|
183
|
+
effective_to: datetime | None = None
|
184
|
+
type_name: str = None
|
185
|
+
extended_properties: dict | None = None
|
186
|
+
|
187
|
+
|
188
|
+
class ClassificationBeanProperties(PyegeriaModel):
|
189
|
+
effective_from: datetime | None = None
|
190
|
+
effective_to: datetime | None = None
|
191
|
+
type_name: str = None
|
192
|
+
extended_properties: dict | None = None
|
193
|
+
|
194
|
+
|
195
|
+
class ReferenceableProperties(OpenMetadataRootProperties):
|
196
|
+
class_: str| None = Field(alias="class"),
|
197
|
+
qualified_name: str
|
198
|
+
display_name: str
|
199
|
+
version_identifier: str | None = None
|
200
|
+
description: str | None = None
|
201
|
+
category: str | None = None
|
202
|
+
additional_properties: dict | None = None
|
203
|
+
|
204
|
+
|
205
|
+
class RequestBody(PyegeriaModel):
|
206
|
+
external_source_guid: str | None = None
|
207
|
+
external_source_name: str | None = None
|
208
|
+
effective_time: datetime | None = None
|
209
|
+
governance_zone_filter: list[str] | None = None
|
210
|
+
for_lineage: bool | None = False
|
211
|
+
for_duplicate_processing: bool | None = False
|
212
|
+
|
213
|
+
|
214
|
+
class NewRelationshipRequestBody(RequestBody):
|
215
|
+
class_: Annotated[Literal["NewRelationshipRequestBody"], Field(alias="class")]
|
216
|
+
make_anchor: bool | None = False
|
217
|
+
anchor_scope_guid: str | None = None
|
218
|
+
properties: RelationshipBeanProperties
|
219
|
+
|
220
|
+
|
221
|
+
class DeleteRequestBody(RequestBody):
|
222
|
+
class_: Annotated[Literal["DeleteRequestBody"], Field(alias="class")]
|
223
|
+
cascaded_delete: bool | None = False
|
224
|
+
delete_method: DeleteMethod = DeleteMethod.LOOK_FOR_LINEAGE
|
225
|
+
archive_date: datetime | None = None
|
226
|
+
archive_process: str | None = None
|
227
|
+
archive_properties: dict | None = None
|
228
|
+
|
229
|
+
|
230
|
+
class InitialClassifications(PyegeriaModel):
|
231
|
+
class_: str = Field(alias="class"),
|
232
|
+
other_props: Dict[str, Any] | None = None
|
233
|
+
|
234
|
+
@model_validator(mode="before")
|
235
|
+
@classmethod
|
236
|
+
def capture_other_props(cls, data: Dict[str, Any]) -> Dict[str, Any]:
|
237
|
+
captured_props = data.copy()
|
238
|
+
|
239
|
+
class_value = captured_props.pop("class", None)
|
240
|
+
other_props_dict = captured_props if captured_props else None
|
241
|
+
return {
|
242
|
+
"class_": class_value,
|
243
|
+
"other_props": other_props_dict
|
244
|
+
}
|
245
|
+
|
246
|
+
|
247
|
+
class NewElementRequestBody(RequestBody):
|
248
|
+
class_: Annotated[Literal["NewElementRequestBody"], Field(alias="class")]
|
249
|
+
anchor_guid: str | None = None
|
250
|
+
is_own_anchor: bool | None = True
|
251
|
+
anchor_scope_guid: str | None = None
|
252
|
+
initial_classifications: Dict[str, InitialClassifications] | None = None
|
253
|
+
initial_status: ValidStatusValues = ValidStatusValues.ACTIVE
|
254
|
+
parent_guid: str | None = None
|
255
|
+
parent_relationship_type_name: str | None = None
|
256
|
+
parent_at_end_1: bool | None = True
|
257
|
+
properties: ReferenceableProperties
|
258
|
+
|
259
|
+
|
260
|
+
class NewClassificationRequestBody(RequestBody):
|
261
|
+
class_: Annotated[Literal["NewClassificationRequestBody"], Field(alias="class")]
|
262
|
+
properties: ClassificationBeanProperties
|
263
|
+
|
264
|
+
|
265
|
+
class UpdateClassificationRequestBody(RequestBody):
|
266
|
+
class_: Annotated[Literal["UpdateClassificationRequestBody"], Field(alias="class")]
|
267
|
+
properties: ClassificationBeanProperties
|
268
|
+
merge_update: bool | None = True
|
269
|
+
|
270
|
+
|
271
|
+
class UpdateRelationshipRequestBody(RequestBody):
|
272
|
+
class_: Annotated[Literal["UpdateRelationshipRequestBody"], Field(alias="class")]
|
273
|
+
properties: RelationshipBeanProperties
|
274
|
+
merge_update: bool | None = True
|
275
|
+
|
276
|
+
|
277
|
+
class TemplateRequestBody(PyegeriaModel):
|
278
|
+
class_: Annotated[Literal["TemplateRequestBody"], Field(alias="class")]
|
279
|
+
anchor_guid: str | None = None
|
280
|
+
is_own_anchor: bool | None = True
|
281
|
+
anchor_scope_guid: str | None = None
|
282
|
+
initial_classifications: dict | None = None # unsure
|
283
|
+
parent_guid: str | None = None
|
284
|
+
parent_relationship_type_name: str | None = None
|
285
|
+
parent_at_end_1: bool | None = True
|
286
|
+
template_guid: str | None = None
|
287
|
+
replacement_properties: dict[str, Any] = {}
|
288
|
+
placeholder_properties: dict[str, Any] = {}
|
289
|
+
|
290
|
+
|
291
|
+
class UpdateElementRequestBody(PyegeriaModel):
|
292
|
+
class_: Annotated[Literal["UpdateElementRequestBody"], Field(alias="class")]
|
293
|
+
properties: dict[str, Any] = {}
|
294
|
+
external_source_guid: dict[str, Any] = {}
|
295
|
+
external_source_name: dict[str, Any] = {}
|
296
|
+
effective_time: datetime | None = None
|
297
|
+
for_lineage: bool | None = False
|
298
|
+
for_duplicate_processing: bool | None = False
|
299
|
+
|
300
|
+
|
301
|
+
class UpdateStatusRequestBody(PyegeriaModel):
|
302
|
+
class_: Annotated[Literal["UpdateStatusRequestBody"], Field(alias="class")]
|
303
|
+
status: str
|
304
|
+
external_source_guid: str | None = None
|
305
|
+
external_source_name: str | None = None
|
306
|
+
effective_time: datetime | None = None
|
307
|
+
for_lineage: bool | None = False
|
308
|
+
for_duplicate_processing: bool | None = False
|
309
|
+
|
310
|
+
|
311
|
+
class GetRequestBody(PyegeriaModel):
|
312
|
+
class_: Annotated[Literal["GetRequestBody"], Field(alias="class")]
|
313
|
+
metadata_elementtype__name: str | None = None
|
314
|
+
metadata_element_subtype_names: list[str] | None = None
|
315
|
+
skip_relationships: list[str] | None = None
|
316
|
+
include_only_relationships: list[str] | None = None
|
317
|
+
skip_classified_elements: list[str] | None = None
|
318
|
+
include_only_classified_elements: list[str] | None = None
|
319
|
+
graph_query_depth: int | None = None
|
320
|
+
governance_zone_filter: list[str] | None= None
|
321
|
+
as_of_time: datetime | None = None
|
322
|
+
effective_time: datetime | None = None
|
323
|
+
for_lineage: bool | None = False
|
324
|
+
for_duplicate_processing: bool | None = False
|
325
|
+
|
326
|
+
|
327
|
+
class ResultsRequestBody(GetRequestBody):
|
328
|
+
class_: Annotated[Literal["ResultsRequestBody"], Field(alias="class")]
|
329
|
+
limit_results_by_status: list[ValidStatusValues] | None= None
|
330
|
+
anchor_guid: str | None = None
|
331
|
+
sequencing_order: SequencingOrder | None = None
|
332
|
+
sequencing_property: str | None = None
|
333
|
+
start_from: int = 0
|
334
|
+
page_size: int = 0
|
335
|
+
|
336
|
+
class FilterRequestBody(ResultsRequestBody):
|
337
|
+
class_: Annotated[Literal["FilterRequestBody"], Field(alias="class")]
|
338
|
+
filter: str
|
339
|
+
|
340
|
+
|
341
|
+
class SearchStringRequestBody(ResultsRequestBody):
|
342
|
+
class_: Annotated[Literal["SearchStringRequestBody"], Field(alias="class")]
|
343
|
+
search_string: str | None = None
|
344
|
+
starts_with: bool = True
|
345
|
+
ends_with: bool = False
|
346
|
+
ignore_case: bool = False
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
#######
|
351
|
+
|
352
|
+
|
353
|
+
# --- Custom Base Model for JSON Key Conversion ---
|
354
|
+
|
355
|
+
|
356
|
+
# --- Innermost Models ---
|
357
|
+
|
358
|
+
class TypeInfo(PyegeriaModel):
|
359
|
+
"""Represents the 'type' subsection."""
|
360
|
+
type_id: str
|
361
|
+
type_name: str
|
362
|
+
supertype__names: list[str] = None
|
363
|
+
type_version: int
|
364
|
+
type_description: str
|
365
|
+
type_category: str
|
366
|
+
|
367
|
+
class OriginInfo(PyegeriaModel):
|
368
|
+
"""Represents the 'origin' subsection."""
|
369
|
+
source_server: str
|
370
|
+
origin_category: str
|
371
|
+
home_metadata_collection_id: str
|
372
|
+
home_metadata_collection_name: str
|
373
|
+
license: list[str] = None # 'license' is optional in some origins
|
374
|
+
|
375
|
+
class VersionInfo(PyegeriaModel):
|
376
|
+
"""Represents the 'versions' subsection."""
|
377
|
+
created_by: str
|
378
|
+
updated_by: str
|
379
|
+
create_time: datetime
|
380
|
+
update_time: datetime
|
381
|
+
version: int
|
382
|
+
|
383
|
+
class AnchorClassificationProperties(PyegeriaModel):
|
384
|
+
"""Represents 'classificationProperties' for Anchor."""
|
385
|
+
anchortype__name: str
|
386
|
+
anchor_domain_name: str
|
387
|
+
anchor_scope_guid: list[str] = None # Varies between anchor and anchorScopeGUID
|
388
|
+
anchor_guid: list[str] = None # Used in Glossary anchor
|
389
|
+
|
390
|
+
class SubjectAreaClassificationProperties(PyegeriaModel):
|
391
|
+
"""Represents 'classificationProperties' for SubjectArea."""
|
392
|
+
display_name: list[str] = None
|
393
|
+
subject_area_name: list[str] = None
|
394
|
+
|
395
|
+
class CanonicalVocabularyClassificationProperties(PyegeriaModel):
|
396
|
+
"""Represents 'classificationProperties' for CanonicalVocabulary."""
|
397
|
+
scope: list[str] = None
|
398
|
+
|
399
|
+
# Using Any for classificationProperties due to varying schemas, or a Union if all types are known
|
400
|
+
class ElementClassification(PyegeriaModel):
|
401
|
+
"""Represents 'ElementClassification' (used for anchor, subjectArea, otherClassifications)."""
|
402
|
+
class_: str = Field(alias="class") # Alias 'class' as it's a Python keyword
|
403
|
+
header_version: int
|
404
|
+
status: str
|
405
|
+
type_: TypeInfo = Field(alias="type") # Alias 'type' as it's a Python keyword
|
406
|
+
origin: OriginInfo
|
407
|
+
versions: VersionInfo
|
408
|
+
classification_origin: str
|
409
|
+
classification_name: str
|
410
|
+
# Use Any or a Union of specific property models if all types are known
|
411
|
+
classification_properties: Optional[Any] = None
|
412
|
+
|
413
|
+
class CollectionProperties(PyegeriaModel):
|
414
|
+
"""Represents the 'properties' subsection for GlossaryCategory."""
|
415
|
+
class_: str = Field(alias="class")
|
416
|
+
type_name: str
|
417
|
+
extended_properties: Optional[dict[str, Any]] = None
|
418
|
+
qualified_name: str
|
419
|
+
display_name: str
|
420
|
+
description: list[str] = None
|
421
|
+
|
422
|
+
class GlossaryProperties(PyegeriaModel):
|
423
|
+
"""Represents the 'properties' subsection for Glossary."""
|
424
|
+
display_name: str
|
425
|
+
qualified_name: str
|
426
|
+
usage: list[str] = None
|
427
|
+
description: list[str] = None
|
428
|
+
language: list[str] = None
|
429
|
+
|
430
|
+
# --- Intermediate Models ---
|
431
|
+
|
432
|
+
class ElementHeader(PyegeriaModel):
|
433
|
+
"""Represents the 'elementHeader' and 'relationshipHeader' subsections."""
|
434
|
+
class_: str = Field(alias="class")
|
435
|
+
header_version: int
|
436
|
+
status: str
|
437
|
+
type_: TypeInfo = Field(alias="type")
|
438
|
+
origin: OriginInfo
|
439
|
+
versions: VersionInfo
|
440
|
+
guid: str
|
441
|
+
anchor: Optional[ElementClassification] = None
|
442
|
+
subject_area: Optional[ElementClassification] = Field(alias="subjectArea")
|
443
|
+
otherclass_ifications: list[ElementClassification] = Field(alias="otherClassifications")
|
444
|
+
|
445
|
+
class RelatedElement(PyegeriaModel):
|
446
|
+
"""Represents the 'relatedElement' subsection."""
|
447
|
+
element_header: ElementHeader = Field(alias="elementHeader")
|
448
|
+
properties: GlossaryProperties
|
449
|
+
|
450
|
+
class AssociatedGlossaryItem(PyegeriaModel):
|
451
|
+
"""Represents an item within the 'associatedGlossaries' list."""
|
452
|
+
relationship_header: ElementHeader = Field(alias="relationshipHeader")
|
453
|
+
related_element: RelatedElement = Field(alias="relatedElement")
|
454
|
+
related_element_at_end1: Optional[bool] = Field(alias="relatedElementAtEnd1")
|
455
|
+
|
456
|
+
# --- Root Model ---
|
457
|
+
|
458
|
+
class OpenMetadataRootElement(PyegeriaModel):
|
459
|
+
"""Represents the main object in the JSON array."""
|
460
|
+
class_: str = Field(alias="class")
|
461
|
+
element_header: ElementHeader = Field(alias="elementHeader")
|
462
|
+
associated_glossaries: list[AssociatedGlossaryItem] = Field(alias="associatedGlossaries")
|
463
|
+
mermaid_graph: list[str] = Field(alias="mermaidGraph")
|
464
|
+
properties: CollectionProperties
|
465
|
+
|
466
|
+
# --- Overall Payload Type ---
|
467
|
+
# The entire JSON is a list of OpenMetadataRootElement
|
468
|
+
OpenMetadataPayload = list[OpenMetadataRootElement]
|