diff --git a/scaleway-async/scaleway_async/account/v3/__init__.py b/scaleway-async/scaleway_async/account/v3/__init__.py index 6aeaa57ca..db42391cd 100644 --- a/scaleway-async/scaleway_async/account/v3/__init__.py +++ b/scaleway-async/scaleway_async/account/v3/__init__.py @@ -13,7 +13,6 @@ from .types import QualificationOtherUseCaseSubUseCase from .types import QualificationSetScalewayEnvironmentSubUseCase from .types import QualificationShareDataSubUseCase -from .types import Contract from .types import QualificationAiMachine from .types import QualificationArchiveData from .types import QualificationContainer @@ -23,9 +22,10 @@ from .types import QualificationOtherUseCase from .types import QualificationSetScalewayEnvironment from .types import QualificationShareData +from .types import Contract +from .types import Qualification from .types import ContractSignature from .types import Project -from .types import Qualification from .types import CheckContractSignatureResponse from .types import ContractApiCheckContractSignatureRequest from .types import ContractApiCreateContractSignatureRequest @@ -58,7 +58,6 @@ "QualificationOtherUseCaseSubUseCase", "QualificationSetScalewayEnvironmentSubUseCase", "QualificationShareDataSubUseCase", - "Contract", "QualificationAiMachine", "QualificationArchiveData", "QualificationContainer", @@ -68,9 +67,10 @@ "QualificationOtherUseCase", "QualificationSetScalewayEnvironment", "QualificationShareData", + "Contract", + "Qualification", "ContractSignature", "Project", - "Qualification", "CheckContractSignatureResponse", "ContractApiCheckContractSignatureRequest", "ContractApiCreateContractSignatureRequest", diff --git a/scaleway-async/scaleway_async/account/v3/marshalling.py b/scaleway-async/scaleway_async/account/v3/marshalling.py index b21493729..2875dfa32 100644 --- a/scaleway-async/scaleway_async/account/v3/marshalling.py +++ b/scaleway-async/scaleway_async/account/v3/marshalling.py @@ -12,10 +12,6 @@ from .types import ( Contract, ContractSignature, - Project, - CheckContractSignatureResponse, - ListContractSignaturesResponse, - ListProjectsResponse, QualificationAiMachine, QualificationArchiveData, QualificationContainer, @@ -26,6 +22,10 @@ QualificationSetScalewayEnvironment, QualificationShareData, Qualification, + Project, + CheckContractSignatureResponse, + ListContractSignaturesResponse, + ListProjectsResponse, ProjectQualification, ContractApiCheckContractSignatureRequest, ContractApiCreateContractSignatureRequest, @@ -117,112 +117,6 @@ def unmarshal_ContractSignature(data: Any) -> ContractSignature: return ContractSignature(**args) -def unmarshal_Project(data: Any) -> Project: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Project' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("organization_id", None) - if field is not None: - args["organization_id"] = field - - field = data.get("description", None) - if field is not None: - args["description"] = field - - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) - if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["updated_at"] = None - - return Project(**args) - - -def unmarshal_CheckContractSignatureResponse( - data: Any, -) -> CheckContractSignatureResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("created", None) - if field is not None: - args["created"] = field - - field = data.get("validated", None) - if field is not None: - args["validated"] = field - - return CheckContractSignatureResponse(**args) - - -def unmarshal_ListContractSignaturesResponse( - data: Any, -) -> ListContractSignaturesResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - - field = data.get("contract_signatures", None) - if field is not None: - args["contract_signatures"] = ( - [unmarshal_ContractSignature(v) for v in field] - if field is not None - else None - ) - - return ListContractSignaturesResponse(**args) - - -def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - - field = data.get("projects", None) - if field is not None: - args["projects"] = ( - [unmarshal_Project(v) for v in field] if field is not None else None - ) - - return ListProjectsResponse(**args) - - def unmarshal_QualificationAiMachine(data: Any) -> QualificationAiMachine: if not isinstance(data, dict): raise TypeError( @@ -431,6 +325,118 @@ def unmarshal_Qualification(data: Any) -> Qualification: return Qualification(**args) +def unmarshal_Project(data: Any) -> Project: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Project' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("description", None) + if field is not None: + args["description"] = field + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + field = data.get("qualification", None) + if field is not None: + args["qualification"] = unmarshal_Qualification(field) + else: + args["qualification"] = None + + return Project(**args) + + +def unmarshal_CheckContractSignatureResponse( + data: Any, +) -> CheckContractSignatureResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("created", None) + if field is not None: + args["created"] = field + + field = data.get("validated", None) + if field is not None: + args["validated"] = field + + return CheckContractSignatureResponse(**args) + + +def unmarshal_ListContractSignaturesResponse( + data: Any, +) -> ListContractSignaturesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + field = data.get("contract_signatures", None) + if field is not None: + args["contract_signatures"] = ( + [unmarshal_ContractSignature(v) for v in field] + if field is not None + else None + ) + + return ListContractSignaturesResponse(**args) + + +def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + field = data.get("projects", None) + if field is not None: + args["projects"] = ( + [unmarshal_Project(v) for v in field] if field is not None else None + ) + + return ListProjectsResponse(**args) + + def unmarshal_ProjectQualification(data: Any) -> ProjectQualification: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway-async/scaleway_async/account/v3/types.py b/scaleway-async/scaleway_async/account/v3/types.py index 0de1c9d70..d8c33dddd 100644 --- a/scaleway-async/scaleway_async/account/v3/types.py +++ b/scaleway-async/scaleway_async/account/v3/types.py @@ -134,39 +134,6 @@ def __str__(self) -> str: return str(self.value) -@dataclass -class Contract: - id: str - """ - ID of the contract. - """ - - type_: ContractType - """ - The type of the contract. - """ - - name: str - """ - The name of the contract. - """ - - version: int - """ - The version of the contract. - """ - - created_at: Optional[datetime] - """ - The creation date of the contract. - """ - - updated_at: Optional[datetime] - """ - The last modification date of the contract. - """ - - @dataclass class QualificationAiMachine: sub_use_case: QualificationAiMachineSubUseCase @@ -212,6 +179,65 @@ class QualificationShareData: sub_use_case: QualificationShareDataSubUseCase +@dataclass +class Contract: + id: str + """ + ID of the contract. + """ + + type_: ContractType + """ + The type of the contract. + """ + + name: str + """ + The name of the contract. + """ + + version: int + """ + The version of the contract. + """ + + created_at: Optional[datetime] + """ + The creation date of the contract. + """ + + updated_at: Optional[datetime] + """ + The last modification date of the contract. + """ + + +@dataclass +class Qualification: + architecture_type: QualificationArchitectureType + """ + Architecture type of the qualification. + """ + + host_website: Optional[QualificationHostWebsite] + + host_application: Optional[QualificationHostApplication] + + deploy_software: Optional[QualificationDeploySoftware] + + set_scaleway_environment: Optional[QualificationSetScalewayEnvironment] + + ai_machine: Optional[QualificationAiMachine] + + container: Optional[QualificationContainer] + + archive_data: Optional[QualificationArchiveData] + + share_data: Optional[QualificationShareData] + + other_use_case: Optional[QualificationOtherUseCase] + + @dataclass class ContractSignature: id: str @@ -277,32 +303,11 @@ class Project: Update date of the Project. """ - -@dataclass -class Qualification: - architecture_type: QualificationArchitectureType + qualification: Optional[Qualification] """ - Architecture type of the qualification. + Qualification of the Project. """ - host_website: Optional[QualificationHostWebsite] - - host_application: Optional[QualificationHostApplication] - - deploy_software: Optional[QualificationDeploySoftware] - - set_scaleway_environment: Optional[QualificationSetScalewayEnvironment] - - ai_machine: Optional[QualificationAiMachine] - - container: Optional[QualificationContainer] - - archive_data: Optional[QualificationArchiveData] - - share_data: Optional[QualificationShareData] - - other_use_case: Optional[QualificationOtherUseCase] - @dataclass class CheckContractSignatureResponse: diff --git a/scaleway/scaleway/account/v3/__init__.py b/scaleway/scaleway/account/v3/__init__.py index 6aeaa57ca..db42391cd 100644 --- a/scaleway/scaleway/account/v3/__init__.py +++ b/scaleway/scaleway/account/v3/__init__.py @@ -13,7 +13,6 @@ from .types import QualificationOtherUseCaseSubUseCase from .types import QualificationSetScalewayEnvironmentSubUseCase from .types import QualificationShareDataSubUseCase -from .types import Contract from .types import QualificationAiMachine from .types import QualificationArchiveData from .types import QualificationContainer @@ -23,9 +22,10 @@ from .types import QualificationOtherUseCase from .types import QualificationSetScalewayEnvironment from .types import QualificationShareData +from .types import Contract +from .types import Qualification from .types import ContractSignature from .types import Project -from .types import Qualification from .types import CheckContractSignatureResponse from .types import ContractApiCheckContractSignatureRequest from .types import ContractApiCreateContractSignatureRequest @@ -58,7 +58,6 @@ "QualificationOtherUseCaseSubUseCase", "QualificationSetScalewayEnvironmentSubUseCase", "QualificationShareDataSubUseCase", - "Contract", "QualificationAiMachine", "QualificationArchiveData", "QualificationContainer", @@ -68,9 +67,10 @@ "QualificationOtherUseCase", "QualificationSetScalewayEnvironment", "QualificationShareData", + "Contract", + "Qualification", "ContractSignature", "Project", - "Qualification", "CheckContractSignatureResponse", "ContractApiCheckContractSignatureRequest", "ContractApiCreateContractSignatureRequest", diff --git a/scaleway/scaleway/account/v3/marshalling.py b/scaleway/scaleway/account/v3/marshalling.py index b21493729..2875dfa32 100644 --- a/scaleway/scaleway/account/v3/marshalling.py +++ b/scaleway/scaleway/account/v3/marshalling.py @@ -12,10 +12,6 @@ from .types import ( Contract, ContractSignature, - Project, - CheckContractSignatureResponse, - ListContractSignaturesResponse, - ListProjectsResponse, QualificationAiMachine, QualificationArchiveData, QualificationContainer, @@ -26,6 +22,10 @@ QualificationSetScalewayEnvironment, QualificationShareData, Qualification, + Project, + CheckContractSignatureResponse, + ListContractSignaturesResponse, + ListProjectsResponse, ProjectQualification, ContractApiCheckContractSignatureRequest, ContractApiCreateContractSignatureRequest, @@ -117,112 +117,6 @@ def unmarshal_ContractSignature(data: Any) -> ContractSignature: return ContractSignature(**args) -def unmarshal_Project(data: Any) -> Project: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Project' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("organization_id", None) - if field is not None: - args["organization_id"] = field - - field = data.get("description", None) - if field is not None: - args["description"] = field - - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) - if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["updated_at"] = None - - return Project(**args) - - -def unmarshal_CheckContractSignatureResponse( - data: Any, -) -> CheckContractSignatureResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("created", None) - if field is not None: - args["created"] = field - - field = data.get("validated", None) - if field is not None: - args["validated"] = field - - return CheckContractSignatureResponse(**args) - - -def unmarshal_ListContractSignaturesResponse( - data: Any, -) -> ListContractSignaturesResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - - field = data.get("contract_signatures", None) - if field is not None: - args["contract_signatures"] = ( - [unmarshal_ContractSignature(v) for v in field] - if field is not None - else None - ) - - return ListContractSignaturesResponse(**args) - - -def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("total_count", None) - if field is not None: - args["total_count"] = field - - field = data.get("projects", None) - if field is not None: - args["projects"] = ( - [unmarshal_Project(v) for v in field] if field is not None else None - ) - - return ListProjectsResponse(**args) - - def unmarshal_QualificationAiMachine(data: Any) -> QualificationAiMachine: if not isinstance(data, dict): raise TypeError( @@ -431,6 +325,118 @@ def unmarshal_Qualification(data: Any) -> Qualification: return Qualification(**args) +def unmarshal_Project(data: Any) -> Project: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Project' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("description", None) + if field is not None: + args["description"] = field + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + field = data.get("qualification", None) + if field is not None: + args["qualification"] = unmarshal_Qualification(field) + else: + args["qualification"] = None + + return Project(**args) + + +def unmarshal_CheckContractSignatureResponse( + data: Any, +) -> CheckContractSignatureResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("created", None) + if field is not None: + args["created"] = field + + field = data.get("validated", None) + if field is not None: + args["validated"] = field + + return CheckContractSignatureResponse(**args) + + +def unmarshal_ListContractSignaturesResponse( + data: Any, +) -> ListContractSignaturesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + field = data.get("contract_signatures", None) + if field is not None: + args["contract_signatures"] = ( + [unmarshal_ContractSignature(v) for v in field] + if field is not None + else None + ) + + return ListContractSignaturesResponse(**args) + + +def unmarshal_ListProjectsResponse(data: Any) -> ListProjectsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + field = data.get("projects", None) + if field is not None: + args["projects"] = ( + [unmarshal_Project(v) for v in field] if field is not None else None + ) + + return ListProjectsResponse(**args) + + def unmarshal_ProjectQualification(data: Any) -> ProjectQualification: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway/scaleway/account/v3/types.py b/scaleway/scaleway/account/v3/types.py index 0de1c9d70..d8c33dddd 100644 --- a/scaleway/scaleway/account/v3/types.py +++ b/scaleway/scaleway/account/v3/types.py @@ -134,39 +134,6 @@ def __str__(self) -> str: return str(self.value) -@dataclass -class Contract: - id: str - """ - ID of the contract. - """ - - type_: ContractType - """ - The type of the contract. - """ - - name: str - """ - The name of the contract. - """ - - version: int - """ - The version of the contract. - """ - - created_at: Optional[datetime] - """ - The creation date of the contract. - """ - - updated_at: Optional[datetime] - """ - The last modification date of the contract. - """ - - @dataclass class QualificationAiMachine: sub_use_case: QualificationAiMachineSubUseCase @@ -212,6 +179,65 @@ class QualificationShareData: sub_use_case: QualificationShareDataSubUseCase +@dataclass +class Contract: + id: str + """ + ID of the contract. + """ + + type_: ContractType + """ + The type of the contract. + """ + + name: str + """ + The name of the contract. + """ + + version: int + """ + The version of the contract. + """ + + created_at: Optional[datetime] + """ + The creation date of the contract. + """ + + updated_at: Optional[datetime] + """ + The last modification date of the contract. + """ + + +@dataclass +class Qualification: + architecture_type: QualificationArchitectureType + """ + Architecture type of the qualification. + """ + + host_website: Optional[QualificationHostWebsite] + + host_application: Optional[QualificationHostApplication] + + deploy_software: Optional[QualificationDeploySoftware] + + set_scaleway_environment: Optional[QualificationSetScalewayEnvironment] + + ai_machine: Optional[QualificationAiMachine] + + container: Optional[QualificationContainer] + + archive_data: Optional[QualificationArchiveData] + + share_data: Optional[QualificationShareData] + + other_use_case: Optional[QualificationOtherUseCase] + + @dataclass class ContractSignature: id: str @@ -277,32 +303,11 @@ class Project: Update date of the Project. """ - -@dataclass -class Qualification: - architecture_type: QualificationArchitectureType + qualification: Optional[Qualification] """ - Architecture type of the qualification. + Qualification of the Project. """ - host_website: Optional[QualificationHostWebsite] - - host_application: Optional[QualificationHostApplication] - - deploy_software: Optional[QualificationDeploySoftware] - - set_scaleway_environment: Optional[QualificationSetScalewayEnvironment] - - ai_machine: Optional[QualificationAiMachine] - - container: Optional[QualificationContainer] - - archive_data: Optional[QualificationArchiveData] - - share_data: Optional[QualificationShareData] - - other_use_case: Optional[QualificationOtherUseCase] - @dataclass class CheckContractSignatureResponse: