diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py index d4e328316..385a286af 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/__init__.py @@ -18,12 +18,13 @@ from .types import PermissionSetScopeType from .types import UserStatus from .types import UserType +from .types import GetUserConnectionsResponseConnectionConnectedOrganization +from .types import GetUserConnectionsResponseConnectionConnectedUser from .types import QuotumLimit -from .types import ListUserConnectionsResponseConnectionConnectedOrganization -from .types import ListUserConnectionsResponseConnectionConnectedUser from .types import JWT from .types import RuleSpecs from .types import CreateUserRequestMember +from .types import GetUserConnectionsResponseConnection from .types import APIKey from .types import Application from .types import GracePeriod @@ -34,7 +35,6 @@ from .types import Quotum from .types import Rule from .types import SSHKey -from .types import ListUserConnectionsResponseConnection from .types import User from .types import AddGroupMemberRequest from .types import AddGroupMembersRequest @@ -65,6 +65,8 @@ from .types import GetPolicyRequest from .types import GetQuotumRequest from .types import GetSSHKeyRequest +from .types import GetUserConnectionsRequest +from .types import GetUserConnectionsResponse from .types import GetUserRequest from .types import ListAPIKeysRequest from .types import ListAPIKeysResponse @@ -88,8 +90,6 @@ from .types import ListRulesResponse from .types import ListSSHKeysRequest from .types import ListSSHKeysResponse -from .types import ListUserConnectionsRequest -from .types import ListUserConnectionsResponse from .types import ListUsersRequest from .types import ListUsersResponse from .types import LockUserRequest @@ -132,12 +132,13 @@ "PermissionSetScopeType", "UserStatus", "UserType", + "GetUserConnectionsResponseConnectionConnectedOrganization", + "GetUserConnectionsResponseConnectionConnectedUser", "QuotumLimit", - "ListUserConnectionsResponseConnectionConnectedOrganization", - "ListUserConnectionsResponseConnectionConnectedUser", "JWT", "RuleSpecs", "CreateUserRequestMember", + "GetUserConnectionsResponseConnection", "APIKey", "Application", "GracePeriod", @@ -148,7 +149,6 @@ "Quotum", "Rule", "SSHKey", - "ListUserConnectionsResponseConnection", "User", "AddGroupMemberRequest", "AddGroupMembersRequest", @@ -179,6 +179,8 @@ "GetPolicyRequest", "GetQuotumRequest", "GetSSHKeyRequest", + "GetUserConnectionsRequest", + "GetUserConnectionsResponse", "GetUserRequest", "ListAPIKeysRequest", "ListAPIKeysResponse", @@ -202,8 +204,6 @@ "ListRulesResponse", "ListSSHKeysRequest", "ListSSHKeysResponse", - "ListUserConnectionsRequest", - "ListUserConnectionsResponse", "ListUsersRequest", "ListUsersResponse", "LockUserRequest", diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/api.py b/scaleway-async/scaleway_async/iam/v1alpha1/api.py index 335ed3bc2..b09424baf 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/api.py @@ -39,6 +39,7 @@ CreateUserRequest, CreateUserRequestMember, EncodedJWT, + GetUserConnectionsResponse, Group, JWT, ListAPIKeysResponse, @@ -52,7 +53,6 @@ ListQuotaResponse, ListRulesResponse, ListSSHKeysResponse, - ListUserConnectionsResponse, ListUsersResponse, Log, MFAOTP, @@ -91,6 +91,7 @@ unmarshal_SSHKey, unmarshal_User, unmarshal_EncodedJWT, + unmarshal_GetUserConnectionsResponse, unmarshal_ListAPIKeysResponse, unmarshal_ListApplicationsResponse, unmarshal_ListGracePeriodsResponse, @@ -102,7 +103,6 @@ unmarshal_ListQuotaResponse, unmarshal_ListRulesResponse, unmarshal_ListSSHKeysResponse, - unmarshal_ListUserConnectionsResponse, unmarshal_ListUsersResponse, unmarshal_MFAOTP, unmarshal_OrganizationSecuritySettings, @@ -853,19 +853,19 @@ async def list_grace_periods( self._throw_on_error(res) return unmarshal_ListGracePeriodsResponse(res.json()) - async def list_user_connections( + async def get_user_connections( self, *, user_id: str, - ) -> ListUserConnectionsResponse: + ) -> GetUserConnectionsResponse: """ :param user_id: ID of the user to list connections for. - :return: :class:`ListUserConnectionsResponse ` + :return: :class:`GetUserConnectionsResponse ` Usage: :: - result = await api.list_user_connections( + result = await api.get_user_connections( user_id="example", ) """ @@ -878,7 +878,7 @@ async def list_user_connections( ) self._throw_on_error(res) - return unmarshal_ListUserConnectionsResponse(res.json()) + return unmarshal_GetUserConnectionsResponse(res.json()) async def list_applications( self, diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py index a02759f70..4b35ea99c 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py @@ -21,6 +21,10 @@ SSHKey, User, EncodedJWT, + GetUserConnectionsResponseConnectionConnectedOrganization, + GetUserConnectionsResponseConnectionConnectedUser, + GetUserConnectionsResponseConnection, + GetUserConnectionsResponse, ListAPIKeysResponse, ListApplicationsResponse, GracePeriod, @@ -35,10 +39,6 @@ Rule, ListRulesResponse, ListSSHKeysResponse, - ListUserConnectionsResponseConnectionConnectedOrganization, - ListUserConnectionsResponseConnectionConnectedUser, - ListUserConnectionsResponseConnection, - ListUserConnectionsResponse, ListUsersResponse, MFAOTP, OrganizationSecuritySettings, @@ -704,6 +704,104 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT: return EncodedJWT(**args) +def unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization( + data: Any, +) -> GetUserConnectionsResponseConnectionConnectedOrganization: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("locked", None) + if field is not None: + args["locked"] = field + + return GetUserConnectionsResponseConnectionConnectedOrganization(**args) + + +def unmarshal_GetUserConnectionsResponseConnectionConnectedUser( + data: Any, +) -> GetUserConnectionsResponseConnectionConnectedUser: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("username", None) + if field is not None: + args["username"] = field + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + return GetUserConnectionsResponseConnectionConnectedUser(**args) + + +def unmarshal_GetUserConnectionsResponseConnection( + data: Any, +) -> GetUserConnectionsResponseConnection: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("organization", None) + if field is not None: + args["organization"] = ( + unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(field) + ) + else: + args["organization"] = None + + field = data.get("user", None) + if field is not None: + args["user"] = unmarshal_GetUserConnectionsResponseConnectionConnectedUser( + field + ) + else: + args["user"] = None + + return GetUserConnectionsResponseConnection(**args) + + +def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("connections", None) + if field is not None: + args["connections"] = ( + [unmarshal_GetUserConnectionsResponseConnection(v) for v in field] + if field is not None + else None + ) + + return GetUserConnectionsResponse(**args) + + def unmarshal_ListAPIKeysResponse(data: Any) -> ListAPIKeysResponse: if not isinstance(data, dict): raise TypeError( @@ -1034,104 +1132,6 @@ def unmarshal_ListSSHKeysResponse(data: Any) -> ListSSHKeysResponse: return ListSSHKeysResponse(**args) -def unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization( - data: Any, -) -> ListUserConnectionsResponseConnectionConnectedOrganization: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("locked", None) - if field is not None: - args["locked"] = field - - return ListUserConnectionsResponseConnectionConnectedOrganization(**args) - - -def unmarshal_ListUserConnectionsResponseConnectionConnectedUser( - data: Any, -) -> ListUserConnectionsResponseConnectionConnectedUser: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("username", None) - if field is not None: - args["username"] = field - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - return ListUserConnectionsResponseConnectionConnectedUser(**args) - - -def unmarshal_ListUserConnectionsResponseConnection( - data: Any, -) -> ListUserConnectionsResponseConnection: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnection' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("organization", None) - if field is not None: - args["organization"] = ( - unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization(field) - ) - else: - args["organization"] = None - - field = data.get("user", None) - if field is not None: - args["user"] = unmarshal_ListUserConnectionsResponseConnectionConnectedUser( - field - ) - else: - args["user"] = None - - return ListUserConnectionsResponseConnection(**args) - - -def unmarshal_ListUserConnectionsResponse(data: Any) -> ListUserConnectionsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("connections", None) - if field is not None: - args["connections"] = ( - [unmarshal_ListUserConnectionsResponseConnection(v) for v in field] - if field is not None - else None - ) - - return ListUserConnectionsResponse(**args) - - def unmarshal_ListUsersResponse(data: Any) -> ListUsersResponse: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway-async/scaleway_async/iam/v1alpha1/types.py b/scaleway-async/scaleway_async/iam/v1alpha1/types.py index 6d0a559a7..3d5b67aa2 100644 --- a/scaleway-async/scaleway_async/iam/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/iam/v1alpha1/types.py @@ -207,20 +207,7 @@ def __str__(self) -> str: @dataclass -class QuotumLimit: - global_: Optional[bool] - - region: Optional[ScwRegion] - - zone: Optional[ScwZone] - - limit: Optional[int] - - unlimited: Optional[bool] - - -@dataclass -class ListUserConnectionsResponseConnectionConnectedOrganization: +class GetUserConnectionsResponseConnectionConnectedOrganization: id: str name: str @@ -229,7 +216,7 @@ class ListUserConnectionsResponseConnectionConnectedOrganization: @dataclass -class ListUserConnectionsResponseConnectionConnectedUser: +class GetUserConnectionsResponseConnectionConnectedUser: id: str username: str @@ -237,6 +224,19 @@ class ListUserConnectionsResponseConnectionConnectedUser: type_: UserType +@dataclass +class QuotumLimit: + global_: Optional[bool] + + region: Optional[ScwRegion] + + zone: Optional[ScwZone] + + limit: Optional[int] + + unlimited: Optional[bool] + + @dataclass class JWT: jti: str @@ -325,6 +325,19 @@ class CreateUserRequestMember: """ +@dataclass +class GetUserConnectionsResponseConnection: + organization: Optional[GetUserConnectionsResponseConnectionConnectedOrganization] + """ + Information about the connected organization. + """ + + user: Optional[GetUserConnectionsResponseConnectionConnectedUser] + """ + Information about the connected user. + """ + + @dataclass class APIKey: access_key: str @@ -792,19 +805,6 @@ class SSHKey: """ -@dataclass -class ListUserConnectionsResponseConnection: - organization: Optional[ListUserConnectionsResponseConnectionConnectedOrganization] - """ - Information about the connected organization. - """ - - user: Optional[ListUserConnectionsResponseConnectionConnectedUser] - """ - Information about the connected user. - """ - - @dataclass class User: id: str @@ -1234,6 +1234,22 @@ class GetSSHKeyRequest: """ +@dataclass +class GetUserConnectionsRequest: + user_id: str + """ + ID of the user to list connections for. + """ + + +@dataclass +class GetUserConnectionsResponse: + connections: List[GetUserConnectionsResponseConnection] + """ + List of connections. + """ + + @dataclass class GetUserRequest: user_id: str @@ -1781,22 +1797,6 @@ class ListSSHKeysResponse: """ -@dataclass -class ListUserConnectionsRequest: - user_id: str - """ - ID of the user to list connections for. - """ - - -@dataclass -class ListUserConnectionsResponse: - connections: List[ListUserConnectionsResponseConnection] - """ - List of connections. - """ - - @dataclass class ListUsersRequest: order_by: Optional[ListUsersRequestOrderBy] diff --git a/scaleway/scaleway/iam/v1alpha1/__init__.py b/scaleway/scaleway/iam/v1alpha1/__init__.py index d4e328316..385a286af 100644 --- a/scaleway/scaleway/iam/v1alpha1/__init__.py +++ b/scaleway/scaleway/iam/v1alpha1/__init__.py @@ -18,12 +18,13 @@ from .types import PermissionSetScopeType from .types import UserStatus from .types import UserType +from .types import GetUserConnectionsResponseConnectionConnectedOrganization +from .types import GetUserConnectionsResponseConnectionConnectedUser from .types import QuotumLimit -from .types import ListUserConnectionsResponseConnectionConnectedOrganization -from .types import ListUserConnectionsResponseConnectionConnectedUser from .types import JWT from .types import RuleSpecs from .types import CreateUserRequestMember +from .types import GetUserConnectionsResponseConnection from .types import APIKey from .types import Application from .types import GracePeriod @@ -34,7 +35,6 @@ from .types import Quotum from .types import Rule from .types import SSHKey -from .types import ListUserConnectionsResponseConnection from .types import User from .types import AddGroupMemberRequest from .types import AddGroupMembersRequest @@ -65,6 +65,8 @@ from .types import GetPolicyRequest from .types import GetQuotumRequest from .types import GetSSHKeyRequest +from .types import GetUserConnectionsRequest +from .types import GetUserConnectionsResponse from .types import GetUserRequest from .types import ListAPIKeysRequest from .types import ListAPIKeysResponse @@ -88,8 +90,6 @@ from .types import ListRulesResponse from .types import ListSSHKeysRequest from .types import ListSSHKeysResponse -from .types import ListUserConnectionsRequest -from .types import ListUserConnectionsResponse from .types import ListUsersRequest from .types import ListUsersResponse from .types import LockUserRequest @@ -132,12 +132,13 @@ "PermissionSetScopeType", "UserStatus", "UserType", + "GetUserConnectionsResponseConnectionConnectedOrganization", + "GetUserConnectionsResponseConnectionConnectedUser", "QuotumLimit", - "ListUserConnectionsResponseConnectionConnectedOrganization", - "ListUserConnectionsResponseConnectionConnectedUser", "JWT", "RuleSpecs", "CreateUserRequestMember", + "GetUserConnectionsResponseConnection", "APIKey", "Application", "GracePeriod", @@ -148,7 +149,6 @@ "Quotum", "Rule", "SSHKey", - "ListUserConnectionsResponseConnection", "User", "AddGroupMemberRequest", "AddGroupMembersRequest", @@ -179,6 +179,8 @@ "GetPolicyRequest", "GetQuotumRequest", "GetSSHKeyRequest", + "GetUserConnectionsRequest", + "GetUserConnectionsResponse", "GetUserRequest", "ListAPIKeysRequest", "ListAPIKeysResponse", @@ -202,8 +204,6 @@ "ListRulesResponse", "ListSSHKeysRequest", "ListSSHKeysResponse", - "ListUserConnectionsRequest", - "ListUserConnectionsResponse", "ListUsersRequest", "ListUsersResponse", "LockUserRequest", diff --git a/scaleway/scaleway/iam/v1alpha1/api.py b/scaleway/scaleway/iam/v1alpha1/api.py index 4284181ef..fdb229a5a 100644 --- a/scaleway/scaleway/iam/v1alpha1/api.py +++ b/scaleway/scaleway/iam/v1alpha1/api.py @@ -39,6 +39,7 @@ CreateUserRequest, CreateUserRequestMember, EncodedJWT, + GetUserConnectionsResponse, Group, JWT, ListAPIKeysResponse, @@ -52,7 +53,6 @@ ListQuotaResponse, ListRulesResponse, ListSSHKeysResponse, - ListUserConnectionsResponse, ListUsersResponse, Log, MFAOTP, @@ -91,6 +91,7 @@ unmarshal_SSHKey, unmarshal_User, unmarshal_EncodedJWT, + unmarshal_GetUserConnectionsResponse, unmarshal_ListAPIKeysResponse, unmarshal_ListApplicationsResponse, unmarshal_ListGracePeriodsResponse, @@ -102,7 +103,6 @@ unmarshal_ListQuotaResponse, unmarshal_ListRulesResponse, unmarshal_ListSSHKeysResponse, - unmarshal_ListUserConnectionsResponse, unmarshal_ListUsersResponse, unmarshal_MFAOTP, unmarshal_OrganizationSecuritySettings, @@ -853,19 +853,19 @@ def list_grace_periods( self._throw_on_error(res) return unmarshal_ListGracePeriodsResponse(res.json()) - def list_user_connections( + def get_user_connections( self, *, user_id: str, - ) -> ListUserConnectionsResponse: + ) -> GetUserConnectionsResponse: """ :param user_id: ID of the user to list connections for. - :return: :class:`ListUserConnectionsResponse ` + :return: :class:`GetUserConnectionsResponse ` Usage: :: - result = api.list_user_connections( + result = api.get_user_connections( user_id="example", ) """ @@ -878,7 +878,7 @@ def list_user_connections( ) self._throw_on_error(res) - return unmarshal_ListUserConnectionsResponse(res.json()) + return unmarshal_GetUserConnectionsResponse(res.json()) def list_applications( self, diff --git a/scaleway/scaleway/iam/v1alpha1/marshalling.py b/scaleway/scaleway/iam/v1alpha1/marshalling.py index a02759f70..4b35ea99c 100644 --- a/scaleway/scaleway/iam/v1alpha1/marshalling.py +++ b/scaleway/scaleway/iam/v1alpha1/marshalling.py @@ -21,6 +21,10 @@ SSHKey, User, EncodedJWT, + GetUserConnectionsResponseConnectionConnectedOrganization, + GetUserConnectionsResponseConnectionConnectedUser, + GetUserConnectionsResponseConnection, + GetUserConnectionsResponse, ListAPIKeysResponse, ListApplicationsResponse, GracePeriod, @@ -35,10 +39,6 @@ Rule, ListRulesResponse, ListSSHKeysResponse, - ListUserConnectionsResponseConnectionConnectedOrganization, - ListUserConnectionsResponseConnectionConnectedUser, - ListUserConnectionsResponseConnection, - ListUserConnectionsResponse, ListUsersResponse, MFAOTP, OrganizationSecuritySettings, @@ -704,6 +704,104 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT: return EncodedJWT(**args) +def unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization( + data: Any, +) -> GetUserConnectionsResponseConnectionConnectedOrganization: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("locked", None) + if field is not None: + args["locked"] = field + + return GetUserConnectionsResponseConnectionConnectedOrganization(**args) + + +def unmarshal_GetUserConnectionsResponseConnectionConnectedUser( + data: Any, +) -> GetUserConnectionsResponseConnectionConnectedUser: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("username", None) + if field is not None: + args["username"] = field + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + return GetUserConnectionsResponseConnectionConnectedUser(**args) + + +def unmarshal_GetUserConnectionsResponseConnection( + data: Any, +) -> GetUserConnectionsResponseConnection: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("organization", None) + if field is not None: + args["organization"] = ( + unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(field) + ) + else: + args["organization"] = None + + field = data.get("user", None) + if field is not None: + args["user"] = unmarshal_GetUserConnectionsResponseConnectionConnectedUser( + field + ) + else: + args["user"] = None + + return GetUserConnectionsResponseConnection(**args) + + +def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("connections", None) + if field is not None: + args["connections"] = ( + [unmarshal_GetUserConnectionsResponseConnection(v) for v in field] + if field is not None + else None + ) + + return GetUserConnectionsResponse(**args) + + def unmarshal_ListAPIKeysResponse(data: Any) -> ListAPIKeysResponse: if not isinstance(data, dict): raise TypeError( @@ -1034,104 +1132,6 @@ def unmarshal_ListSSHKeysResponse(data: Any) -> ListSSHKeysResponse: return ListSSHKeysResponse(**args) -def unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization( - data: Any, -) -> ListUserConnectionsResponseConnectionConnectedOrganization: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("locked", None) - if field is not None: - args["locked"] = field - - return ListUserConnectionsResponseConnectionConnectedOrganization(**args) - - -def unmarshal_ListUserConnectionsResponseConnectionConnectedUser( - data: Any, -) -> ListUserConnectionsResponseConnectionConnectedUser: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("username", None) - if field is not None: - args["username"] = field - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - return ListUserConnectionsResponseConnectionConnectedUser(**args) - - -def unmarshal_ListUserConnectionsResponseConnection( - data: Any, -) -> ListUserConnectionsResponseConnection: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponseConnection' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("organization", None) - if field is not None: - args["organization"] = ( - unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization(field) - ) - else: - args["organization"] = None - - field = data.get("user", None) - if field is not None: - args["user"] = unmarshal_ListUserConnectionsResponseConnectionConnectedUser( - field - ) - else: - args["user"] = None - - return ListUserConnectionsResponseConnection(**args) - - -def unmarshal_ListUserConnectionsResponse(data: Any) -> ListUserConnectionsResponse: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'ListUserConnectionsResponse' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("connections", None) - if field is not None: - args["connections"] = ( - [unmarshal_ListUserConnectionsResponseConnection(v) for v in field] - if field is not None - else None - ) - - return ListUserConnectionsResponse(**args) - - def unmarshal_ListUsersResponse(data: Any) -> ListUsersResponse: if not isinstance(data, dict): raise TypeError( diff --git a/scaleway/scaleway/iam/v1alpha1/types.py b/scaleway/scaleway/iam/v1alpha1/types.py index 6d0a559a7..3d5b67aa2 100644 --- a/scaleway/scaleway/iam/v1alpha1/types.py +++ b/scaleway/scaleway/iam/v1alpha1/types.py @@ -207,20 +207,7 @@ def __str__(self) -> str: @dataclass -class QuotumLimit: - global_: Optional[bool] - - region: Optional[ScwRegion] - - zone: Optional[ScwZone] - - limit: Optional[int] - - unlimited: Optional[bool] - - -@dataclass -class ListUserConnectionsResponseConnectionConnectedOrganization: +class GetUserConnectionsResponseConnectionConnectedOrganization: id: str name: str @@ -229,7 +216,7 @@ class ListUserConnectionsResponseConnectionConnectedOrganization: @dataclass -class ListUserConnectionsResponseConnectionConnectedUser: +class GetUserConnectionsResponseConnectionConnectedUser: id: str username: str @@ -237,6 +224,19 @@ class ListUserConnectionsResponseConnectionConnectedUser: type_: UserType +@dataclass +class QuotumLimit: + global_: Optional[bool] + + region: Optional[ScwRegion] + + zone: Optional[ScwZone] + + limit: Optional[int] + + unlimited: Optional[bool] + + @dataclass class JWT: jti: str @@ -325,6 +325,19 @@ class CreateUserRequestMember: """ +@dataclass +class GetUserConnectionsResponseConnection: + organization: Optional[GetUserConnectionsResponseConnectionConnectedOrganization] + """ + Information about the connected organization. + """ + + user: Optional[GetUserConnectionsResponseConnectionConnectedUser] + """ + Information about the connected user. + """ + + @dataclass class APIKey: access_key: str @@ -792,19 +805,6 @@ class SSHKey: """ -@dataclass -class ListUserConnectionsResponseConnection: - organization: Optional[ListUserConnectionsResponseConnectionConnectedOrganization] - """ - Information about the connected organization. - """ - - user: Optional[ListUserConnectionsResponseConnectionConnectedUser] - """ - Information about the connected user. - """ - - @dataclass class User: id: str @@ -1234,6 +1234,22 @@ class GetSSHKeyRequest: """ +@dataclass +class GetUserConnectionsRequest: + user_id: str + """ + ID of the user to list connections for. + """ + + +@dataclass +class GetUserConnectionsResponse: + connections: List[GetUserConnectionsResponseConnection] + """ + List of connections. + """ + + @dataclass class GetUserRequest: user_id: str @@ -1781,22 +1797,6 @@ class ListSSHKeysResponse: """ -@dataclass -class ListUserConnectionsRequest: - user_id: str - """ - ID of the user to list connections for. - """ - - -@dataclass -class ListUserConnectionsResponse: - connections: List[ListUserConnectionsResponseConnection] - """ - List of connections. - """ - - @dataclass class ListUsersRequest: order_by: Optional[ListUsersRequestOrderBy]