def _create_from_draft( self, obj: types.ExtensionDraft, id: typing.Optional[str] = None ) -> types.Extension: object_id = str(uuid.UUID(id) if id is not None else uuid.uuid4()) return types.Extension( id=str(object_id), version=1, created_at=datetime.datetime.now(), last_modified_at=datetime.datetime.now(), key=obj.key, destination=obj.destination, triggers=obj.triggers, )
def post_load(self, data): return types.Extension(**data)
def post_load(self, data, **kwargs): return types.Extension(**data)