From 8586429506e04512b676e9f7f9873afa3596957e Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 29 Nov 2024 10:05:33 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/instance/v1/__init__.py | 2 ++ .../scaleway_async/instance/v1/api.py | 34 +++++++++++++++++++ .../scaleway_async/instance/v1/marshalling.py | 15 ++++++++ .../scaleway_async/instance/v1/types.py | 10 ++++++ scaleway/scaleway/instance/v1/__init__.py | 2 ++ scaleway/scaleway/instance/v1/api.py | 34 +++++++++++++++++++ scaleway/scaleway/instance/v1/marshalling.py | 15 ++++++++ scaleway/scaleway/instance/v1/types.py | 10 ++++++ 8 files changed, 122 insertions(+) diff --git a/scaleway-async/scaleway_async/instance/v1/__init__.py b/scaleway-async/scaleway_async/instance/v1/__init__.py index a5563e97a..f6f393365 100644 --- a/scaleway-async/scaleway_async/instance/v1/__init__.py +++ b/scaleway-async/scaleway_async/instance/v1/__init__.py @@ -79,6 +79,7 @@ from .types import ApplyBlockMigrationRequest from .types import AttachServerVolumeRequest from .types import AttachServerVolumeResponse +from .types import CheckBlockMigrationOrganizationQuotasRequest from .types import CreateImageRequest from .types import CreateImageResponse from .types import CreateIpRequest @@ -274,6 +275,7 @@ "ApplyBlockMigrationRequest", "AttachServerVolumeRequest", "AttachServerVolumeResponse", + "CheckBlockMigrationOrganizationQuotasRequest", "CreateImageRequest", "CreateImageResponse", "CreateIpRequest", diff --git a/scaleway-async/scaleway_async/instance/v1/api.py b/scaleway-async/scaleway_async/instance/v1/api.py index 197ed4753..890a74670 100644 --- a/scaleway-async/scaleway_async/instance/v1/api.py +++ b/scaleway-async/scaleway_async/instance/v1/api.py @@ -46,6 +46,7 @@ AttachServerVolumeRequest, AttachServerVolumeResponse, Bootscript, + CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, @@ -207,6 +208,7 @@ unmarshal__SetSnapshotResponse, marshal_ApplyBlockMigrationRequest, marshal_AttachServerVolumeRequest, + marshal_CheckBlockMigrationOrganizationQuotasRequest, marshal_CreateImageRequest, marshal_CreateIpRequest, marshal_CreatePlacementGroupRequest, @@ -4052,3 +4054,35 @@ async def apply_block_migration( ) self._throw_on_error(res) + + async def check_block_migration_organization_quotas( + self, + *, + zone: Optional[Zone] = None, + organization: Optional[str] = None, + ) -> None: + """ + :param zone: Zone to target. If none is passed will use default zone from the config. + :param organization: + + Usage: + :: + + result = await api.check_block_migration_organization_quotas() + """ + + param_zone = validate_path_param("zone", zone or self.client.default_zone) + + res = self._request( + "POST", + f"/instance/v1/zones/{param_zone}/block-migration/check-organization-quotas", + body=marshal_CheckBlockMigrationOrganizationQuotasRequest( + CheckBlockMigrationOrganizationQuotasRequest( + zone=zone, + organization=organization, + ), + self.client, + ), + ) + + self._throw_on_error(res) diff --git a/scaleway-async/scaleway_async/instance/v1/marshalling.py b/scaleway-async/scaleway_async/instance/v1/marshalling.py index 741e9ecdf..1995d5b6c 100644 --- a/scaleway-async/scaleway_async/instance/v1/marshalling.py +++ b/scaleway-async/scaleway_async/instance/v1/marshalling.py @@ -108,6 +108,7 @@ UpdateVolumeResponse, ApplyBlockMigrationRequest, AttachServerVolumeRequest, + CheckBlockMigrationOrganizationQuotasRequest, VolumeTemplate, CreateImageRequest, CreateIpRequest, @@ -2729,6 +2730,20 @@ def marshal_AttachServerVolumeRequest( return output +def marshal_CheckBlockMigrationOrganizationQuotasRequest( + request: CheckBlockMigrationOrganizationQuotasRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.organization is not None: + output["organization"] = ( + request.organization or defaults.default_organization_id + ) + + return output + + def marshal_VolumeTemplate( request: VolumeTemplate, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/instance/v1/types.py b/scaleway-async/scaleway_async/instance/v1/types.py index 6c7edf46a..91583004d 100644 --- a/scaleway-async/scaleway_async/instance/v1/types.py +++ b/scaleway-async/scaleway_async/instance/v1/types.py @@ -1502,6 +1502,16 @@ class AttachServerVolumeResponse: server: Optional[Server] +@dataclass +class CheckBlockMigrationOrganizationQuotasRequest: + zone: Optional[Zone] + """ + Zone to target. If none is passed will use default zone from the config. + """ + + organization: Optional[str] + + @dataclass class CreateImageRequest: root_volume: str diff --git a/scaleway/scaleway/instance/v1/__init__.py b/scaleway/scaleway/instance/v1/__init__.py index a5563e97a..f6f393365 100644 --- a/scaleway/scaleway/instance/v1/__init__.py +++ b/scaleway/scaleway/instance/v1/__init__.py @@ -79,6 +79,7 @@ from .types import ApplyBlockMigrationRequest from .types import AttachServerVolumeRequest from .types import AttachServerVolumeResponse +from .types import CheckBlockMigrationOrganizationQuotasRequest from .types import CreateImageRequest from .types import CreateImageResponse from .types import CreateIpRequest @@ -274,6 +275,7 @@ "ApplyBlockMigrationRequest", "AttachServerVolumeRequest", "AttachServerVolumeResponse", + "CheckBlockMigrationOrganizationQuotasRequest", "CreateImageRequest", "CreateImageResponse", "CreateIpRequest", diff --git a/scaleway/scaleway/instance/v1/api.py b/scaleway/scaleway/instance/v1/api.py index d0dcfec01..3ac444062 100644 --- a/scaleway/scaleway/instance/v1/api.py +++ b/scaleway/scaleway/instance/v1/api.py @@ -46,6 +46,7 @@ AttachServerVolumeRequest, AttachServerVolumeResponse, Bootscript, + CheckBlockMigrationOrganizationQuotasRequest, CreateImageRequest, CreateImageResponse, CreateIpRequest, @@ -207,6 +208,7 @@ unmarshal__SetSnapshotResponse, marshal_ApplyBlockMigrationRequest, marshal_AttachServerVolumeRequest, + marshal_CheckBlockMigrationOrganizationQuotasRequest, marshal_CreateImageRequest, marshal_CreateIpRequest, marshal_CreatePlacementGroupRequest, @@ -4052,3 +4054,35 @@ def apply_block_migration( ) self._throw_on_error(res) + + def check_block_migration_organization_quotas( + self, + *, + zone: Optional[Zone] = None, + organization: Optional[str] = None, + ) -> None: + """ + :param zone: Zone to target. If none is passed will use default zone from the config. + :param organization: + + Usage: + :: + + result = api.check_block_migration_organization_quotas() + """ + + param_zone = validate_path_param("zone", zone or self.client.default_zone) + + res = self._request( + "POST", + f"/instance/v1/zones/{param_zone}/block-migration/check-organization-quotas", + body=marshal_CheckBlockMigrationOrganizationQuotasRequest( + CheckBlockMigrationOrganizationQuotasRequest( + zone=zone, + organization=organization, + ), + self.client, + ), + ) + + self._throw_on_error(res) diff --git a/scaleway/scaleway/instance/v1/marshalling.py b/scaleway/scaleway/instance/v1/marshalling.py index 741e9ecdf..1995d5b6c 100644 --- a/scaleway/scaleway/instance/v1/marshalling.py +++ b/scaleway/scaleway/instance/v1/marshalling.py @@ -108,6 +108,7 @@ UpdateVolumeResponse, ApplyBlockMigrationRequest, AttachServerVolumeRequest, + CheckBlockMigrationOrganizationQuotasRequest, VolumeTemplate, CreateImageRequest, CreateIpRequest, @@ -2729,6 +2730,20 @@ def marshal_AttachServerVolumeRequest( return output +def marshal_CheckBlockMigrationOrganizationQuotasRequest( + request: CheckBlockMigrationOrganizationQuotasRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.organization is not None: + output["organization"] = ( + request.organization or defaults.default_organization_id + ) + + return output + + def marshal_VolumeTemplate( request: VolumeTemplate, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/instance/v1/types.py b/scaleway/scaleway/instance/v1/types.py index 6c7edf46a..91583004d 100644 --- a/scaleway/scaleway/instance/v1/types.py +++ b/scaleway/scaleway/instance/v1/types.py @@ -1502,6 +1502,16 @@ class AttachServerVolumeResponse: server: Optional[Server] +@dataclass +class CheckBlockMigrationOrganizationQuotasRequest: + zone: Optional[Zone] + """ + Zone to target. If none is passed will use default zone from the config. + """ + + organization: Optional[str] + + @dataclass class CreateImageRequest: root_volume: str