Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions scaleway-async/scaleway_async/vpcgw/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,11 @@ async def create_gateway_network(
:param zone: Zone to target. If none is passed will use default zone from the config.
:param gateway_id: Public Gateway to connect.
:param private_network_id: Private Network to connect.
:param enable_masquerade: Defines whether to enable masquerade (dynamic NAT) on this network.
:param enable_dhcp: Defines whether to enable DHCP on this Private Network. Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
:param enable_masquerade: Defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
Note: this setting is ignored when passing `ipam_config`.
:param enable_dhcp: Defines whether to enable DHCP on this Private Network.
Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
Note: this setting is ignored when passing `ipam_config`.
:param dhcp_id: ID of an existing DHCP configuration object to use for this GatewayNetwork.

One-of ('ip_config'): at most one of 'dhcp_id', 'dhcp', 'address', 'ipam_config' could be set.
Expand Down Expand Up @@ -730,14 +733,18 @@ async def update_gateway_network(
:param zone: Zone to target. If none is passed will use default zone from the config.
:param gateway_network_id: ID of the GatewayNetwork to update.
:param enable_masquerade: Defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
:param enable_dhcp: Defines whether to enable DHCP on the connected Private Network.
Note: this setting is ignored when passing `ipam_config`.
:param enable_dhcp: Defines whether to enable DHCP on this Private Network.
Defaults to `true` if `dhcp_id` is present. If set to `true`, `dhcp_id` must be present.
Note: this setting is ignored when passing `ipam_config`.
:param dhcp_id: ID of the new DHCP configuration object to use with this GatewayNetwork.

One-of ('ip_config'): at most one of 'dhcp_id', 'address', 'ipam_config' could be set.
:param address: New static IP address.

One-of ('ip_config'): at most one of 'dhcp_id', 'address', 'ipam_config' could be set.
:param ipam_config: New IPAM configuration to use for this GatewayNetwork.
:param ipam_config: Auto-configure the GatewayNetwork using Scaleway's IPAM (IP address management service).
Note: all or none of the GatewayNetworks for a single gateway can use the IPAM. DHCP and IPAM configurations cannot be mixed. Some products may require that the Public Gateway uses the IPAM, to ensure correct functionality.

One-of ('ip_config'): at most one of 'dhcp_id', 'address', 'ipam_config' could be set.
:return: :class:`GatewayNetwork <GatewayNetwork>`
Expand Down
88 changes: 44 additions & 44 deletions scaleway-async/scaleway_async/vpcgw/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@


def unmarshal_DHCP(data: Any) -> DHCP:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'DHCP' failed as data isn't a dictionary."
f"Unmarshalling the type 'DHCP' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -59,7 +59,7 @@ def unmarshal_DHCP(data: Any) -> DHCP:
args["address"] = field

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("dns_local_name", None)
args["dns_local_name"] = field
Expand Down Expand Up @@ -104,7 +104,7 @@ def unmarshal_DHCP(data: Any) -> DHCP:
args["subnet"] = field

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("valid_lifetime", None)
args["valid_lifetime"] = field
Expand All @@ -116,9 +116,9 @@ def unmarshal_DHCP(data: Any) -> DHCP:


def unmarshal_GatewayNetwork(data: Any) -> GatewayNetwork:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary."
f"Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -127,7 +127,7 @@ def unmarshal_GatewayNetwork(data: Any) -> GatewayNetwork:
args["address"] = field

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("dhcp", None)
args["dhcp"] = unmarshal_DHCP(field) if field is not None else None
Expand All @@ -154,7 +154,7 @@ def unmarshal_GatewayNetwork(data: Any) -> GatewayNetwork:
args["status"] = field

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("zone", None)
args["zone"] = field
Expand All @@ -163,9 +163,9 @@ def unmarshal_GatewayNetwork(data: Any) -> GatewayNetwork:


def unmarshal_GatewayType(data: Any) -> GatewayType:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'GatewayType' failed as data isn't a dictionary."
f"Unmarshalling the type 'GatewayType' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -183,9 +183,9 @@ def unmarshal_GatewayType(data: Any) -> GatewayType:


def unmarshal_IP(data: Any) -> IP:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'IP' failed as data isn't a dictionary."
f"Unmarshalling the type 'IP' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -194,7 +194,7 @@ def unmarshal_IP(data: Any) -> IP:
args["address"] = field

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("gateway_id", None)
args["gateway_id"] = field
Expand All @@ -215,7 +215,7 @@ def unmarshal_IP(data: Any) -> IP:
args["tags"] = field

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("zone", None)
args["zone"] = field
Expand All @@ -224,15 +224,15 @@ def unmarshal_IP(data: Any) -> IP:


def unmarshal_DHCPEntry(data: Any) -> DHCPEntry:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary."
f"Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("gateway_network_id", None)
args["gateway_network_id"] = field
Expand All @@ -253,7 +253,7 @@ def unmarshal_DHCPEntry(data: Any) -> DHCPEntry:
args["type_"] = field

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("zone", None)
args["zone"] = field
Expand All @@ -262,9 +262,9 @@ def unmarshal_DHCPEntry(data: Any) -> DHCPEntry:


def unmarshal_Gateway(data: Any) -> Gateway:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'Gateway' failed as data isn't a dictionary."
f"Unmarshalling the type 'Gateway' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -279,7 +279,7 @@ def unmarshal_Gateway(data: Any) -> Gateway:
args["can_upgrade_to"] = field

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("gateway_networks", None)
args["gateway_networks"] = (
Expand Down Expand Up @@ -314,7 +314,7 @@ def unmarshal_Gateway(data: Any) -> Gateway:
args["type_"] = unmarshal_GatewayType(field) if field is not None else None

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("upstream_dns_servers", None)
args["upstream_dns_servers"] = field
Expand All @@ -329,15 +329,15 @@ def unmarshal_Gateway(data: Any) -> Gateway:


def unmarshal_PATRule(data: Any) -> PATRule:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'PATRule' failed as data isn't a dictionary."
f"Unmarshalling the type 'PATRule' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("created_at", None)
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["created_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("gateway_id", None)
args["gateway_id"] = field
Expand All @@ -358,7 +358,7 @@ def unmarshal_PATRule(data: Any) -> PATRule:
args["public_port"] = field

field = data.get("updated_at", None)
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
args["updated_at"] = parser.isoparse(field) if type(field) is str else field

field = data.get("zone", None)
args["zone"] = field
Expand All @@ -367,9 +367,9 @@ def unmarshal_PATRule(data: Any) -> PATRule:


def unmarshal_ListDHCPEntriesResponse(data: Any) -> ListDHCPEntriesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -386,9 +386,9 @@ def unmarshal_ListDHCPEntriesResponse(data: Any) -> ListDHCPEntriesResponse:


def unmarshal_ListDHCPsResponse(data: Any) -> ListDHCPsResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -403,9 +403,9 @@ def unmarshal_ListDHCPsResponse(data: Any) -> ListDHCPsResponse:


def unmarshal_ListGatewayNetworksResponse(data: Any) -> ListGatewayNetworksResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -422,9 +422,9 @@ def unmarshal_ListGatewayNetworksResponse(data: Any) -> ListGatewayNetworksRespo


def unmarshal_ListGatewayTypesResponse(data: Any) -> ListGatewayTypesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -438,9 +438,9 @@ def unmarshal_ListGatewayTypesResponse(data: Any) -> ListGatewayTypesResponse:


def unmarshal_ListGatewaysResponse(data: Any) -> ListGatewaysResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -457,9 +457,9 @@ def unmarshal_ListGatewaysResponse(data: Any) -> ListGatewaysResponse:


def unmarshal_ListIPsResponse(data: Any) -> ListIPsResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -474,9 +474,9 @@ def unmarshal_ListIPsResponse(data: Any) -> ListIPsResponse:


def unmarshal_ListPATRulesResponse(data: Any) -> ListPATRulesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -493,9 +493,9 @@ def unmarshal_ListPATRulesResponse(data: Any) -> ListPATRulesResponse:


def unmarshal_SetDHCPEntriesResponse(data: Any) -> SetDHCPEntriesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -509,9 +509,9 @@ def unmarshal_SetDHCPEntriesResponse(data: Any) -> SetDHCPEntriesResponse:


def unmarshal_SetPATRulesResponse(data: Any) -> SetPATRulesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand Down
15 changes: 11 additions & 4 deletions scaleway-async/scaleway_async/vpcgw/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,15 @@ class CreateGatewayNetworkRequest:

enable_masquerade: bool
"""
Defines whether to enable masquerade (dynamic NAT) on this network.
Defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
Note: this setting is ignored when passing `ipam_config`.
"""

enable_dhcp: Optional[bool]
"""
Defines whether to enable DHCP on this Private Network. Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
Defines whether to enable DHCP on this Private Network.
Defaults to `true` if either `dhcp_id` or `dhcp` are present. If set to `true`, either `dhcp_id` or `dhcp` must be present.
Note: this setting is ignored when passing `ipam_config`.
"""

dhcp_id: Optional[str]
Expand Down Expand Up @@ -1107,11 +1110,14 @@ class UpdateGatewayNetworkRequest:
enable_masquerade: Optional[bool]
"""
Defines whether to enable masquerade (dynamic NAT) on the GatewayNetwork.
Note: this setting is ignored when passing `ipam_config`.
"""

enable_dhcp: Optional[bool]
"""
Defines whether to enable DHCP on the connected Private Network.
Defines whether to enable DHCP on this Private Network.
Defaults to `true` if `dhcp_id` is present. If set to `true`, `dhcp_id` must be present.
Note: this setting is ignored when passing `ipam_config`.
"""

dhcp_id: Optional[str]
Expand All @@ -1130,7 +1136,8 @@ class UpdateGatewayNetworkRequest:

ipam_config: Optional[IpamConfig]
"""
New IPAM configuration to use for this GatewayNetwork.
Auto-configure the GatewayNetwork using Scaleway's IPAM (IP address management service).
Note: all or none of the GatewayNetworks for a single gateway can use the IPAM. DHCP and IPAM configurations cannot be mixed. Some products may require that the Public Gateway uses the IPAM, to ensure correct functionality.

One-of ('ip_config'): at most one of 'dhcp_id', 'address', 'ipam_config' could be set.
"""
Expand Down
Loading