diff --git a/scaleway-async/scaleway_async/file/v1alpha1/api.py b/scaleway-async/scaleway_async/file/v1alpha1/api.py index 733f3a81a..b2e726171 100644 --- a/scaleway-async/scaleway_async/file/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/file/v1alpha1/api.py @@ -6,6 +6,7 @@ from scaleway_core.api import API from scaleway_core.bridge import ( Region as ScwRegion, + Zone as ScwZone, ) from scaleway_core.utils import ( WaitForOptions, @@ -215,6 +216,7 @@ async def list_attachments( filesystem_id: Optional[str] = None, resource_id: Optional[str] = None, resource_type: Optional[AttachmentResourceType] = None, + zone: Optional[ScwZone] = None, page: Optional[int] = None, page_size: Optional[int] = None, ) -> ListAttachmentsResponse: @@ -227,6 +229,7 @@ async def list_attachments( :param filesystem_id: UUID of the File Storage volume. :param resource_id: Filter by resource ID. :param resource_type: Filter by resource type. + :param zone: Filter by resource zone. :param page: Page number (starting at 1). :param page_size: Number of entries per page (default: 20, max: 100). :return: :class:`ListAttachmentsResponse ` @@ -250,6 +253,7 @@ async def list_attachments( "page_size": page_size or self.client.default_page_size, "resource_id": resource_id, "resource_type": resource_type, + "zone": zone or self.client.default_zone, }, ) @@ -263,6 +267,7 @@ async def list_attachments_all( filesystem_id: Optional[str] = None, resource_id: Optional[str] = None, resource_type: Optional[AttachmentResourceType] = None, + zone: Optional[ScwZone] = None, page: Optional[int] = None, page_size: Optional[int] = None, ) -> List[Attachment]: @@ -275,6 +280,7 @@ async def list_attachments_all( :param filesystem_id: UUID of the File Storage volume. :param resource_id: Filter by resource ID. :param resource_type: Filter by resource type. + :param zone: Filter by resource zone. :param page: Page number (starting at 1). :param page_size: Number of entries per page (default: 20, max: 100). :return: :class:`List[Attachment] ` @@ -294,6 +300,7 @@ async def list_attachments_all( "filesystem_id": filesystem_id, "resource_id": resource_id, "resource_type": resource_type, + "zone": zone, "page": page, "page_size": page_size, }, diff --git a/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py index 16d195ff0..e9b6d39da 100644 --- a/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py @@ -98,6 +98,12 @@ def unmarshal_Attachment(data: Any) -> Attachment: if field is not None: args["resource_type"] = field + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + return Attachment(**args) diff --git a/scaleway-async/scaleway_async/file/v1alpha1/types.py b/scaleway-async/scaleway_async/file/v1alpha1/types.py index d9049b6db..6500b1946 100644 --- a/scaleway-async/scaleway_async/file/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/file/v1alpha1/types.py @@ -9,6 +9,7 @@ from scaleway_core.bridge import ( Region as ScwRegion, + Zone as ScwZone, ) from scaleway_core.utils import ( StrEnumMeta, @@ -70,6 +71,11 @@ class Attachment: The type of the attached resource. """ + zone: Optional[ScwZone] + """ + The zone where the resource is located. + """ + @dataclass class FileSystem: @@ -225,6 +231,11 @@ class ListAttachmentsRequest: Filter by resource type. """ + zone: Optional[ScwZone] + """ + Filter by resource zone. + """ + page: Optional[int] """ Page number (starting at 1). diff --git a/scaleway/scaleway/file/v1alpha1/api.py b/scaleway/scaleway/file/v1alpha1/api.py index 53fba926c..0075d8c02 100644 --- a/scaleway/scaleway/file/v1alpha1/api.py +++ b/scaleway/scaleway/file/v1alpha1/api.py @@ -6,6 +6,7 @@ from scaleway_core.api import API from scaleway_core.bridge import ( Region as ScwRegion, + Zone as ScwZone, ) from scaleway_core.utils import ( WaitForOptions, @@ -213,6 +214,7 @@ def list_attachments( filesystem_id: Optional[str] = None, resource_id: Optional[str] = None, resource_type: Optional[AttachmentResourceType] = None, + zone: Optional[ScwZone] = None, page: Optional[int] = None, page_size: Optional[int] = None, ) -> ListAttachmentsResponse: @@ -225,6 +227,7 @@ def list_attachments( :param filesystem_id: UUID of the File Storage volume. :param resource_id: Filter by resource ID. :param resource_type: Filter by resource type. + :param zone: Filter by resource zone. :param page: Page number (starting at 1). :param page_size: Number of entries per page (default: 20, max: 100). :return: :class:`ListAttachmentsResponse ` @@ -248,6 +251,7 @@ def list_attachments( "page_size": page_size or self.client.default_page_size, "resource_id": resource_id, "resource_type": resource_type, + "zone": zone or self.client.default_zone, }, ) @@ -261,6 +265,7 @@ def list_attachments_all( filesystem_id: Optional[str] = None, resource_id: Optional[str] = None, resource_type: Optional[AttachmentResourceType] = None, + zone: Optional[ScwZone] = None, page: Optional[int] = None, page_size: Optional[int] = None, ) -> List[Attachment]: @@ -273,6 +278,7 @@ def list_attachments_all( :param filesystem_id: UUID of the File Storage volume. :param resource_id: Filter by resource ID. :param resource_type: Filter by resource type. + :param zone: Filter by resource zone. :param page: Page number (starting at 1). :param page_size: Number of entries per page (default: 20, max: 100). :return: :class:`List[Attachment] ` @@ -292,6 +298,7 @@ def list_attachments_all( "filesystem_id": filesystem_id, "resource_id": resource_id, "resource_type": resource_type, + "zone": zone, "page": page, "page_size": page_size, }, diff --git a/scaleway/scaleway/file/v1alpha1/marshalling.py b/scaleway/scaleway/file/v1alpha1/marshalling.py index 16d195ff0..e9b6d39da 100644 --- a/scaleway/scaleway/file/v1alpha1/marshalling.py +++ b/scaleway/scaleway/file/v1alpha1/marshalling.py @@ -98,6 +98,12 @@ def unmarshal_Attachment(data: Any) -> Attachment: if field is not None: args["resource_type"] = field + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + return Attachment(**args) diff --git a/scaleway/scaleway/file/v1alpha1/types.py b/scaleway/scaleway/file/v1alpha1/types.py index d9049b6db..6500b1946 100644 --- a/scaleway/scaleway/file/v1alpha1/types.py +++ b/scaleway/scaleway/file/v1alpha1/types.py @@ -9,6 +9,7 @@ from scaleway_core.bridge import ( Region as ScwRegion, + Zone as ScwZone, ) from scaleway_core.utils import ( StrEnumMeta, @@ -70,6 +71,11 @@ class Attachment: The type of the attached resource. """ + zone: Optional[ScwZone] + """ + The zone where the resource is located. + """ + @dataclass class FileSystem: @@ -225,6 +231,11 @@ class ListAttachmentsRequest: Filter by resource type. """ + zone: Optional[ScwZone] + """ + Filter by resource zone. + """ + page: Optional[int] """ Page number (starting at 1).