Skip to content

Commit 3bcfcc2

Browse files
authored
feat(iam/v1alpha1): add GetSamlInformation (scaleway#1175)
1 parent f7ba7ab commit 3bcfcc2

File tree

8 files changed

+140
-0
lines changed

8 files changed

+140
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
from .types import GetPolicyRequest
7575
from .types import GetQuotumRequest
7676
from .types import GetSSHKeyRequest
77+
from .types import GetSamlInformationRequest
7778
from .types import GetUserConnectionsRequest
7879
from .types import GetUserConnectionsResponse
7980
from .types import GetUserRequest
@@ -114,6 +115,7 @@
114115
from .types import RemoveGroupMemberRequest
115116
from .types import RemoveUserConnectionRequest
116117
from .types import Saml
118+
from .types import SamlInformation
117119
from .types import SetGroupMembersRequest
118120
from .types import SetOrganizationAliasRequest
119121
from .types import SetRulesRequest
@@ -208,6 +210,7 @@
208210
"GetPolicyRequest",
209211
"GetQuotumRequest",
210212
"GetSSHKeyRequest",
213+
"GetSamlInformationRequest",
211214
"GetUserConnectionsRequest",
212215
"GetUserConnectionsResponse",
213216
"GetUserRequest",
@@ -248,6 +251,7 @@
248251
"RemoveGroupMemberRequest",
249252
"RemoveUserConnectionRequest",
250253
"Saml",
254+
"SamlInformation",
251255
"SetGroupMembersRequest",
252256
"SetOrganizationAliasRequest",
253257
"SetRulesRequest",

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
SSHKey,
7676
Saml,
7777
SamlCertificate,
78+
SamlInformation,
7879
SetGroupMembersRequest,
7980
SetOrganizationAliasRequest,
8081
SetRulesRequest,
@@ -124,6 +125,7 @@
124125
unmarshal_Organization,
125126
unmarshal_OrganizationSecuritySettings,
126127
unmarshal_Saml,
128+
unmarshal_SamlInformation,
127129
unmarshal_SetRulesResponse,
128130
unmarshal_ValidateUserMFAOTPResponse,
129131
marshal_AddGroupMemberRequest,
@@ -3274,3 +3276,25 @@ async def delete_saml_certificate(
32743276
)
32753277

32763278
self._throw_on_error(res)
3279+
3280+
async def get_saml_information(
3281+
self,
3282+
) -> SamlInformation:
3283+
"""
3284+
Get SAML information.
3285+
3286+
:return: :class:`SamlInformation <SamlInformation>`
3287+
3288+
Usage:
3289+
::
3290+
3291+
result = await api.get_saml_information()
3292+
"""
3293+
3294+
res = self._request(
3295+
"GET",
3296+
"/iam/v1alpha1/saml-information",
3297+
)
3298+
3299+
self._throw_on_error(res)
3300+
return unmarshal_SamlInformation(res.json())

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
Organization,
5757
OrganizationSecuritySettings,
5858
Saml,
59+
SamlInformation,
5960
SetRulesResponse,
6061
ValidateUserMFAOTPResponse,
6162
AddGroupMemberRequest,
@@ -1598,6 +1599,29 @@ def unmarshal_Saml(data: Any) -> Saml:
15981599
return Saml(**args)
15991600

16001601

1602+
def unmarshal_SamlInformation(data: Any) -> SamlInformation:
1603+
if not isinstance(data, dict):
1604+
raise TypeError(
1605+
"Unmarshalling the type 'SamlInformation' failed as data isn't a dictionary."
1606+
)
1607+
1608+
args: Dict[str, Any] = {}
1609+
1610+
field = data.get("entity_id", None)
1611+
if field is not None:
1612+
args["entity_id"] = field
1613+
else:
1614+
args["entity_id"] = None
1615+
1616+
field = data.get("assertion_consumer_service_url", None)
1617+
if field is not None:
1618+
args["assertion_consumer_service_url"] = field
1619+
else:
1620+
args["assertion_consumer_service_url"] = None
1621+
1622+
return SamlInformation(**args)
1623+
1624+
16011625
def unmarshal_SetRulesResponse(data: Any) -> SetRulesResponse:
16021626
if not isinstance(data, dict):
16031627
raise TypeError(

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,11 @@ class GetSSHKeyRequest:
13841384
"""
13851385

13861386

1387+
@dataclass
1388+
class GetSamlInformationRequest:
1389+
pass
1390+
1391+
13871392
@dataclass
13881393
class GetUserConnectionsRequest:
13891394
user_id: str
@@ -2159,6 +2164,19 @@ class Saml:
21592164
"""
21602165

21612166

2167+
@dataclass
2168+
class SamlInformation:
2169+
entity_id: str
2170+
"""
2171+
Entity ID.
2172+
"""
2173+
2174+
assertion_consumer_service_url: str
2175+
"""
2176+
SAML Assertion Consumer Service url.
2177+
"""
2178+
2179+
21622180
@dataclass
21632181
class SetGroupMembersRequest:
21642182
group_id: str

scaleway/scaleway/iam/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
from .types import GetPolicyRequest
7575
from .types import GetQuotumRequest
7676
from .types import GetSSHKeyRequest
77+
from .types import GetSamlInformationRequest
7778
from .types import GetUserConnectionsRequest
7879
from .types import GetUserConnectionsResponse
7980
from .types import GetUserRequest
@@ -114,6 +115,7 @@
114115
from .types import RemoveGroupMemberRequest
115116
from .types import RemoveUserConnectionRequest
116117
from .types import Saml
118+
from .types import SamlInformation
117119
from .types import SetGroupMembersRequest
118120
from .types import SetOrganizationAliasRequest
119121
from .types import SetRulesRequest
@@ -208,6 +210,7 @@
208210
"GetPolicyRequest",
209211
"GetQuotumRequest",
210212
"GetSSHKeyRequest",
213+
"GetSamlInformationRequest",
211214
"GetUserConnectionsRequest",
212215
"GetUserConnectionsResponse",
213216
"GetUserRequest",
@@ -248,6 +251,7 @@
248251
"RemoveGroupMemberRequest",
249252
"RemoveUserConnectionRequest",
250253
"Saml",
254+
"SamlInformation",
251255
"SetGroupMembersRequest",
252256
"SetOrganizationAliasRequest",
253257
"SetRulesRequest",

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
SSHKey,
7676
Saml,
7777
SamlCertificate,
78+
SamlInformation,
7879
SetGroupMembersRequest,
7980
SetOrganizationAliasRequest,
8081
SetRulesRequest,
@@ -124,6 +125,7 @@
124125
unmarshal_Organization,
125126
unmarshal_OrganizationSecuritySettings,
126127
unmarshal_Saml,
128+
unmarshal_SamlInformation,
127129
unmarshal_SetRulesResponse,
128130
unmarshal_ValidateUserMFAOTPResponse,
129131
marshal_AddGroupMemberRequest,
@@ -3274,3 +3276,25 @@ def delete_saml_certificate(
32743276
)
32753277

32763278
self._throw_on_error(res)
3279+
3280+
def get_saml_information(
3281+
self,
3282+
) -> SamlInformation:
3283+
"""
3284+
Get SAML information.
3285+
3286+
:return: :class:`SamlInformation <SamlInformation>`
3287+
3288+
Usage:
3289+
::
3290+
3291+
result = api.get_saml_information()
3292+
"""
3293+
3294+
res = self._request(
3295+
"GET",
3296+
"/iam/v1alpha1/saml-information",
3297+
)
3298+
3299+
self._throw_on_error(res)
3300+
return unmarshal_SamlInformation(res.json())

scaleway/scaleway/iam/v1alpha1/marshalling.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
Organization,
5757
OrganizationSecuritySettings,
5858
Saml,
59+
SamlInformation,
5960
SetRulesResponse,
6061
ValidateUserMFAOTPResponse,
6162
AddGroupMemberRequest,
@@ -1598,6 +1599,29 @@ def unmarshal_Saml(data: Any) -> Saml:
15981599
return Saml(**args)
15991600

16001601

1602+
def unmarshal_SamlInformation(data: Any) -> SamlInformation:
1603+
if not isinstance(data, dict):
1604+
raise TypeError(
1605+
"Unmarshalling the type 'SamlInformation' failed as data isn't a dictionary."
1606+
)
1607+
1608+
args: Dict[str, Any] = {}
1609+
1610+
field = data.get("entity_id", None)
1611+
if field is not None:
1612+
args["entity_id"] = field
1613+
else:
1614+
args["entity_id"] = None
1615+
1616+
field = data.get("assertion_consumer_service_url", None)
1617+
if field is not None:
1618+
args["assertion_consumer_service_url"] = field
1619+
else:
1620+
args["assertion_consumer_service_url"] = None
1621+
1622+
return SamlInformation(**args)
1623+
1624+
16011625
def unmarshal_SetRulesResponse(data: Any) -> SetRulesResponse:
16021626
if not isinstance(data, dict):
16031627
raise TypeError(

scaleway/scaleway/iam/v1alpha1/types.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,11 @@ class GetSSHKeyRequest:
13841384
"""
13851385

13861386

1387+
@dataclass
1388+
class GetSamlInformationRequest:
1389+
pass
1390+
1391+
13871392
@dataclass
13881393
class GetUserConnectionsRequest:
13891394
user_id: str
@@ -2159,6 +2164,19 @@ class Saml:
21592164
"""
21602165

21612166

2167+
@dataclass
2168+
class SamlInformation:
2169+
entity_id: str
2170+
"""
2171+
Entity ID.
2172+
"""
2173+
2174+
assertion_consumer_service_url: str
2175+
"""
2176+
SAML Assertion Consumer Service url.
2177+
"""
2178+
2179+
21622180
@dataclass
21632181
class SetGroupMembersRequest:
21642182
group_id: str

0 commit comments

Comments
 (0)