Skip to content

Commit 37a3f6c

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

File tree

14 files changed

+346
-6
lines changed

14 files changed

+346
-6
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .types import AuthenticationEventMethod
66
from .types import AuthenticationEventOrigin
77
from .types import AuthenticationEventResult
8+
from .types import ExportJobStatusCode
89
from .types import ListAuthenticationEventsRequestOrderBy
910
from .types import ListCombinedEventsRequestOrderBy
1011
from .types import ListEventsRequestOrderBy
@@ -39,6 +40,7 @@
3940
from .types import Event
4041
from .types import SystemEvent
4142
from .types import ExportJobS3
43+
from .types import ExportJobStatus
4244
from .types import ProductService
4345
from .types import ListCombinedEventsResponseCombinedEvent
4446
from .types import ExportJob
@@ -63,6 +65,7 @@
6365
"AuthenticationEventMethod",
6466
"AuthenticationEventOrigin",
6567
"AuthenticationEventResult",
68+
"ExportJobStatusCode",
6669
"ListAuthenticationEventsRequestOrderBy",
6770
"ListCombinedEventsRequestOrderBy",
6871
"ListEventsRequestOrderBy",
@@ -97,6 +100,7 @@
97100
"Event",
98101
"SystemEvent",
99102
"ExportJobS3",
103+
"ExportJobStatus",
100104
"ProductService",
101105
"ListCombinedEventsResponseCombinedEvent",
102106
"ExportJob",

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
AuthenticationEventOrigin,
1717
AuthenticationEventResult,
1818
ExportJobS3,
19+
ExportJobStatus,
1920
ExportJob,
2021
AccountOrganizationInfo,
2122
AccountProjectInfo,
@@ -94,6 +95,29 @@ def unmarshal_ExportJobS3(data: Any) -> ExportJobS3:
9495
return ExportJobS3(**args)
9596

9697

98+
def unmarshal_ExportJobStatus(data: Any) -> ExportJobStatus:
99+
if not isinstance(data, dict):
100+
raise TypeError(
101+
"Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary."
102+
)
103+
104+
args: dict[str, Any] = {}
105+
106+
field = data.get("code", None)
107+
if field is not None:
108+
args["code"] = field
109+
else:
110+
args["code"] = None
111+
112+
field = data.get("message", None)
113+
if field is not None:
114+
args["message"] = field
115+
else:
116+
args["message"] = None
117+
118+
return ExportJobStatus(**args)
119+
120+
97121
def unmarshal_ExportJob(data: Any) -> ExportJob:
98122
if not isinstance(data, dict):
99123
raise TypeError(
@@ -146,6 +170,12 @@ def unmarshal_ExportJob(data: Any) -> ExportJob:
146170
else:
147171
args["last_run_at"] = None
148172

173+
field = data.get("last_status", None)
174+
if field is not None:
175+
args["last_status"] = unmarshal_ExportJobStatus(field)
176+
else:
177+
args["last_status"] = None
178+
149179
return ExportJob(**args)
150180

151181

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ def __str__(self) -> str:
6565
return str(self.value)
6666

6767

68+
class ExportJobStatusCode(str, Enum, metaclass=StrEnumMeta):
69+
UNKNOWN_CODE = "unknown_code"
70+
SUCCESS = "success"
71+
FAILURE = "failure"
72+
73+
def __str__(self) -> str:
74+
return str(self.value)
75+
76+
6877
class ListAuthenticationEventsRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
6978
RECORDED_AT_DESC = "recorded_at_desc"
7079
RECORDED_AT_ASC = "recorded_at_asc"
@@ -511,6 +520,12 @@ class ExportJobS3:
511520
project_id: Optional[str] = None
512521

513522

523+
@dataclass
524+
class ExportJobStatus:
525+
code: ExportJobStatusCode
526+
message: Optional[str] = None
527+
528+
514529
@dataclass
515530
class ProductService:
516531
name: str
@@ -540,12 +555,12 @@ class ExportJob:
540555

541556
name: str
542557
"""
543-
Name of the export.
558+
Name of the export job.
544559
"""
545560

546561
tags: dict[str, str]
547562
"""
548-
Tags of the export.
563+
Tags of the export job.
549564
"""
550565

551566
created_at: Optional[datetime] = None
@@ -555,7 +570,12 @@ class ExportJob:
555570

556571
last_run_at: Optional[datetime] = None
557572
"""
558-
Last export date.
573+
Last run of export job.
574+
"""
575+
576+
last_status: Optional[ExportJobStatus] = None
577+
"""
578+
Status of last export job.
559579
"""
560580

561581
s3: Optional[ExportJobS3] = None

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/audit_trail/v1alpha1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .types import AuthenticationEventMethod
66
from .types import AuthenticationEventOrigin
77
from .types import AuthenticationEventResult
8+
from .types import ExportJobStatusCode
89
from .types import ListAuthenticationEventsRequestOrderBy
910
from .types import ListCombinedEventsRequestOrderBy
1011
from .types import ListEventsRequestOrderBy
@@ -39,6 +40,7 @@
3940
from .types import Event
4041
from .types import SystemEvent
4142
from .types import ExportJobS3
43+
from .types import ExportJobStatus
4244
from .types import ProductService
4345
from .types import ListCombinedEventsResponseCombinedEvent
4446
from .types import ExportJob
@@ -63,6 +65,7 @@
6365
"AuthenticationEventMethod",
6466
"AuthenticationEventOrigin",
6567
"AuthenticationEventResult",
68+
"ExportJobStatusCode",
6669
"ListAuthenticationEventsRequestOrderBy",
6770
"ListCombinedEventsRequestOrderBy",
6871
"ListEventsRequestOrderBy",
@@ -97,6 +100,7 @@
97100
"Event",
98101
"SystemEvent",
99102
"ExportJobS3",
103+
"ExportJobStatus",
100104
"ProductService",
101105
"ListCombinedEventsResponseCombinedEvent",
102106
"ExportJob",

scaleway/scaleway/audit_trail/v1alpha1/marshalling.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
AuthenticationEventOrigin,
1717
AuthenticationEventResult,
1818
ExportJobS3,
19+
ExportJobStatus,
1920
ExportJob,
2021
AccountOrganizationInfo,
2122
AccountProjectInfo,
@@ -94,6 +95,29 @@ def unmarshal_ExportJobS3(data: Any) -> ExportJobS3:
9495
return ExportJobS3(**args)
9596

9697

98+
def unmarshal_ExportJobStatus(data: Any) -> ExportJobStatus:
99+
if not isinstance(data, dict):
100+
raise TypeError(
101+
"Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary."
102+
)
103+
104+
args: dict[str, Any] = {}
105+
106+
field = data.get("code", None)
107+
if field is not None:
108+
args["code"] = field
109+
else:
110+
args["code"] = None
111+
112+
field = data.get("message", None)
113+
if field is not None:
114+
args["message"] = field
115+
else:
116+
args["message"] = None
117+
118+
return ExportJobStatus(**args)
119+
120+
97121
def unmarshal_ExportJob(data: Any) -> ExportJob:
98122
if not isinstance(data, dict):
99123
raise TypeError(
@@ -146,6 +170,12 @@ def unmarshal_ExportJob(data: Any) -> ExportJob:
146170
else:
147171
args["last_run_at"] = None
148172

173+
field = data.get("last_status", None)
174+
if field is not None:
175+
args["last_status"] = unmarshal_ExportJobStatus(field)
176+
else:
177+
args["last_status"] = None
178+
149179
return ExportJob(**args)
150180

151181

0 commit comments

Comments
 (0)