From 5ca05cc48d4d27f7b88a43ac3c9f4e9c7ff40329 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 29 Feb 2024 17:00:54 +0000 Subject: [PATCH] feat: update generated APIs --- scaleway-async/scaleway_async/vpc/v2/api.py | 11 +++++++++- .../scaleway_async/vpc/v2/marshalling.py | 22 ++++++++++++++----- scaleway-async/scaleway_async/vpc/v2/types.py | 15 +++++++++++++ scaleway/scaleway/vpc/v2/api.py | 11 +++++++++- scaleway/scaleway/vpc/v2/marshalling.py | 22 ++++++++++++++----- scaleway/scaleway/vpc/v2/types.py | 15 +++++++++++++ 6 files changed, 82 insertions(+), 14 deletions(-) diff --git a/scaleway-async/scaleway_async/vpc/v2/api.py b/scaleway-async/scaleway_async/vpc/v2/api.py index 710dd890..a841c786 100644 --- a/scaleway-async/scaleway_async/vpc/v2/api.py +++ b/scaleway-async/scaleway_async/vpc/v2/api.py @@ -69,6 +69,7 @@ async def list_vp_cs( organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, + routing_enabled: Optional[bool] = None, ) -> ListVPCsResponse: """ List VPCs. @@ -82,6 +83,7 @@ async def list_vp_cs( :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. + :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: :class:`ListVPCsResponse ` Usage: @@ -106,6 +108,7 @@ async def list_vp_cs( "page": page, "page_size": page_size or self.client.default_page_size, "project_id": project_id or self.client.default_project_id, + "routing_enabled": routing_enabled, "tags": tags, }, ) @@ -125,6 +128,7 @@ async def list_vp_cs_all( organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, + routing_enabled: Optional[bool] = None, ) -> List[VPC]: """ List VPCs. @@ -138,6 +142,7 @@ async def list_vp_cs_all( :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. + :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: :class:`List[ListVPCsResponse] ` Usage: @@ -160,12 +165,14 @@ async def list_vp_cs_all( "organization_id": organization_id, "project_id": project_id, "is_default": is_default, + "routing_enabled": routing_enabled, }, ) async def create_vpc( self, *, + enable_routing: bool, region: Optional[Region] = None, name: Optional[str] = None, project_id: Optional[str] = None, @@ -178,12 +185,13 @@ async def create_vpc( :param name: Name for the VPC. :param project_id: Scaleway Project in which to create the VPC. :param tags: Tags for the VPC. + :param enable_routing: Enable routing between Private Networks in the VPC. :return: :class:`VPC ` Usage: :: - result = await api.create_vpc() + result = await api.create_vpc(enable_routing=True) """ param_region = validate_path_param( @@ -195,6 +203,7 @@ async def create_vpc( f"/vpc/v2/regions/{param_region}/vpcs", body=marshal_CreateVPCRequest( CreateVPCRequest( + enable_routing=enable_routing, region=region, name=name or random_name(prefix="vpc"), project_id=project_id, diff --git a/scaleway-async/scaleway_async/vpc/v2/marshalling.py b/scaleway-async/scaleway_async/vpc/v2/marshalling.py index c7b839a6..764896c4 100644 --- a/scaleway-async/scaleway_async/vpc/v2/marshalling.py +++ b/scaleway-async/scaleway_async/vpc/v2/marshalling.py @@ -130,6 +130,9 @@ def unmarshal_VPC(data: Any) -> VPC: field = data.get("region", None) args["region"] = field + field = data.get("routing_enabled", None) + args["routing_enabled"] = field + field = data.get("tags", None) args["tags"] = field @@ -259,6 +262,9 @@ def marshal_CreateVPCRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.enable_routing is not None: + output["enable_routing"] = request.enable_routing + if request.name is not None: output["name"] = request.name @@ -293,16 +299,20 @@ def marshal_MigrateZonalPrivateNetworksRequest( [ OneOfPossibility( "project_id", - request.project_id or defaults.default_project_id - if request.project_id is not None - else None, + ( + request.project_id or defaults.default_project_id + if request.project_id is not None + else None + ), defaults.default_project_id, ), OneOfPossibility( "organization_id", - request.organization_id or defaults.default_organization_id - if request.organization_id is not None - else None, + ( + request.organization_id or defaults.default_organization_id + if request.organization_id is not None + else None + ), defaults.default_organization_id, ), ] diff --git a/scaleway-async/scaleway_async/vpc/v2/types.py b/scaleway-async/scaleway_async/vpc/v2/types.py index 16dd49a4..872d7ee4 100644 --- a/scaleway-async/scaleway_async/vpc/v2/types.py +++ b/scaleway-async/scaleway_async/vpc/v2/types.py @@ -209,6 +209,11 @@ class VPC: Number of Private Networks within this VPC. """ + routing_enabled: bool + """ + Defines whether the VPC routes traffic between its Private Networks. + """ + @dataclass class ListVPCsRequest: @@ -257,6 +262,11 @@ class ListVPCsRequest: Defines whether to filter only for VPCs which are the default one for their Project. """ + routing_enabled: Optional[bool] + """ + Defines whether to filter only for VPCs which route traffic between their Private Networks. + """ + @dataclass class CreateVPCRequest: @@ -280,6 +290,11 @@ class CreateVPCRequest: Tags for the VPC. """ + enable_routing: bool + """ + Enable routing between Private Networks in the VPC. + """ + @dataclass class GetVPCRequest: diff --git a/scaleway/scaleway/vpc/v2/api.py b/scaleway/scaleway/vpc/v2/api.py index 3ff6ec38..e4527176 100644 --- a/scaleway/scaleway/vpc/v2/api.py +++ b/scaleway/scaleway/vpc/v2/api.py @@ -69,6 +69,7 @@ def list_vp_cs( organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, + routing_enabled: Optional[bool] = None, ) -> ListVPCsResponse: """ List VPCs. @@ -82,6 +83,7 @@ def list_vp_cs( :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. + :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: :class:`ListVPCsResponse ` Usage: @@ -106,6 +108,7 @@ def list_vp_cs( "page": page, "page_size": page_size or self.client.default_page_size, "project_id": project_id or self.client.default_project_id, + "routing_enabled": routing_enabled, "tags": tags, }, ) @@ -125,6 +128,7 @@ def list_vp_cs_all( organization_id: Optional[str] = None, project_id: Optional[str] = None, is_default: Optional[bool] = None, + routing_enabled: Optional[bool] = None, ) -> List[VPC]: """ List VPCs. @@ -138,6 +142,7 @@ def list_vp_cs_all( :param organization_id: Organization ID to filter for. Only VPCs belonging to this Organization will be returned. :param project_id: Project ID to filter for. Only VPCs belonging to this Project will be returned. :param is_default: Defines whether to filter only for VPCs which are the default one for their Project. + :param routing_enabled: Defines whether to filter only for VPCs which route traffic between their Private Networks. :return: :class:`List[ListVPCsResponse] ` Usage: @@ -160,12 +165,14 @@ def list_vp_cs_all( "organization_id": organization_id, "project_id": project_id, "is_default": is_default, + "routing_enabled": routing_enabled, }, ) def create_vpc( self, *, + enable_routing: bool, region: Optional[Region] = None, name: Optional[str] = None, project_id: Optional[str] = None, @@ -178,12 +185,13 @@ def create_vpc( :param name: Name for the VPC. :param project_id: Scaleway Project in which to create the VPC. :param tags: Tags for the VPC. + :param enable_routing: Enable routing between Private Networks in the VPC. :return: :class:`VPC ` Usage: :: - result = api.create_vpc() + result = api.create_vpc(enable_routing=True) """ param_region = validate_path_param( @@ -195,6 +203,7 @@ def create_vpc( f"/vpc/v2/regions/{param_region}/vpcs", body=marshal_CreateVPCRequest( CreateVPCRequest( + enable_routing=enable_routing, region=region, name=name or random_name(prefix="vpc"), project_id=project_id, diff --git a/scaleway/scaleway/vpc/v2/marshalling.py b/scaleway/scaleway/vpc/v2/marshalling.py index c7b839a6..764896c4 100644 --- a/scaleway/scaleway/vpc/v2/marshalling.py +++ b/scaleway/scaleway/vpc/v2/marshalling.py @@ -130,6 +130,9 @@ def unmarshal_VPC(data: Any) -> VPC: field = data.get("region", None) args["region"] = field + field = data.get("routing_enabled", None) + args["routing_enabled"] = field + field = data.get("tags", None) args["tags"] = field @@ -259,6 +262,9 @@ def marshal_CreateVPCRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.enable_routing is not None: + output["enable_routing"] = request.enable_routing + if request.name is not None: output["name"] = request.name @@ -293,16 +299,20 @@ def marshal_MigrateZonalPrivateNetworksRequest( [ OneOfPossibility( "project_id", - request.project_id or defaults.default_project_id - if request.project_id is not None - else None, + ( + request.project_id or defaults.default_project_id + if request.project_id is not None + else None + ), defaults.default_project_id, ), OneOfPossibility( "organization_id", - request.organization_id or defaults.default_organization_id - if request.organization_id is not None - else None, + ( + request.organization_id or defaults.default_organization_id + if request.organization_id is not None + else None + ), defaults.default_organization_id, ), ] diff --git a/scaleway/scaleway/vpc/v2/types.py b/scaleway/scaleway/vpc/v2/types.py index 16dd49a4..872d7ee4 100644 --- a/scaleway/scaleway/vpc/v2/types.py +++ b/scaleway/scaleway/vpc/v2/types.py @@ -209,6 +209,11 @@ class VPC: Number of Private Networks within this VPC. """ + routing_enabled: bool + """ + Defines whether the VPC routes traffic between its Private Networks. + """ + @dataclass class ListVPCsRequest: @@ -257,6 +262,11 @@ class ListVPCsRequest: Defines whether to filter only for VPCs which are the default one for their Project. """ + routing_enabled: Optional[bool] + """ + Defines whether to filter only for VPCs which route traffic between their Private Networks. + """ + @dataclass class CreateVPCRequest: @@ -280,6 +290,11 @@ class CreateVPCRequest: Tags for the VPC. """ + enable_routing: bool + """ + Enable routing between Private Networks in the VPC. + """ + @dataclass class GetVPCRequest: