Skip to content

Commit cd5d8fe

Browse files
committed
feat: update generated APIs
1 parent 9e8d30f commit cd5d8fe

File tree

8 files changed

+232
-0
lines changed

8 files changed

+232
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
from .types import UpdateAPIKeyRequest
125125
from .types import UpdateApplicationRequest
126126
from .types import UpdateGroupRequest
127+
from .types import UpdateOrganizationLoginMethodsRequest
127128
from .types import UpdateOrganizationSecuritySettingsRequest
128129
from .types import UpdatePolicyRequest
129130
from .types import UpdateSSHKeyRequest
@@ -260,6 +261,7 @@
260261
"UpdateAPIKeyRequest",
261262
"UpdateApplicationRequest",
262263
"UpdateGroupRequest",
264+
"UpdateOrganizationLoginMethodsRequest",
263265
"UpdateOrganizationSecuritySettingsRequest",
264266
"UpdatePolicyRequest",
265267
"UpdateSSHKeyRequest",

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,6 +3043,48 @@ async def migrate_organization_guests(
30433043

30443044
self._throw_on_error(res)
30453045

3046+
async def update_organization_login_methods(
3047+
self,
3048+
*,
3049+
organization_id: Optional[str] = None,
3050+
login_password_enabled: Optional[bool] = None,
3051+
login_oauth2_enabled: Optional[bool] = None,
3052+
login_magic_code_enabled: Optional[bool] = None,
3053+
login_saml_enabled: Optional[bool] = None,
3054+
) -> Organization:
3055+
"""
3056+
Set your Organization's allowed login methods.
3057+
:param organization_id: ID of the Organization.
3058+
:param login_password_enabled: Defines whether login with a password is enabled for the Organization.
3059+
:param login_oauth2_enabled: Defines whether login through OAuth2 is enabled for the Organization.
3060+
:param login_magic_code_enabled: Defines whether login with an authentication code is enabled for the Organization.
3061+
:param login_saml_enabled: Defines whether login through SAML is enabled for the Organization.
3062+
:return: :class:`Organization <Organization>`
3063+
3064+
Usage:
3065+
::
3066+
3067+
result = await api.update_organization_login_methods()
3068+
"""
3069+
3070+
param_organization_id = validate_path_param(
3071+
"organization_id", organization_id or self.client.default_organization_id
3072+
)
3073+
3074+
res = self._request(
3075+
"PATCH",
3076+
f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods",
3077+
params={
3078+
"login_magic_code_enabled": login_magic_code_enabled,
3079+
"login_oauth2_enabled": login_oauth2_enabled,
3080+
"login_password_enabled": login_password_enabled,
3081+
"login_saml_enabled": login_saml_enabled,
3082+
},
3083+
)
3084+
3085+
self._throw_on_error(res)
3086+
return unmarshal_Organization(res.json())
3087+
30463088
async def get_organization_saml(
30473089
self,
30483090
*,

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,30 @@ def unmarshal_Organization(data: Any) -> Organization:
15381538
else:
15391539
args["alias"] = None
15401540

1541+
field = data.get("login_password_enabled", None)
1542+
if field is not None:
1543+
args["login_password_enabled"] = field
1544+
else:
1545+
args["login_password_enabled"] = False
1546+
1547+
field = data.get("login_magic_code_enabled", None)
1548+
if field is not None:
1549+
args["login_magic_code_enabled"] = field
1550+
else:
1551+
args["login_magic_code_enabled"] = False
1552+
1553+
field = data.get("login_oauth2_enabled", None)
1554+
if field is not None:
1555+
args["login_oauth2_enabled"] = field
1556+
else:
1557+
args["login_oauth2_enabled"] = False
1558+
1559+
field = data.get("login_saml_enabled", None)
1560+
if field is not None:
1561+
args["login_saml_enabled"] = field
1562+
else:
1563+
args["login_saml_enabled"] = False
1564+
15411565
return Organization(**args)
15421566

15431567

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,26 @@ class Organization:
21042104
Alias of the Organization.
21052105
"""
21062106

2107+
login_password_enabled: bool
2108+
"""
2109+
Defines whether login with a password is enabled for the Organization.
2110+
"""
2111+
2112+
login_magic_code_enabled: bool
2113+
"""
2114+
Defines whether login with an authentication code is enabled for the Organization.
2115+
"""
2116+
2117+
login_oauth2_enabled: bool
2118+
"""
2119+
Defines whether login through OAuth2 is enabled for the Organization.
2120+
"""
2121+
2122+
login_saml_enabled: bool
2123+
"""
2124+
Defines whether login through SAML is enabled for the Organization.
2125+
"""
2126+
21072127

21082128
@dataclass
21092129
class OrganizationSecuritySettings:
@@ -2294,6 +2314,34 @@ class UpdateGroupRequest:
22942314
"""
22952315

22962316

2317+
@dataclass
2318+
class UpdateOrganizationLoginMethodsRequest:
2319+
organization_id: Optional[str] = None
2320+
"""
2321+
ID of the Organization.
2322+
"""
2323+
2324+
login_password_enabled: Optional[bool] = False
2325+
"""
2326+
Defines whether login with a password is enabled for the Organization.
2327+
"""
2328+
2329+
login_oauth2_enabled: Optional[bool] = False
2330+
"""
2331+
Defines whether login through OAuth2 is enabled for the Organization.
2332+
"""
2333+
2334+
login_magic_code_enabled: Optional[bool] = False
2335+
"""
2336+
Defines whether login with an authentication code is enabled for the Organization.
2337+
"""
2338+
2339+
login_saml_enabled: Optional[bool] = False
2340+
"""
2341+
Defines whether login through SAML is enabled for the Organization.
2342+
"""
2343+
2344+
22972345
@dataclass
22982346
class UpdateOrganizationSecuritySettingsRequest:
22992347
organization_id: Optional[str] = None

scaleway/scaleway/iam/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
from .types import UpdateAPIKeyRequest
125125
from .types import UpdateApplicationRequest
126126
from .types import UpdateGroupRequest
127+
from .types import UpdateOrganizationLoginMethodsRequest
127128
from .types import UpdateOrganizationSecuritySettingsRequest
128129
from .types import UpdatePolicyRequest
129130
from .types import UpdateSSHKeyRequest
@@ -260,6 +261,7 @@
260261
"UpdateAPIKeyRequest",
261262
"UpdateApplicationRequest",
262263
"UpdateGroupRequest",
264+
"UpdateOrganizationLoginMethodsRequest",
263265
"UpdateOrganizationSecuritySettingsRequest",
264266
"UpdatePolicyRequest",
265267
"UpdateSSHKeyRequest",

scaleway/scaleway/iam/v1alpha1/api.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,6 +3043,48 @@ def migrate_organization_guests(
30433043

30443044
self._throw_on_error(res)
30453045

3046+
def update_organization_login_methods(
3047+
self,
3048+
*,
3049+
organization_id: Optional[str] = None,
3050+
login_password_enabled: Optional[bool] = None,
3051+
login_oauth2_enabled: Optional[bool] = None,
3052+
login_magic_code_enabled: Optional[bool] = None,
3053+
login_saml_enabled: Optional[bool] = None,
3054+
) -> Organization:
3055+
"""
3056+
Set your Organization's allowed login methods.
3057+
:param organization_id: ID of the Organization.
3058+
:param login_password_enabled: Defines whether login with a password is enabled for the Organization.
3059+
:param login_oauth2_enabled: Defines whether login through OAuth2 is enabled for the Organization.
3060+
:param login_magic_code_enabled: Defines whether login with an authentication code is enabled for the Organization.
3061+
:param login_saml_enabled: Defines whether login through SAML is enabled for the Organization.
3062+
:return: :class:`Organization <Organization>`
3063+
3064+
Usage:
3065+
::
3066+
3067+
result = api.update_organization_login_methods()
3068+
"""
3069+
3070+
param_organization_id = validate_path_param(
3071+
"organization_id", organization_id or self.client.default_organization_id
3072+
)
3073+
3074+
res = self._request(
3075+
"PATCH",
3076+
f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods",
3077+
params={
3078+
"login_magic_code_enabled": login_magic_code_enabled,
3079+
"login_oauth2_enabled": login_oauth2_enabled,
3080+
"login_password_enabled": login_password_enabled,
3081+
"login_saml_enabled": login_saml_enabled,
3082+
},
3083+
)
3084+
3085+
self._throw_on_error(res)
3086+
return unmarshal_Organization(res.json())
3087+
30463088
def get_organization_saml(
30473089
self,
30483090
*,

scaleway/scaleway/iam/v1alpha1/marshalling.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,30 @@ def unmarshal_Organization(data: Any) -> Organization:
15381538
else:
15391539
args["alias"] = None
15401540

1541+
field = data.get("login_password_enabled", None)
1542+
if field is not None:
1543+
args["login_password_enabled"] = field
1544+
else:
1545+
args["login_password_enabled"] = False
1546+
1547+
field = data.get("login_magic_code_enabled", None)
1548+
if field is not None:
1549+
args["login_magic_code_enabled"] = field
1550+
else:
1551+
args["login_magic_code_enabled"] = False
1552+
1553+
field = data.get("login_oauth2_enabled", None)
1554+
if field is not None:
1555+
args["login_oauth2_enabled"] = field
1556+
else:
1557+
args["login_oauth2_enabled"] = False
1558+
1559+
field = data.get("login_saml_enabled", None)
1560+
if field is not None:
1561+
args["login_saml_enabled"] = field
1562+
else:
1563+
args["login_saml_enabled"] = False
1564+
15411565
return Organization(**args)
15421566

15431567

scaleway/scaleway/iam/v1alpha1/types.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,26 @@ class Organization:
21042104
Alias of the Organization.
21052105
"""
21062106

2107+
login_password_enabled: bool
2108+
"""
2109+
Defines whether login with a password is enabled for the Organization.
2110+
"""
2111+
2112+
login_magic_code_enabled: bool
2113+
"""
2114+
Defines whether login with an authentication code is enabled for the Organization.
2115+
"""
2116+
2117+
login_oauth2_enabled: bool
2118+
"""
2119+
Defines whether login through OAuth2 is enabled for the Organization.
2120+
"""
2121+
2122+
login_saml_enabled: bool
2123+
"""
2124+
Defines whether login through SAML is enabled for the Organization.
2125+
"""
2126+
21072127

21082128
@dataclass
21092129
class OrganizationSecuritySettings:
@@ -2294,6 +2314,34 @@ class UpdateGroupRequest:
22942314
"""
22952315

22962316

2317+
@dataclass
2318+
class UpdateOrganizationLoginMethodsRequest:
2319+
organization_id: Optional[str] = None
2320+
"""
2321+
ID of the Organization.
2322+
"""
2323+
2324+
login_password_enabled: Optional[bool] = False
2325+
"""
2326+
Defines whether login with a password is enabled for the Organization.
2327+
"""
2328+
2329+
login_oauth2_enabled: Optional[bool] = False
2330+
"""
2331+
Defines whether login through OAuth2 is enabled for the Organization.
2332+
"""
2333+
2334+
login_magic_code_enabled: Optional[bool] = False
2335+
"""
2336+
Defines whether login with an authentication code is enabled for the Organization.
2337+
"""
2338+
2339+
login_saml_enabled: Optional[bool] = False
2340+
"""
2341+
Defines whether login through SAML is enabled for the Organization.
2342+
"""
2343+
2344+
22972345
@dataclass
22982346
class UpdateOrganizationSecuritySettingsRequest:
22992347
organization_id: Optional[str] = None

0 commit comments

Comments
 (0)