# DO NOT modify this file by hand, changes will be overwritten import sys from dataclasses import dataclass from inspect import getmembers, isclass from typing import ( AbstractSet, Any, Generic, Mapping, MutableMapping, Optional, Sequence, Type, TypeVar, ) from cloudformation_cli_python_lib.interface import ( BaseModel, BaseResourceHandlerRequest, ) from cloudformation_cli_python_lib.recast import recast_object from cloudformation_cli_python_lib.utils import deserialize_list T = TypeVar("T") def set_or_none(value: Optional[Sequence[T]]) -> Optional[AbstractSet[T]]: if value: return set(value) return None @dataclass class ResourceHandlerRequest(BaseResourceHandlerRequest): # pylint: disable=invalid-name desiredResourceState: Optional["ResourceModel"] previousResourceState: Optional["ResourceModel"] typeConfiguration: Optional["TypeConfigurationModel"] @dataclass class ResourceModel(BaseModel): ClusterName: Optional[str] Namespace: Optional[str] Manifest: Optional[str] Url: Optional[str] Name: Optional[str] ResourceVersion: Optional[str] SelfLink: Optional[str] Uid: Optional[str] CfnId: Optional[str] @classmethod def _deserialize( cls: Type["_ResourceModel"], json_data: Optional[Mapping[str, Any]], ) -> Optional["_ResourceModel"]: if not json_data: return None dataclasses = {n: o for n, o in getmembers(sys.modules[__name__]) if isclass(o)} recast_object(cls, json_data, dataclasses) return cls( ClusterName=json_data.get("ClusterName"), Namespace=json_data.get("Namespace"), Manifest=json_data.get("Manifest"), Url=json_data.get("Url"), Name=json_data.get("Name"), ResourceVersion=json_data.get("ResourceVersion"), SelfLink=json_data.get("SelfLink"), Uid=json_data.get("Uid"), CfnId=json_data.get("CfnId"), ) # work around possible type aliasing issues when variable has same name as a model _ResourceModel = ResourceModel @dataclass class TypeConfigurationModel(BaseModel): @classmethod def _deserialize( cls: Type["_TypeConfigurationModel"], json_data: Optional[Mapping[str, Any]], ) -> Optional["_TypeConfigurationModel"]: if not json_data: return None return cls( ) # work around possible type aliasing issues when variable has same name as a model _TypeConfigurationModel = TypeConfigurationModel