Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update generated APIs #305

Merged
merged 1 commit into from
Sep 25, 2023
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
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ async def list_clusters(
name: Optional[str] = None,
status: ClusterStatus = ClusterStatus.UNKNOWN,
type_: Optional[str] = None,
private_network_id: Optional[str] = None,
) -> ListClustersResponse:
"""
List Clusters.
Expand All @@ -120,6 +121,7 @@ async def list_clusters(
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
:param status: Status to filter on, only clusters with this status will be returned.
:param type_: Type to filter on, only clusters with this type will be returned.
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
:return: :class:`ListClustersResponse <ListClustersResponse>`

Usage:
Expand All @@ -142,6 +144,7 @@ async def list_clusters(
or self.client.default_organization_id,
"page": page,
"page_size": page_size or self.client.default_page_size,
"private_network_id": private_network_id,
"project_id": project_id or self.client.default_project_id,
"status": status,
"type": type_,
Expand All @@ -163,6 +166,7 @@ async def list_clusters_all(
name: Optional[str] = None,
status: Optional[ClusterStatus] = None,
type_: Optional[str] = None,
private_network_id: Optional[str] = None,
) -> List[Cluster]:
"""
List Clusters.
Expand All @@ -176,6 +180,7 @@ async def list_clusters_all(
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
:param status: Status to filter on, only clusters with this status will be returned.
:param type_: Type to filter on, only clusters with this type will be returned.
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
:return: :class:`List[ListClustersResponse] <List[ListClustersResponse]>`

Usage:
Expand All @@ -198,6 +203,7 @@ async def list_clusters_all(
"name": name,
"status": status,
"type_": type_,
"private_network_id": private_network_id,
},
)

Expand Down
88 changes: 43 additions & 45 deletions scaleway-async/scaleway_async/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@


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

args: Dict[str, Any] = {}
Expand All @@ -74,9 +74,9 @@ def unmarshal_MaintenanceWindow(data: Any) -> MaintenanceWindow:


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

args: Dict[str, Any] = {}
Expand All @@ -93,9 +93,9 @@ def unmarshal_ClusterAutoUpgrade(data: Any) -> ClusterAutoUpgrade:


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -134,9 +134,9 @@ def unmarshal_ClusterAutoscalerConfig(data: Any) -> ClusterAutoscalerConfig:


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -166,9 +166,9 @@ def unmarshal_ClusterOpenIDConnectConfig(data: Any) -> ClusterOpenIDConnectConfi


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

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


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -213,12 +213,10 @@ def unmarshal_Cluster(data: Any) -> Cluster:
args["cni"] = field

field = data.get("commitment_ends_at", None)
args["commitment_ends_at"] = (
parser.isoparse(field) if isinstance(field, str) else field
)
args["commitment_ends_at"] = parser.isoparse(field) if type(field) is str else 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("dashboard_enabled", None)
args["dashboard_enabled"] = field
Expand Down Expand Up @@ -268,7 +266,7 @@ def unmarshal_Cluster(data: Any) -> Cluster:
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("upgrade_available", None)
args["upgrade_available"] = field
Expand All @@ -280,9 +278,9 @@ def unmarshal_Cluster(data: Any) -> Cluster:


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -315,9 +313,9 @@ def unmarshal_ClusterType(data: Any) -> ClusterType:


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

args: Dict[str, Any] = {}
Expand All @@ -329,7 +327,7 @@ def unmarshal_Node(data: Any) -> Node:
args["conditions"] = 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("error_message", None)
args["error_message"] = field
Expand Down Expand Up @@ -359,15 +357,15 @@ def unmarshal_Node(data: Any) -> Node:
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

return Node(**args)


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

args: Dict[str, Any] = {}
Expand All @@ -385,7 +383,7 @@ def unmarshal_Pool(data: Any) -> Pool:
args["container_runtime"] = 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("id", None)
args["id"] = field
Expand Down Expand Up @@ -427,7 +425,7 @@ def unmarshal_Pool(data: Any) -> Pool:
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("upgrade_policy", None)
args["upgrade_policy"] = (
Expand All @@ -444,9 +442,9 @@ def unmarshal_Pool(data: Any) -> Pool:


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -482,9 +480,9 @@ def unmarshal_Version(data: Any) -> Version:


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

args: Dict[str, Any] = {}
Expand Down Expand Up @@ -519,9 +517,9 @@ def unmarshal_ExternalNode(data: Any) -> ExternalNode:
def unmarshal_ListClusterAvailableTypesResponse(
data: Any,
) -> ListClusterAvailableTypesResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -540,9 +538,9 @@ def unmarshal_ListClusterAvailableTypesResponse(
def unmarshal_ListClusterAvailableVersionsResponse(
data: Any,
) -> ListClusterAvailableVersionsResponse:
if not isinstance(data, dict):
if type(data) is not dict:
raise TypeError(
"Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary."
f"Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
Expand All @@ -556,9 +554,9 @@ def unmarshal_ListClusterAvailableVersionsResponse(


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

args: Dict[str, Any] = {}
Expand All @@ -575,9 +573,9 @@ def unmarshal_ListClusterTypesResponse(data: Any) -> ListClusterTypesResponse:


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

args: Dict[str, Any] = {}
Expand All @@ -594,9 +592,9 @@ def unmarshal_ListClustersResponse(data: Any) -> ListClustersResponse:


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

args: Dict[str, Any] = {}
Expand All @@ -611,9 +609,9 @@ def unmarshal_ListNodesResponse(data: Any) -> ListNodesResponse:


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

args: Dict[str, Any] = {}
Expand All @@ -628,9 +626,9 @@ def unmarshal_ListPoolsResponse(data: Any) -> ListPoolsResponse:


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

args: Dict[str, Any] = {}
Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@ class ListClustersRequest:
Type to filter on, only clusters with this type will be returned.
"""

private_network_id: Optional[str]
"""
Private Network ID to filter on, only clusters within this Private Network will be returned.
"""


@dataclass
class CreateClusterRequest:
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/k8s/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def list_clusters(
name: Optional[str] = None,
status: ClusterStatus = ClusterStatus.UNKNOWN,
type_: Optional[str] = None,
private_network_id: Optional[str] = None,
) -> ListClustersResponse:
"""
List Clusters.
Expand All @@ -120,6 +121,7 @@ def list_clusters(
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
:param status: Status to filter on, only clusters with this status will be returned.
:param type_: Type to filter on, only clusters with this type will be returned.
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
:return: :class:`ListClustersResponse <ListClustersResponse>`

Usage:
Expand All @@ -142,6 +144,7 @@ def list_clusters(
or self.client.default_organization_id,
"page": page,
"page_size": page_size or self.client.default_page_size,
"private_network_id": private_network_id,
"project_id": project_id or self.client.default_project_id,
"status": status,
"type": type_,
Expand All @@ -163,6 +166,7 @@ def list_clusters_all(
name: Optional[str] = None,
status: Optional[ClusterStatus] = None,
type_: Optional[str] = None,
private_network_id: Optional[str] = None,
) -> List[Cluster]:
"""
List Clusters.
Expand All @@ -176,6 +180,7 @@ def list_clusters_all(
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
:param status: Status to filter on, only clusters with this status will be returned.
:param type_: Type to filter on, only clusters with this type will be returned.
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
:return: :class:`List[ListClustersResponse] <List[ListClustersResponse]>`

Usage:
Expand All @@ -198,6 +203,7 @@ def list_clusters_all(
"name": name,
"status": status,
"type_": type_,
"private_network_id": private_network_id,
},
)

Expand Down
Loading