diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py index 3837eaf0..edb257ba 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py @@ -12,11 +12,13 @@ from .types import ListQuotaRequestOrderBy from .types import ListSSHKeysRequestOrderBy from .types import ListUsersRequestOrderBy +from .types import LocalityType from .types import LogAction from .types import LogResourceType from .types import PermissionSetScopeType from .types import UserStatus from .types import UserType +from .types import QuotumLimit from .types import JWT from .types import RuleSpecs from .types import CreateUserRequestMember @@ -119,11 +121,13 @@ "ListQuotaRequestOrderBy", "ListSSHKeysRequestOrderBy", "ListUsersRequestOrderBy", + "LocalityType", "LogAction", "LogResourceType", "PermissionSetScopeType", "UserStatus", "UserType", + "QuotumLimit", "JWT", "RuleSpecs", "CreateUserRequestMember", diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py index 09ce69f0..c6a9ef1e 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py @@ -16,6 +16,7 @@ Group, Log, Policy, + QuotumLimit, Quotum, SSHKey, User, @@ -452,6 +453,47 @@ def unmarshal_Policy(data: Any) -> Policy: return Policy(**args) +def unmarshal_QuotumLimit(data: Any) -> QuotumLimit: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'QuotumLimit' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("global", None) + if field is not None: + args["global_"] = field + else: + args["global_"] = None + + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("limit", None) + if field is not None: + args["limit"] = field + else: + args["limit"] = None + + field = data.get("unlimited", None) + if field is not None: + args["unlimited"] = field + else: + args["unlimited"] = None + + return QuotumLimit(**args) + + def unmarshal_Quotum(data: Any) -> Quotum: if not isinstance(data, dict): raise TypeError( @@ -476,6 +518,16 @@ def unmarshal_Quotum(data: Any) -> Quotum: if field is not None: args["description"] = field + field = data.get("locality_type", None) + if field is not None: + args["locality_type"] = field + + field = data.get("limits", None) + if field is not None: + args["limits"] = ( + [unmarshal_QuotumLimit(v) for v in field] if field is not None else None + ) + field = data.get("limit", None) if field is not None: args["limit"] = field diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/types.py b/scaleway-async/scaleway_async/iam/v1alpha1/types.py index 6f2adc3f..571ee9ac 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/types.py @@ -7,6 +7,10 @@ from enum import Enum from typing import List, Optional +from scaleway_core.bridge import ( + Region as ScwRegion, + Zone as ScwZone, +) from scaleway_core.utils import ( StrEnumMeta, ) @@ -142,6 +146,15 @@ def __str__(self) -> str: return str(self.value) +class LocalityType(str, Enum, metaclass=StrEnumMeta): + GLOBAL = "global" + REGION = "region" + ZONE = "zone" + + def __str__(self) -> str: + return str(self.value) + + class LogAction(str, Enum, metaclass=StrEnumMeta): UNKNOWN_ACTION = "unknown_action" CREATED = "created" @@ -193,6 +206,19 @@ def __str__(self) -> str: return str(self.value) +@dataclass +class QuotumLimit: + global_: Optional[bool] + + region: Optional[ScwRegion] + + zone: Optional[ScwZone] + + limit: Optional[int] + + unlimited: Optional[bool] + + @dataclass class JWT: jti: str @@ -656,6 +682,16 @@ class Quotum: Details about the quota. """ + locality_type: LocalityType + """ + Whether this quotum is applied on at the zone level, region level, or globally. + """ + + limits: List[QuotumLimit] + """ + Limits per locality. + """ + limit: Optional[int] unlimited: Optional[bool] diff --git a/scaleway/scaleway/iam/v1alpha1/__init__.py b/scaleway/scaleway/iam/v1alpha1/__init__.py index 3837eaf0..edb257ba 100644 --- a/scaleway/scaleway/iam/v1alpha1/__init__.py +++ b/scaleway/scaleway/iam/v1alpha1/__init__.py @@ -12,11 +12,13 @@ from .types import ListQuotaRequestOrderBy from .types import ListSSHKeysRequestOrderBy from .types import ListUsersRequestOrderBy +from .types import LocalityType from .types import LogAction from .types import LogResourceType from .types import PermissionSetScopeType from .types import UserStatus from .types import UserType +from .types import QuotumLimit from .types import JWT from .types import RuleSpecs from .types import CreateUserRequestMember @@ -119,11 +121,13 @@ "ListQuotaRequestOrderBy", "ListSSHKeysRequestOrderBy", "ListUsersRequestOrderBy", + "LocalityType", "LogAction", "LogResourceType", "PermissionSetScopeType", "UserStatus", "UserType", + "QuotumLimit", "JWT", "RuleSpecs", "CreateUserRequestMember", diff --git a/scaleway/scaleway/iam/v1alpha1/marshalling.py b/scaleway/scaleway/iam/v1alpha1/marshalling.py index 09ce69f0..c6a9ef1e 100644 --- a/scaleway/scaleway/iam/v1alpha1/marshalling.py +++ b/scaleway/scaleway/iam/v1alpha1/marshalling.py @@ -16,6 +16,7 @@ Group, Log, Policy, + QuotumLimit, Quotum, SSHKey, User, @@ -452,6 +453,47 @@ def unmarshal_Policy(data: Any) -> Policy: return Policy(**args) +def unmarshal_QuotumLimit(data: Any) -> QuotumLimit: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'QuotumLimit' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("global", None) + if field is not None: + args["global_"] = field + else: + args["global_"] = None + + field = data.get("region", None) + if field is not None: + args["region"] = field + else: + args["region"] = None + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + else: + args["zone"] = None + + field = data.get("limit", None) + if field is not None: + args["limit"] = field + else: + args["limit"] = None + + field = data.get("unlimited", None) + if field is not None: + args["unlimited"] = field + else: + args["unlimited"] = None + + return QuotumLimit(**args) + + def unmarshal_Quotum(data: Any) -> Quotum: if not isinstance(data, dict): raise TypeError( @@ -476,6 +518,16 @@ def unmarshal_Quotum(data: Any) -> Quotum: if field is not None: args["description"] = field + field = data.get("locality_type", None) + if field is not None: + args["locality_type"] = field + + field = data.get("limits", None) + if field is not None: + args["limits"] = ( + [unmarshal_QuotumLimit(v) for v in field] if field is not None else None + ) + field = data.get("limit", None) if field is not None: args["limit"] = field diff --git a/scaleway/scaleway/iam/v1alpha1/types.py b/scaleway/scaleway/iam/v1alpha1/types.py index 6f2adc3f..571ee9ac 100644 --- a/scaleway/scaleway/iam/v1alpha1/types.py +++ b/scaleway/scaleway/iam/v1alpha1/types.py @@ -7,6 +7,10 @@ from enum import Enum from typing import List, Optional +from scaleway_core.bridge import ( + Region as ScwRegion, + Zone as ScwZone, +) from scaleway_core.utils import ( StrEnumMeta, ) @@ -142,6 +146,15 @@ def __str__(self) -> str: return str(self.value) +class LocalityType(str, Enum, metaclass=StrEnumMeta): + GLOBAL = "global" + REGION = "region" + ZONE = "zone" + + def __str__(self) -> str: + return str(self.value) + + class LogAction(str, Enum, metaclass=StrEnumMeta): UNKNOWN_ACTION = "unknown_action" CREATED = "created" @@ -193,6 +206,19 @@ def __str__(self) -> str: return str(self.value) +@dataclass +class QuotumLimit: + global_: Optional[bool] + + region: Optional[ScwRegion] + + zone: Optional[ScwZone] + + limit: Optional[int] + + unlimited: Optional[bool] + + @dataclass class JWT: jti: str @@ -656,6 +682,16 @@ class Quotum: Details about the quota. """ + locality_type: LocalityType + """ + Whether this quotum is applied on at the zone level, region level, or globally. + """ + + limits: List[QuotumLimit] + """ + Limits per locality. + """ + limit: Optional[int] unlimited: Optional[bool]