Skip to content

fix(iam): rename ListUserConnections to GetUserConnections to be clear this isn't paginated #889

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

Merged
merged 1 commit into from
Mar 6, 2025
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
20 changes: 10 additions & 10 deletions scaleway-async/scaleway_async/iam/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -132,12 +132,13 @@
"PermissionSetScopeType",
"UserStatus",
"UserType",
"GetUserConnectionsResponseConnectionConnectedOrganization",
"GetUserConnectionsResponseConnectionConnectedUser",
"QuotumLimit",
"ListUserConnectionsResponseConnectionConnectedOrganization",
"ListUserConnectionsResponseConnectionConnectedUser",
"JWT",
"RuleSpecs",
"CreateUserRequestMember",
"GetUserConnectionsResponseConnection",
"APIKey",
"Application",
"GracePeriod",
Expand All @@ -148,7 +149,6 @@
"Quotum",
"Rule",
"SSHKey",
"ListUserConnectionsResponseConnection",
"User",
"AddGroupMemberRequest",
"AddGroupMembersRequest",
Expand Down Expand Up @@ -179,6 +179,8 @@
"GetPolicyRequest",
"GetQuotumRequest",
"GetSSHKeyRequest",
"GetUserConnectionsRequest",
"GetUserConnectionsResponse",
"GetUserRequest",
"ListAPIKeysRequest",
"ListAPIKeysResponse",
Expand All @@ -202,8 +204,6 @@
"ListRulesResponse",
"ListSSHKeysRequest",
"ListSSHKeysResponse",
"ListUserConnectionsRequest",
"ListUserConnectionsResponse",
"ListUsersRequest",
"ListUsersResponse",
"LockUserRequest",
Expand Down
14 changes: 7 additions & 7 deletions scaleway-async/scaleway_async/iam/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
CreateUserRequest,
CreateUserRequestMember,
EncodedJWT,
GetUserConnectionsResponse,
Group,
JWT,
ListAPIKeysResponse,
Expand All @@ -52,7 +53,6 @@
ListQuotaResponse,
ListRulesResponse,
ListSSHKeysResponse,
ListUserConnectionsResponse,
ListUsersResponse,
Log,
MFAOTP,
Expand Down Expand Up @@ -91,6 +91,7 @@
unmarshal_SSHKey,
unmarshal_User,
unmarshal_EncodedJWT,
unmarshal_GetUserConnectionsResponse,
unmarshal_ListAPIKeysResponse,
unmarshal_ListApplicationsResponse,
unmarshal_ListGracePeriodsResponse,
Expand All @@ -102,7 +103,6 @@
unmarshal_ListQuotaResponse,
unmarshal_ListRulesResponse,
unmarshal_ListSSHKeysResponse,
unmarshal_ListUserConnectionsResponse,
unmarshal_ListUsersResponse,
unmarshal_MFAOTP,
unmarshal_OrganizationSecuritySettings,
Expand Down Expand Up @@ -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 <ListUserConnectionsResponse>`
:return: :class:`GetUserConnectionsResponse <GetUserConnectionsResponse>`

Usage:
::

result = await api.list_user_connections(
result = await api.get_user_connections(
user_id="example",
)
"""
Expand All @@ -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,
Expand Down
204 changes: 102 additions & 102 deletions scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
SSHKey,
User,
EncodedJWT,
GetUserConnectionsResponseConnectionConnectedOrganization,
GetUserConnectionsResponseConnectionConnectedUser,
GetUserConnectionsResponseConnection,
GetUserConnectionsResponse,
ListAPIKeysResponse,
ListApplicationsResponse,
GracePeriod,
Expand All @@ -35,10 +39,6 @@
Rule,
ListRulesResponse,
ListSSHKeysResponse,
ListUserConnectionsResponseConnectionConnectedOrganization,
ListUserConnectionsResponseConnectionConnectedUser,
ListUserConnectionsResponseConnection,
ListUserConnectionsResponse,
ListUsersResponse,
MFAOTP,
OrganizationSecuritySettings,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading