Skip to content

Commit 7885938

Browse files
committed
Update create_typdef method to work with EnumDef
1 parent bce4692 commit 7885938

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

pyatlan/client/atlan.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
from pyatlan.model.typedef import (
7676
ClassificationDef,
7777
CustomMetadataDef,
78+
EnumDef,
7879
TypeDef,
7980
TypeDefResponse,
8081
)
@@ -474,6 +475,16 @@ def create_typedef(self, typedef: TypeDef) -> TypeDefResponse:
474475
relationship_defs=[],
475476
custom_metadata_defs=[typedef],
476477
)
478+
elif isinstance(typedef, EnumDef):
479+
# Set up the request payload...
480+
payload = TypeDefResponse(
481+
classification_defs=[],
482+
enum_defs=[typedef],
483+
struct_defs=[],
484+
entity_defs=[],
485+
relationship_defs=[],
486+
custom_metadata_defs=[],
487+
)
477488
else:
478489
raise InvalidRequestException(
479490
"Unable to create new type definitions of category: "

pyatlan/model/typedef.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class Options(AtlanObject):
131131
is_archived: Optional[bool] = Field(
132132
None,
133133
description="Whether the attribute has been deleted (true) or is still active (false).\n",
134-
example=True
134+
example=True,
135135
)
136136
archived_at: Optional[int] = Field(
137137
None, description="When the attribute was deleted.\n"
@@ -148,7 +148,7 @@ class Options(AtlanObject):
148148
is_new: Optional[bool] = Field(
149149
True,
150150
description="Whether the attribute is being newly created (true) or not (false).",
151-
example=True
151+
example=True,
152152
)
153153
cardinality: Optional[Cardinality] = Field(
154154
"SINGLE",

0 commit comments

Comments
 (0)