Skip to content

Commit 7f1d0be

Browse files
committed
feat: update generated APIs
1 parent a7e5afc commit 7f1d0be

File tree

8 files changed

+376
-0
lines changed

8 files changed

+376
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +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
2224
from .types import JWT
2325
from .types import RuleSpecs
2426
from .types import CreateUserRequestMember
27+
from .types import GetUserConnectionsResponseConnection
2528
from .types import APIKey
2629
from .types import Application
2730
from .types import GracePeriod
@@ -62,6 +65,8 @@
6265
from .types import GetPolicyRequest
6366
from .types import GetQuotumRequest
6467
from .types import GetSSHKeyRequest
68+
from .types import GetUserConnectionsRequest
69+
from .types import GetUserConnectionsResponse
6570
from .types import GetUserRequest
6671
from .types import ListAPIKeysRequest
6772
from .types import ListAPIKeysResponse
@@ -127,10 +132,13 @@
127132
"PermissionSetScopeType",
128133
"UserStatus",
129134
"UserType",
135+
"GetUserConnectionsResponseConnectionConnectedOrganization",
136+
"GetUserConnectionsResponseConnectionConnectedUser",
130137
"QuotumLimit",
131138
"JWT",
132139
"RuleSpecs",
133140
"CreateUserRequestMember",
141+
"GetUserConnectionsResponseConnection",
134142
"APIKey",
135143
"Application",
136144
"GracePeriod",
@@ -171,6 +179,8 @@
171179
"GetPolicyRequest",
172180
"GetQuotumRequest",
173181
"GetSSHKeyRequest",
182+
"GetUserConnectionsRequest",
183+
"GetUserConnectionsResponse",
174184
"GetUserRequest",
175185
"ListAPIKeysRequest",
176186
"ListAPIKeysResponse",

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

Lines changed: 29 additions & 0 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,
@@ -90,6 +91,7 @@
9091
unmarshal_SSHKey,
9192
unmarshal_User,
9293
unmarshal_EncodedJWT,
94+
unmarshal_GetUserConnectionsResponse,
9395
unmarshal_ListAPIKeysResponse,
9496
unmarshal_ListApplicationsResponse,
9597
unmarshal_ListGracePeriodsResponse,
@@ -851,6 +853,33 @@ async def list_grace_periods(
851853
self._throw_on_error(res)
852854
return unmarshal_ListGracePeriodsResponse(res.json())
853855

856+
async def get_user_connections(
857+
self,
858+
*,
859+
user_id: str,
860+
) -> GetUserConnectionsResponse:
861+
"""
862+
:param user_id: ID of the user to list connections for.
863+
:return: :class:`GetUserConnectionsResponse <GetUserConnectionsResponse>`
864+
865+
Usage:
866+
::
867+
868+
result = await api.get_user_connections(
869+
user_id="example",
870+
)
871+
"""
872+
873+
param_user_id = validate_path_param("user_id", user_id)
874+
875+
res = self._request(
876+
"GET",
877+
f"/iam/v1alpha1/users/{param_user_id}/connections",
878+
)
879+
880+
self._throw_on_error(res)
881+
return unmarshal_GetUserConnectionsResponse(res.json())
882+
854883
async def list_applications(
855884
self,
856885
*,

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

Lines changed: 102 additions & 0 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,
@@ -700,6 +704,104 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT:
700704
return EncodedJWT(**args)
701705

702706

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+
703805
def unmarshal_ListAPIKeysResponse(data: Any) -> ListAPIKeysResponse:
704806
if not isinstance(data, dict):
705807
raise TypeError(

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,24 @@ def __str__(self) -> str:
206206
return str(self.value)
207207

208208

209+
@dataclass
210+
class GetUserConnectionsResponseConnectionConnectedOrganization:
211+
id: str
212+
213+
name: str
214+
215+
locked: bool
216+
217+
218+
@dataclass
219+
class GetUserConnectionsResponseConnectionConnectedUser:
220+
id: str
221+
222+
username: str
223+
224+
type_: UserType
225+
226+
209227
@dataclass
210228
class QuotumLimit:
211229
global_: Optional[bool]
@@ -307,6 +325,19 @@ class CreateUserRequestMember:
307325
"""
308326

309327

328+
@dataclass
329+
class GetUserConnectionsResponseConnection:
330+
organization: Optional[GetUserConnectionsResponseConnectionConnectedOrganization]
331+
"""
332+
Information about the connected organization.
333+
"""
334+
335+
user: Optional[GetUserConnectionsResponseConnectionConnectedUser]
336+
"""
337+
Information about the connected user.
338+
"""
339+
340+
310341
@dataclass
311342
class APIKey:
312343
access_key: str
@@ -1203,6 +1234,22 @@ class GetSSHKeyRequest:
12031234
"""
12041235

12051236

1237+
@dataclass
1238+
class GetUserConnectionsRequest:
1239+
user_id: str
1240+
"""
1241+
ID of the user to list connections for.
1242+
"""
1243+
1244+
1245+
@dataclass
1246+
class GetUserConnectionsResponse:
1247+
connections: List[GetUserConnectionsResponseConnection]
1248+
"""
1249+
List of connections.
1250+
"""
1251+
1252+
12061253
@dataclass
12071254
class GetUserRequest:
12081255
user_id: str

scaleway/scaleway/iam/v1alpha1/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +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
2224
from .types import JWT
2325
from .types import RuleSpecs
2426
from .types import CreateUserRequestMember
27+
from .types import GetUserConnectionsResponseConnection
2528
from .types import APIKey
2629
from .types import Application
2730
from .types import GracePeriod
@@ -62,6 +65,8 @@
6265
from .types import GetPolicyRequest
6366
from .types import GetQuotumRequest
6467
from .types import GetSSHKeyRequest
68+
from .types import GetUserConnectionsRequest
69+
from .types import GetUserConnectionsResponse
6570
from .types import GetUserRequest
6671
from .types import ListAPIKeysRequest
6772
from .types import ListAPIKeysResponse
@@ -127,10 +132,13 @@
127132
"PermissionSetScopeType",
128133
"UserStatus",
129134
"UserType",
135+
"GetUserConnectionsResponseConnectionConnectedOrganization",
136+
"GetUserConnectionsResponseConnectionConnectedUser",
130137
"QuotumLimit",
131138
"JWT",
132139
"RuleSpecs",
133140
"CreateUserRequestMember",
141+
"GetUserConnectionsResponseConnection",
134142
"APIKey",
135143
"Application",
136144
"GracePeriod",
@@ -171,6 +179,8 @@
171179
"GetPolicyRequest",
172180
"GetQuotumRequest",
173181
"GetSSHKeyRequest",
182+
"GetUserConnectionsRequest",
183+
"GetUserConnectionsResponse",
174184
"GetUserRequest",
175185
"ListAPIKeysRequest",
176186
"ListAPIKeysResponse",

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 29 additions & 0 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,
@@ -90,6 +91,7 @@
9091
unmarshal_SSHKey,
9192
unmarshal_User,
9293
unmarshal_EncodedJWT,
94+
unmarshal_GetUserConnectionsResponse,
9395
unmarshal_ListAPIKeysResponse,
9496
unmarshal_ListApplicationsResponse,
9597
unmarshal_ListGracePeriodsResponse,
@@ -851,6 +853,33 @@ def list_grace_periods(
851853
self._throw_on_error(res)
852854
return unmarshal_ListGracePeriodsResponse(res.json())
853855

856+
def get_user_connections(
857+
self,
858+
*,
859+
user_id: str,
860+
) -> GetUserConnectionsResponse:
861+
"""
862+
:param user_id: ID of the user to list connections for.
863+
:return: :class:`GetUserConnectionsResponse <GetUserConnectionsResponse>`
864+
865+
Usage:
866+
::
867+
868+
result = api.get_user_connections(
869+
user_id="example",
870+
)
871+
"""
872+
873+
param_user_id = validate_path_param("user_id", user_id)
874+
875+
res = self._request(
876+
"GET",
877+
f"/iam/v1alpha1/users/{param_user_id}/connections",
878+
)
879+
880+
self._throw_on_error(res)
881+
return unmarshal_GetUserConnectionsResponse(res.json())
882+
854883
def list_applications(
855884
self,
856885
*,

0 commit comments

Comments
 (0)