Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyegeria/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
DesignPatternProperties,
AuthoredReferenceableProperties,
SolutionBlueprintProperties,
StatementOfApplicabilityProperties,
ControlApplicabilityProperties,
ControlImplementationStatus,
NestedDesignPatternProperties,
SpecializedDesignPatternProperties,
RelatedDesignPatternProperties,
Expand Down Expand Up @@ -170,6 +173,9 @@
"DesignPatternProperties",
"AuthoredReferenceableProperties",
"SolutionBlueprintProperties",
"StatementOfApplicabilityProperties",
"ControlApplicabilityProperties",
"ControlImplementationStatus",
"NestedDesignPatternProperties",
"SpecializedDesignPatternProperties",
"RelatedDesignPatternProperties",
Expand Down
30 changes: 30 additions & 0 deletions pyegeria/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ class DeleteMethod(StrEnum):
PURGE = "PURGE"


class ControlImplementationStatus(StrEnum):
"""How far a control assessed in a statement of applicability has been implemented."""
NOT_STARTED = "NOT_STARTED"
PLANNED = "PLANNED"
PARTIALLY_IMPLEMENTED = "PARTIALLY_IMPLEMENTED"
IMPLEMENTED = "IMPLEMENTED"
OTHER = "OTHER"



# Define the camelCase conversion function
def to_camel_case(snake_str: str) -> str:
Expand Down Expand Up @@ -208,6 +217,27 @@ class SolutionBlueprintProperties(AuthoredReferenceableProperties):
class_: Annotated[Literal["SolutionBlueprintProperties"], Field(alias="class")]


class StatementOfApplicabilityProperties(AuthoredReferenceableProperties):
class_: Annotated[Literal["StatementOfApplicabilityProperties"], Field(alias="class")]
scope: str | None = None
review_date: datetime | None = None


class ControlApplicabilityProperties(PyegeriaModel):
class_: Annotated[Literal["ControlApplicabilityProperties"], Field(alias="class")]
# Egeria treats a control as applicable unless this is false.
is_applicable: bool | None = None
justification: str | None = None
inclusion_reasons: list[str] | None = None
implementation_status: ControlImplementationStatus | None = None
implementation_description: str | None = None
review_date: datetime | None = None
label: str | None = None
description: str | None = None
effective_from: datetime | None = None
effective_to: datetime | None = None


class NestedDesignPatternProperties(PyegeriaModel):
class_: Annotated[Literal["NestedDesignPatternProperties"], Field(alias="class")]
label: str | None = None
Expand Down
8 changes: 4 additions & 4 deletions pyegeria/omvs/data_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,15 +809,15 @@ def detach_annotation_match(

@dynamic_catch
async def _async_delete_annotation(
self, annotation_guid: str, body: dict | DeleteElementRequestBody
self, annotation_guid: str, body: Optional[dict | DeleteElementRequestBody] = None
) -> None:
"""Delete an annotation. Async version.

Parameters
----------
annotation_guid : str
The unique identifier of the annotation.
body : dict | DeleteElementRequestBody
body : dict | DeleteElementRequestBody, optional
The request body for the delete operation.

Returns
Expand All @@ -842,14 +842,14 @@ async def _async_delete_annotation(
url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/data-discovery/annotations/{annotation_guid}/delete"
await self._async_delete_element_request(url, body)

def delete_annotation(self, annotation_guid: str, body: dict | DeleteElementRequestBody) -> None:
def delete_annotation(self, annotation_guid: str, body: Optional[dict | DeleteElementRequestBody] = None) -> None:
"""Delete an annotation.

Parameters
----------
annotation_guid : str
The unique identifier of the annotation.
body : dict | DeleteElementRequestBody
body : dict | DeleteElementRequestBody, optional
The request body for the delete operation.

Returns
Expand Down
Loading
Loading