Skip to content

Commit a79fe48

Browse files
authored
fix(iam): rename ListUserConnections to GetUserConnections to be clear this isn't paginated (#889)
1 parent ad6a67a commit a79fe48

File tree

8 files changed

+326
-326
lines changed

8 files changed

+326
-326
lines changed

scaleway-async/scaleway_async/iam/v1alpha1/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
from .types import PermissionSetScopeType
1919
from .types import UserStatus
2020
from .types import UserType
21+
from .types import GetUserConnectionsResponseConnectionConnectedOrganization
22+
from .types import GetUserConnectionsResponseConnectionConnectedUser
2123
from .types import QuotumLimit
22-
from .types import ListUserConnectionsResponseConnectionConnectedOrganization
23-
from .types import ListUserConnectionsResponseConnectionConnectedUser
2424
from .types import JWT
2525
from .types import RuleSpecs
2626
from .types import CreateUserRequestMember
27+
from .types import GetUserConnectionsResponseConnection
2728
from .types import APIKey
2829
from .types import Application
2930
from .types import GracePeriod
@@ -34,7 +35,6 @@
3435
from .types import Quotum
3536
from .types import Rule
3637
from .types import SSHKey
37-
from .types import ListUserConnectionsResponseConnection
3838
from .types import User
3939
from .types import AddGroupMemberRequest
4040
from .types import AddGroupMembersRequest
@@ -65,6 +65,8 @@
6565
from .types import GetPolicyRequest
6666
from .types import GetQuotumRequest
6767
from .types import GetSSHKeyRequest
68+
from .types import GetUserConnectionsRequest
69+
from .types import GetUserConnectionsResponse
6870
from .types import GetUserRequest
6971
from .types import ListAPIKeysRequest
7072
from .types import ListAPIKeysResponse
@@ -88,8 +90,6 @@
8890
from .types import ListRulesResponse
8991
from .types import ListSSHKeysRequest
9092
from .types import ListSSHKeysResponse
91-
from .types import ListUserConnectionsRequest
92-
from .types import ListUserConnectionsResponse
9393
from .types import ListUsersRequest
9494
from .types import ListUsersResponse
9595
from .types import LockUserRequest
@@ -132,12 +132,13 @@
132132
"PermissionSetScopeType",
133133
"UserStatus",
134134
"UserType",
135+
"GetUserConnectionsResponseConnectionConnectedOrganization",
136+
"GetUserConnectionsResponseConnectionConnectedUser",
135137
"QuotumLimit",
136-
"ListUserConnectionsResponseConnectionConnectedOrganization",
137-
"ListUserConnectionsResponseConnectionConnectedUser",
138138
"JWT",
139139
"RuleSpecs",
140140
"CreateUserRequestMember",
141+
"GetUserConnectionsResponseConnection",
141142
"APIKey",
142143
"Application",
143144
"GracePeriod",
@@ -148,7 +149,6 @@
148149
"Quotum",
149150
"Rule",
150151
"SSHKey",
151-
"ListUserConnectionsResponseConnection",
152152
"User",
153153
"AddGroupMemberRequest",
154154
"AddGroupMembersRequest",
@@ -179,6 +179,8 @@
179179
"GetPolicyRequest",
180180
"GetQuotumRequest",
181181
"GetSSHKeyRequest",
182+
"GetUserConnectionsRequest",
183+
"GetUserConnectionsResponse",
182184
"GetUserRequest",
183185
"ListAPIKeysRequest",
184186
"ListAPIKeysResponse",
@@ -202,8 +204,6 @@
202204
"ListRulesResponse",
203205
"ListSSHKeysRequest",
204206
"ListSSHKeysResponse",
205-
"ListUserConnectionsRequest",
206-
"ListUserConnectionsResponse",
207207
"ListUsersRequest",
208208
"ListUsersResponse",
209209
"LockUserRequest",

scaleway-async/scaleway_async/iam/v1alpha1/api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
CreateUserRequest,
4040
CreateUserRequestMember,
4141
EncodedJWT,
42+
GetUserConnectionsResponse,
4243
Group,
4344
JWT,
4445
ListAPIKeysResponse,
@@ -52,7 +53,6 @@
5253
ListQuotaResponse,
5354
ListRulesResponse,
5455
ListSSHKeysResponse,
55-
ListUserConnectionsResponse,
5656
ListUsersResponse,
5757
Log,
5858
MFAOTP,
@@ -91,6 +91,7 @@
9191
unmarshal_SSHKey,
9292
unmarshal_User,
9393
unmarshal_EncodedJWT,
94+
unmarshal_GetUserConnectionsResponse,
9495
unmarshal_ListAPIKeysResponse,
9596
unmarshal_ListApplicationsResponse,
9697
unmarshal_ListGracePeriodsResponse,
@@ -102,7 +103,6 @@
102103
unmarshal_ListQuotaResponse,
103104
unmarshal_ListRulesResponse,
104105
unmarshal_ListSSHKeysResponse,
105-
unmarshal_ListUserConnectionsResponse,
106106
unmarshal_ListUsersResponse,
107107
unmarshal_MFAOTP,
108108
unmarshal_OrganizationSecuritySettings,
@@ -853,19 +853,19 @@ async def list_grace_periods(
853853
self._throw_on_error(res)
854854
return unmarshal_ListGracePeriodsResponse(res.json())
855855

856-
async def list_user_connections(
856+
async def get_user_connections(
857857
self,
858858
*,
859859
user_id: str,
860-
) -> ListUserConnectionsResponse:
860+
) -> GetUserConnectionsResponse:
861861
"""
862862
:param user_id: ID of the user to list connections for.
863-
:return: :class:`ListUserConnectionsResponse <ListUserConnectionsResponse>`
863+
:return: :class:`GetUserConnectionsResponse <GetUserConnectionsResponse>`
864864
865865
Usage:
866866
::
867867
868-
result = await api.list_user_connections(
868+
result = await api.get_user_connections(
869869
user_id="example",
870870
)
871871
"""
@@ -878,7 +878,7 @@ async def list_user_connections(
878878
)
879879

880880
self._throw_on_error(res)
881-
return unmarshal_ListUserConnectionsResponse(res.json())
881+
return unmarshal_GetUserConnectionsResponse(res.json())
882882

883883
async def list_applications(
884884
self,

scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py

Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
SSHKey,
2222
User,
2323
EncodedJWT,
24+
GetUserConnectionsResponseConnectionConnectedOrganization,
25+
GetUserConnectionsResponseConnectionConnectedUser,
26+
GetUserConnectionsResponseConnection,
27+
GetUserConnectionsResponse,
2428
ListAPIKeysResponse,
2529
ListApplicationsResponse,
2630
GracePeriod,
@@ -35,10 +39,6 @@
3539
Rule,
3640
ListRulesResponse,
3741
ListSSHKeysResponse,
38-
ListUserConnectionsResponseConnectionConnectedOrganization,
39-
ListUserConnectionsResponseConnectionConnectedUser,
40-
ListUserConnectionsResponseConnection,
41-
ListUserConnectionsResponse,
4242
ListUsersResponse,
4343
MFAOTP,
4444
OrganizationSecuritySettings,
@@ -704,6 +704,104 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT:
704704
return EncodedJWT(**args)
705705

706706

707+
def unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(
708+
data: Any,
709+
) -> GetUserConnectionsResponseConnectionConnectedOrganization:
710+
if not isinstance(data, dict):
711+
raise TypeError(
712+
"Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary."
713+
)
714+
715+
args: Dict[str, Any] = {}
716+
717+
field = data.get("id", None)
718+
if field is not None:
719+
args["id"] = field
720+
721+
field = data.get("name", None)
722+
if field is not None:
723+
args["name"] = field
724+
725+
field = data.get("locked", None)
726+
if field is not None:
727+
args["locked"] = field
728+
729+
return GetUserConnectionsResponseConnectionConnectedOrganization(**args)
730+
731+
732+
def unmarshal_GetUserConnectionsResponseConnectionConnectedUser(
733+
data: Any,
734+
) -> GetUserConnectionsResponseConnectionConnectedUser:
735+
if not isinstance(data, dict):
736+
raise TypeError(
737+
"Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary."
738+
)
739+
740+
args: Dict[str, Any] = {}
741+
742+
field = data.get("id", None)
743+
if field is not None:
744+
args["id"] = field
745+
746+
field = data.get("username", None)
747+
if field is not None:
748+
args["username"] = field
749+
750+
field = data.get("type", None)
751+
if field is not None:
752+
args["type_"] = field
753+
754+
return GetUserConnectionsResponseConnectionConnectedUser(**args)
755+
756+
757+
def unmarshal_GetUserConnectionsResponseConnection(
758+
data: Any,
759+
) -> GetUserConnectionsResponseConnection:
760+
if not isinstance(data, dict):
761+
raise TypeError(
762+
"Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary."
763+
)
764+
765+
args: Dict[str, Any] = {}
766+
767+
field = data.get("organization", None)
768+
if field is not None:
769+
args["organization"] = (
770+
unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(field)
771+
)
772+
else:
773+
args["organization"] = None
774+
775+
field = data.get("user", None)
776+
if field is not None:
777+
args["user"] = unmarshal_GetUserConnectionsResponseConnectionConnectedUser(
778+
field
779+
)
780+
else:
781+
args["user"] = None
782+
783+
return GetUserConnectionsResponseConnection(**args)
784+
785+
786+
def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsResponse:
787+
if not isinstance(data, dict):
788+
raise TypeError(
789+
"Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary."
790+
)
791+
792+
args: Dict[str, Any] = {}
793+
794+
field = data.get("connections", None)
795+
if field is not None:
796+
args["connections"] = (
797+
[unmarshal_GetUserConnectionsResponseConnection(v) for v in field]
798+
if field is not None
799+
else None
800+
)
801+
802+
return GetUserConnectionsResponse(**args)
803+
804+
707805
def unmarshal_ListAPIKeysResponse(data: Any) -> ListAPIKeysResponse:
708806
if not isinstance(data, dict):
709807
raise TypeError(
@@ -1034,104 +1132,6 @@ def unmarshal_ListSSHKeysResponse(data: Any) -> ListSSHKeysResponse:
10341132
return ListSSHKeysResponse(**args)
10351133

10361134

1037-
def unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization(
1038-
data: Any,
1039-
) -> ListUserConnectionsResponseConnectionConnectedOrganization:
1040-
if not isinstance(data, dict):
1041-
raise TypeError(
1042-
"Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary."
1043-
)
1044-
1045-
args: Dict[str, Any] = {}
1046-
1047-
field = data.get("id", None)
1048-
if field is not None:
1049-
args["id"] = field
1050-
1051-
field = data.get("name", None)
1052-
if field is not None:
1053-
args["name"] = field
1054-
1055-
field = data.get("locked", None)
1056-
if field is not None:
1057-
args["locked"] = field
1058-
1059-
return ListUserConnectionsResponseConnectionConnectedOrganization(**args)
1060-
1061-
1062-
def unmarshal_ListUserConnectionsResponseConnectionConnectedUser(
1063-
data: Any,
1064-
) -> ListUserConnectionsResponseConnectionConnectedUser:
1065-
if not isinstance(data, dict):
1066-
raise TypeError(
1067-
"Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary."
1068-
)
1069-
1070-
args: Dict[str, Any] = {}
1071-
1072-
field = data.get("id", None)
1073-
if field is not None:
1074-
args["id"] = field
1075-
1076-
field = data.get("username", None)
1077-
if field is not None:
1078-
args["username"] = field
1079-
1080-
field = data.get("type", None)
1081-
if field is not None:
1082-
args["type_"] = field
1083-
1084-
return ListUserConnectionsResponseConnectionConnectedUser(**args)
1085-
1086-
1087-
def unmarshal_ListUserConnectionsResponseConnection(
1088-
data: Any,
1089-
) -> ListUserConnectionsResponseConnection:
1090-
if not isinstance(data, dict):
1091-
raise TypeError(
1092-
"Unmarshalling the type 'ListUserConnectionsResponseConnection' failed as data isn't a dictionary."
1093-
)
1094-
1095-
args: Dict[str, Any] = {}
1096-
1097-
field = data.get("organization", None)
1098-
if field is not None:
1099-
args["organization"] = (
1100-
unmarshal_ListUserConnectionsResponseConnectionConnectedOrganization(field)
1101-
)
1102-
else:
1103-
args["organization"] = None
1104-
1105-
field = data.get("user", None)
1106-
if field is not None:
1107-
args["user"] = unmarshal_ListUserConnectionsResponseConnectionConnectedUser(
1108-
field
1109-
)
1110-
else:
1111-
args["user"] = None
1112-
1113-
return ListUserConnectionsResponseConnection(**args)
1114-
1115-
1116-
def unmarshal_ListUserConnectionsResponse(data: Any) -> ListUserConnectionsResponse:
1117-
if not isinstance(data, dict):
1118-
raise TypeError(
1119-
"Unmarshalling the type 'ListUserConnectionsResponse' failed as data isn't a dictionary."
1120-
)
1121-
1122-
args: Dict[str, Any] = {}
1123-
1124-
field = data.get("connections", None)
1125-
if field is not None:
1126-
args["connections"] = (
1127-
[unmarshal_ListUserConnectionsResponseConnection(v) for v in field]
1128-
if field is not None
1129-
else None
1130-
)
1131-
1132-
return ListUserConnectionsResponse(**args)
1133-
1134-
11351135
def unmarshal_ListUsersResponse(data: Any) -> ListUsersResponse:
11361136
if not isinstance(data, dict):
11371137
raise TypeError(

0 commit comments

Comments
 (0)