Skip to content
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
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/iam/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
from .types import UpdateAPIKeyRequest
from .types import UpdateApplicationRequest
from .types import UpdateGroupRequest
from .types import UpdateOrganizationLoginMethodsRequest
from .types import UpdateOrganizationSecuritySettingsRequest
from .types import UpdatePolicyRequest
from .types import UpdateSSHKeyRequest
Expand Down Expand Up @@ -260,6 +261,7 @@
"UpdateAPIKeyRequest",
"UpdateApplicationRequest",
"UpdateGroupRequest",
"UpdateOrganizationLoginMethodsRequest",
"UpdateOrganizationSecuritySettingsRequest",
"UpdatePolicyRequest",
"UpdateSSHKeyRequest",
Expand Down
42 changes: 42 additions & 0 deletions scaleway-async/scaleway_async/iam/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,48 @@ async def migrate_organization_guests(

self._throw_on_error(res)

async def update_organization_login_methods(
self,
*,
organization_id: Optional[str] = None,
login_password_enabled: Optional[bool] = None,
login_oauth2_enabled: Optional[bool] = None,
login_magic_code_enabled: Optional[bool] = None,
login_saml_enabled: Optional[bool] = None,
) -> Organization:
"""
Set your Organization's allowed login methods.
:param organization_id: ID of the Organization.
:param login_password_enabled: Defines whether login with a password is enabled for the Organization.
:param login_oauth2_enabled: Defines whether login through OAuth2 is enabled for the Organization.
:param login_magic_code_enabled: Defines whether login with an authentication code is enabled for the Organization.
:param login_saml_enabled: Defines whether login through SAML is enabled for the Organization.
:return: :class:`Organization <Organization>`

Usage:
::

result = await api.update_organization_login_methods()
"""

param_organization_id = validate_path_param(
"organization_id", organization_id or self.client.default_organization_id
)

res = self._request(
"PATCH",
f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods",
params={
"login_magic_code_enabled": login_magic_code_enabled,
"login_oauth2_enabled": login_oauth2_enabled,
"login_password_enabled": login_password_enabled,
"login_saml_enabled": login_saml_enabled,
},
)

self._throw_on_error(res)
return unmarshal_Organization(res.json())

async def get_organization_saml(
self,
*,
Expand Down
24 changes: 24 additions & 0 deletions scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,30 @@ def unmarshal_Organization(data: Any) -> Organization:
else:
args["alias"] = None

field = data.get("login_password_enabled", None)
if field is not None:
args["login_password_enabled"] = field
else:
args["login_password_enabled"] = False

field = data.get("login_magic_code_enabled", None)
if field is not None:
args["login_magic_code_enabled"] = field
else:
args["login_magic_code_enabled"] = False

field = data.get("login_oauth2_enabled", None)
if field is not None:
args["login_oauth2_enabled"] = field
else:
args["login_oauth2_enabled"] = False

field = data.get("login_saml_enabled", None)
if field is not None:
args["login_saml_enabled"] = field
else:
args["login_saml_enabled"] = False

return Organization(**args)


Expand Down
48 changes: 48 additions & 0 deletions scaleway-async/scaleway_async/iam/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,26 @@ class Organization:
Alias of the Organization.
"""

login_password_enabled: bool
"""
Defines whether login with a password is enabled for the Organization.
"""

login_magic_code_enabled: bool
"""
Defines whether login with an authentication code is enabled for the Organization.
"""

login_oauth2_enabled: bool
"""
Defines whether login through OAuth2 is enabled for the Organization.
"""

login_saml_enabled: bool
"""
Defines whether login through SAML is enabled for the Organization.
"""


@dataclass
class OrganizationSecuritySettings:
Expand Down Expand Up @@ -2294,6 +2314,34 @@ class UpdateGroupRequest:
"""


@dataclass
class UpdateOrganizationLoginMethodsRequest:
organization_id: Optional[str] = None
"""
ID of the Organization.
"""

login_password_enabled: Optional[bool] = False
"""
Defines whether login with a password is enabled for the Organization.
"""

login_oauth2_enabled: Optional[bool] = False
"""
Defines whether login through OAuth2 is enabled for the Organization.
"""

login_magic_code_enabled: Optional[bool] = False
"""
Defines whether login with an authentication code is enabled for the Organization.
"""

login_saml_enabled: Optional[bool] = False
"""
Defines whether login through SAML is enabled for the Organization.
"""


@dataclass
class UpdateOrganizationSecuritySettingsRequest:
organization_id: Optional[str] = None
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/iam/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
from .types import UpdateAPIKeyRequest
from .types import UpdateApplicationRequest
from .types import UpdateGroupRequest
from .types import UpdateOrganizationLoginMethodsRequest
from .types import UpdateOrganizationSecuritySettingsRequest
from .types import UpdatePolicyRequest
from .types import UpdateSSHKeyRequest
Expand Down Expand Up @@ -260,6 +261,7 @@
"UpdateAPIKeyRequest",
"UpdateApplicationRequest",
"UpdateGroupRequest",
"UpdateOrganizationLoginMethodsRequest",
"UpdateOrganizationSecuritySettingsRequest",
"UpdatePolicyRequest",
"UpdateSSHKeyRequest",
Expand Down
42 changes: 42 additions & 0 deletions scaleway/scaleway/iam/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,48 @@ def migrate_organization_guests(

self._throw_on_error(res)

def update_organization_login_methods(
self,
*,
organization_id: Optional[str] = None,
login_password_enabled: Optional[bool] = None,
login_oauth2_enabled: Optional[bool] = None,
login_magic_code_enabled: Optional[bool] = None,
login_saml_enabled: Optional[bool] = None,
) -> Organization:
"""
Set your Organization's allowed login methods.
:param organization_id: ID of the Organization.
:param login_password_enabled: Defines whether login with a password is enabled for the Organization.
:param login_oauth2_enabled: Defines whether login through OAuth2 is enabled for the Organization.
:param login_magic_code_enabled: Defines whether login with an authentication code is enabled for the Organization.
:param login_saml_enabled: Defines whether login through SAML is enabled for the Organization.
:return: :class:`Organization <Organization>`

Usage:
::

result = api.update_organization_login_methods()
"""

param_organization_id = validate_path_param(
"organization_id", organization_id or self.client.default_organization_id
)

res = self._request(
"PATCH",
f"/iam/v1alpha1/organizations/{param_organization_id}/login-methods",
params={
"login_magic_code_enabled": login_magic_code_enabled,
"login_oauth2_enabled": login_oauth2_enabled,
"login_password_enabled": login_password_enabled,
"login_saml_enabled": login_saml_enabled,
},
)

self._throw_on_error(res)
return unmarshal_Organization(res.json())

def get_organization_saml(
self,
*,
Expand Down
24 changes: 24 additions & 0 deletions scaleway/scaleway/iam/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,30 @@ def unmarshal_Organization(data: Any) -> Organization:
else:
args["alias"] = None

field = data.get("login_password_enabled", None)
if field is not None:
args["login_password_enabled"] = field
else:
args["login_password_enabled"] = False

field = data.get("login_magic_code_enabled", None)
if field is not None:
args["login_magic_code_enabled"] = field
else:
args["login_magic_code_enabled"] = False

field = data.get("login_oauth2_enabled", None)
if field is not None:
args["login_oauth2_enabled"] = field
else:
args["login_oauth2_enabled"] = False

field = data.get("login_saml_enabled", None)
if field is not None:
args["login_saml_enabled"] = field
else:
args["login_saml_enabled"] = False

return Organization(**args)


Expand Down
48 changes: 48 additions & 0 deletions scaleway/scaleway/iam/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,26 @@ class Organization:
Alias of the Organization.
"""

login_password_enabled: bool
"""
Defines whether login with a password is enabled for the Organization.
"""

login_magic_code_enabled: bool
"""
Defines whether login with an authentication code is enabled for the Organization.
"""

login_oauth2_enabled: bool
"""
Defines whether login through OAuth2 is enabled for the Organization.
"""

login_saml_enabled: bool
"""
Defines whether login through SAML is enabled for the Organization.
"""


@dataclass
class OrganizationSecuritySettings:
Expand Down Expand Up @@ -2294,6 +2314,34 @@ class UpdateGroupRequest:
"""


@dataclass
class UpdateOrganizationLoginMethodsRequest:
organization_id: Optional[str] = None
"""
ID of the Organization.
"""

login_password_enabled: Optional[bool] = False
"""
Defines whether login with a password is enabled for the Organization.
"""

login_oauth2_enabled: Optional[bool] = False
"""
Defines whether login through OAuth2 is enabled for the Organization.
"""

login_magic_code_enabled: Optional[bool] = False
"""
Defines whether login with an authentication code is enabled for the Organization.
"""

login_saml_enabled: Optional[bool] = False
"""
Defines whether login through SAML is enabled for the Organization.
"""


@dataclass
class UpdateOrganizationSecuritySettingsRequest:
organization_id: Optional[str] = None
Expand Down