Skip to content

Commit 7fce461

Browse files
committed
feat: update generated APIs
1 parent f8bee0f commit 7fce461

File tree

8 files changed

+264
-62
lines changed

8 files changed

+264
-62
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .types import SecretManagerSecretInfo
1818
from .types import SecretManagerSecretVersionInfo
1919
from .types import EventPrincipal
20+
from .types import EventSystem
2021
from .types import Resource
2122
from .types import ProductService
2223
from .types import Event
@@ -45,6 +46,7 @@
4546
"SecretManagerSecretInfo",
4647
"SecretManagerSecretVersionInfo",
4748
"EventPrincipal",
49+
"EventSystem",
4850
"Resource",
4951
"ProductService",
5052
"Event",

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,62 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33

44
from datetime import datetime
5-
from typing import Optional
5+
from typing import Any, Awaitable, Dict, List, Optional, Union
66

77
from scaleway_core.api import API
88
from scaleway_core.bridge import (
9+
Money,
910
Region as ScwRegion,
11+
ScwFile,
12+
ServiceInfo,
13+
TimeSeries,
14+
TimeSeriesPoint,
15+
Zone as ScwZone,
16+
marshal_Money,
17+
unmarshal_Money,
18+
marshal_ScwFile,
19+
unmarshal_ScwFile,
20+
unmarshal_ServiceInfo,
21+
marshal_TimeSeries,
22+
unmarshal_TimeSeries,
1023
)
1124
from scaleway_core.utils import (
25+
OneOfPossibility,
26+
WaitForOptions,
27+
project_or_organization_id,
28+
random_name,
29+
resolve_one_of,
1230
validate_path_param,
31+
fetch_all_pages_async,
32+
wait_for_resource_async,
1333
)
1434
from .types import (
1535
ListEventsRequestOrderBy,
1636
ResourceType,
37+
AccountOrganizationInfo,
38+
AccountProjectInfo,
39+
AccountUserInfo,
40+
AppleSiliconServerInfo,
41+
BaremetalServerInfo,
42+
BaremetalSettingInfo,
43+
Event,
44+
EventPrincipal,
45+
EventSystem,
46+
InstanceServerInfo,
47+
KeyManagerKeyInfo,
48+
KubernetesACLInfo,
49+
KubernetesClusterInfo,
50+
KubernetesNodeInfo,
51+
KubernetesPoolInfo,
52+
ListEventsRequest,
1753
ListEventsResponse,
54+
ListProductsRequest,
1855
ListProductsResponse,
56+
Product,
57+
ProductService,
58+
Resource,
59+
SecretManagerSecretInfo,
60+
SecretManagerSecretVersionInfo,
1961
)
2062
from .marshalling import (
2163
unmarshal_ListEventsResponse,

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

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
# This file was automatically generated. DO NOT EDIT.
22
# If you have any remark or suggestion do not hesitate to open an issue.
33

4-
from typing import Any, Dict
4+
from decimal import Decimal
5+
from datetime import datetime
6+
from typing import Any, Dict, List, Optional
57
from dateutil import parser
68

9+
from scaleway_core.profile import ProfileDefaults
10+
from scaleway_core.bridge import (
11+
Money,
12+
Region as ScwRegion,
13+
ScwFile,
14+
ServiceInfo,
15+
TimeSeries,
16+
TimeSeriesPoint,
17+
Zone as ScwZone,
18+
unmarshal_Money,
19+
marshal_Money,
20+
marshal_ScwFile,
21+
marshal_ServiceInfo,
22+
marshal_TimeSeries,
23+
unmarshal_TimeSeries,
24+
)
25+
from scaleway_core.utils import (
26+
OneOfPossibility,
27+
resolve_one_of,
28+
)
729
from .types import (
30+
ListEventsRequestOrderBy,
31+
ResourceType,
832
AccountOrganizationInfo,
933
AccountProjectInfo,
1034
AccountUserInfo,
@@ -20,6 +44,7 @@
2044
SecretManagerSecretInfo,
2145
SecretManagerSecretVersionInfo,
2246
EventPrincipal,
47+
EventSystem,
2348
Resource,
2449
Event,
2550
ListEventsResponse,
@@ -268,6 +293,21 @@ def unmarshal_EventPrincipal(data: Any) -> EventPrincipal:
268293
return EventPrincipal(**args)
269294

270295

296+
def unmarshal_EventSystem(data: Any) -> EventSystem:
297+
if not isinstance(data, dict):
298+
raise TypeError(
299+
"Unmarshalling the type 'EventSystem' failed as data isn't a dictionary."
300+
)
301+
302+
args: Dict[str, Any] = {}
303+
304+
field = data.get("name", None)
305+
if field is not None:
306+
args["name"] = field
307+
308+
return EventSystem(**args)
309+
310+
271311
def unmarshal_Resource(data: Any) -> Resource:
272312
if not isinstance(data, dict):
273313
raise TypeError(
@@ -445,6 +485,14 @@ def unmarshal_Event(data: Any) -> Event:
445485
if field is not None:
446486
args["product_name"] = field
447487

488+
field = data.get("service_name", None)
489+
if field is not None:
490+
args["service_name"] = field
491+
492+
field = data.get("method_name", None)
493+
if field is not None:
494+
args["method_name"] = field
495+
448496
field = data.get("recorded_at", None)
449497
if field is not None:
450498
args["recorded_at"] = (
@@ -459,26 +507,6 @@ def unmarshal_Event(data: Any) -> Event:
459507
else:
460508
args["principal"] = None
461509

462-
field = data.get("project_id", None)
463-
if field is not None:
464-
args["project_id"] = field
465-
else:
466-
args["project_id"] = None
467-
468-
field = data.get("user_agent", None)
469-
if field is not None:
470-
args["user_agent"] = field
471-
else:
472-
args["user_agent"] = None
473-
474-
field = data.get("service_name", None)
475-
if field is not None:
476-
args["service_name"] = field
477-
478-
field = data.get("method_name", None)
479-
if field is not None:
480-
args["method_name"] = field
481-
482510
field = data.get("resources", None)
483511
if field is not None:
484512
args["resources"] = (
@@ -493,6 +521,24 @@ def unmarshal_Event(data: Any) -> Event:
493521
if field is not None:
494522
args["status_code"] = field
495523

524+
field = data.get("system", None)
525+
if field is not None:
526+
args["system"] = unmarshal_EventSystem(field)
527+
else:
528+
args["system"] = None
529+
530+
field = data.get("project_id", None)
531+
if field is not None:
532+
args["project_id"] = field
533+
else:
534+
args["project_id"] = None
535+
536+
field = data.get("user_agent", None)
537+
if field is not None:
538+
args["user_agent"] = field
539+
else:
540+
args["user_agent"] = None
541+
496542
field = data.get("request_body", None)
497543
if field is not None:
498544
args["request_body"] = field

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

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
from __future__ import annotations
44

55
from dataclasses import dataclass
6+
from decimal import Decimal
67
from datetime import datetime
78
from enum import Enum
89
from typing import Any, Dict, List, Optional
910

1011
from scaleway_core.bridge import (
12+
Money,
1113
Region as ScwRegion,
14+
ScwFile,
15+
ServiceInfo,
16+
TimeSeries,
17+
TimeSeriesPoint,
18+
Zone as ScwZone,
1219
)
1320
from scaleway_core.utils import (
1421
StrEnumMeta,
@@ -141,6 +148,11 @@ class EventPrincipal:
141148
id: str
142149

143150

151+
@dataclass
152+
class EventSystem:
153+
name: str
154+
155+
144156
@dataclass
145157
class Resource:
146158
id: str
@@ -224,14 +236,14 @@ class Event:
224236
Product name of the resource attached to the event.
225237
"""
226238

227-
recorded_at: Optional[datetime]
239+
service_name: str
228240
"""
229-
Timestamp of the event.
241+
API name called to trigger the event.
230242
"""
231243

232-
principal: Optional[EventPrincipal]
244+
recorded_at: Optional[datetime]
233245
"""
234-
User or IAM application at the origin of the event.
246+
Timestamp of the event.
235247
"""
236248

237249
project_id: Optional[str]
@@ -244,11 +256,6 @@ class Event:
244256
User Agent at the origin of the event.
245257
"""
246258

247-
service_name: str
248-
"""
249-
API name called to trigger the event.
250-
"""
251-
252259
method_name: str
253260
"""
254261
API method called to trigger the event.
@@ -274,6 +281,10 @@ class Event:
274281
Request at the origin of the event.
275282
"""
276283

284+
principal: Optional[EventPrincipal]
285+
286+
system: Optional[EventSystem]
287+
277288

278289
@dataclass
279290
class Product:

scaleway/scaleway/audit_trail/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .types import SecretManagerSecretInfo
1818
from .types import SecretManagerSecretVersionInfo
1919
from .types import EventPrincipal
20+
from .types import EventSystem
2021
from .types import Resource
2122
from .types import ProductService
2223
from .types import Event
@@ -45,6 +46,7 @@
4546
"SecretManagerSecretInfo",
4647
"SecretManagerSecretVersionInfo",
4748
"EventPrincipal",
49+
"EventSystem",
4850
"Resource",
4951
"ProductService",
5052
"Event",

scaleway/scaleway/audit_trail/v1alpha1/api.py

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,62 @@
22
# If you have any remark or suggestion do not hesitate to open an issue.
33

44
from datetime import datetime
5-
from typing import Optional
5+
from typing import Any, Awaitable, Dict, List, Optional, Union
66

77
from scaleway_core.api import API
88
from scaleway_core.bridge import (
9+
Money,
910
Region as ScwRegion,
11+
ScwFile,
12+
ServiceInfo,
13+
TimeSeries,
14+
TimeSeriesPoint,
15+
Zone as ScwZone,
16+
marshal_Money,
17+
unmarshal_Money,
18+
marshal_ScwFile,
19+
unmarshal_ScwFile,
20+
unmarshal_ServiceInfo,
21+
marshal_TimeSeries,
22+
unmarshal_TimeSeries,
1023
)
1124
from scaleway_core.utils import (
25+
OneOfPossibility,
26+
WaitForOptions,
27+
project_or_organization_id,
28+
random_name,
29+
resolve_one_of,
1230
validate_path_param,
31+
fetch_all_pages,
32+
wait_for_resource,
1333
)
1434
from .types import (
1535
ListEventsRequestOrderBy,
1636
ResourceType,
37+
AccountOrganizationInfo,
38+
AccountProjectInfo,
39+
AccountUserInfo,
40+
AppleSiliconServerInfo,
41+
BaremetalServerInfo,
42+
BaremetalSettingInfo,
43+
Event,
44+
EventPrincipal,
45+
EventSystem,
46+
InstanceServerInfo,
47+
KeyManagerKeyInfo,
48+
KubernetesACLInfo,
49+
KubernetesClusterInfo,
50+
KubernetesNodeInfo,
51+
KubernetesPoolInfo,
52+
ListEventsRequest,
1753
ListEventsResponse,
54+
ListProductsRequest,
1855
ListProductsResponse,
56+
Product,
57+
ProductService,
58+
Resource,
59+
SecretManagerSecretInfo,
60+
SecretManagerSecretVersionInfo,
1961
)
2062
from .marshalling import (
2163
unmarshal_ListEventsResponse,

0 commit comments

Comments
 (0)