Skip to content

Commit 3e0f2f4

Browse files
committed
feat: update generated APIs
1 parent 9eb37ad commit 3e0f2f4

File tree

24 files changed

+116
-384
lines changed

24 files changed

+116
-384
lines changed

scaleway-async/scaleway_async/cockpit/v1/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@
5656
from .types import RegionalApiDeleteTokenRequest
5757
from .types import RegionalApiDisableAlertManagerRequest
5858
from .types import RegionalApiDisableAlertRulesRequest
59-
from .types import RegionalApiDisableManagedAlertsRequest
6059
from .types import RegionalApiEnableAlertManagerRequest
6160
from .types import RegionalApiEnableAlertRulesRequest
62-
from .types import RegionalApiEnableManagedAlertsRequest
6361
from .types import RegionalApiGetAlertManagerRequest
6462
from .types import RegionalApiGetConfigRequest
6563
from .types import RegionalApiGetDataSourceRequest
@@ -134,10 +132,8 @@
134132
"RegionalApiDeleteTokenRequest",
135133
"RegionalApiDisableAlertManagerRequest",
136134
"RegionalApiDisableAlertRulesRequest",
137-
"RegionalApiDisableManagedAlertsRequest",
138135
"RegionalApiEnableAlertManagerRequest",
139136
"RegionalApiEnableAlertRulesRequest",
140-
"RegionalApiEnableManagedAlertsRequest",
141137
"RegionalApiGetAlertManagerRequest",
142138
"RegionalApiGetConfigRequest",
143139
"RegionalApiGetDataSourceRequest",

scaleway-async/scaleway_async/cockpit/v1/api.py

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@
5252
RegionalApiDeleteContactPointRequest,
5353
RegionalApiDisableAlertManagerRequest,
5454
RegionalApiDisableAlertRulesRequest,
55-
RegionalApiDisableManagedAlertsRequest,
5655
RegionalApiEnableAlertManagerRequest,
5756
RegionalApiEnableAlertRulesRequest,
58-
RegionalApiEnableManagedAlertsRequest,
5957
RegionalApiTriggerTestAlertRequest,
6058
RegionalApiUpdateContactPointRequest,
6159
RegionalApiUpdateDataSourceRequest,
@@ -93,10 +91,8 @@
9391
marshal_RegionalApiDeleteContactPointRequest,
9492
marshal_RegionalApiDisableAlertManagerRequest,
9593
marshal_RegionalApiDisableAlertRulesRequest,
96-
marshal_RegionalApiDisableManagedAlertsRequest,
9794
marshal_RegionalApiEnableAlertManagerRequest,
9895
marshal_RegionalApiEnableAlertRulesRequest,
99-
marshal_RegionalApiEnableManagedAlertsRequest,
10096
marshal_RegionalApiTriggerTestAlertRequest,
10197
marshal_RegionalApiUpdateContactPointRequest,
10298
marshal_RegionalApiUpdateDataSourceRequest,
@@ -1238,7 +1234,7 @@ async def get_rules_count(
12381234
project_id: Optional[str] = None,
12391235
) -> GetRulesCountResponse:
12401236
"""
1241-
Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules.
1237+
Get the number of enabled rules Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules.
12421238
:param region: Region to target. If none is passed will use default region from the config.
12431239
:param project_id: ID of the Project to retrieve the rule count for.
12441240
:return: :class:`GetRulesCountResponse <GetRulesCountResponse>`
@@ -1515,82 +1511,6 @@ async def list_alerts(
15151511
self._throw_on_error(res)
15161512
return unmarshal_ListAlertsResponse(res.json())
15171513

1518-
async def enable_managed_alerts(
1519-
self,
1520-
*,
1521-
region: Optional[ScwRegion] = None,
1522-
project_id: Optional[str] = None,
1523-
) -> AlertManager:
1524-
"""
1525-
Enable managed alerts.
1526-
Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default.
1527-
:param region: Region to target. If none is passed will use default region from the config.
1528-
:param project_id: ID of the Project.
1529-
:return: :class:`AlertManager <AlertManager>`
1530-
1531-
Usage:
1532-
::
1533-
1534-
result = await api.enable_managed_alerts()
1535-
"""
1536-
1537-
param_region = validate_path_param(
1538-
"region", region or self.client.default_region
1539-
)
1540-
1541-
res = self._request(
1542-
"POST",
1543-
f"/cockpit/v1/regions/{param_region}/alert-manager/managed-alerts/enable",
1544-
body=marshal_RegionalApiEnableManagedAlertsRequest(
1545-
RegionalApiEnableManagedAlertsRequest(
1546-
region=region,
1547-
project_id=project_id,
1548-
),
1549-
self.client,
1550-
),
1551-
)
1552-
1553-
self._throw_on_error(res)
1554-
return unmarshal_AlertManager(res.json())
1555-
1556-
async def disable_managed_alerts(
1557-
self,
1558-
*,
1559-
region: Optional[ScwRegion] = None,
1560-
project_id: Optional[str] = None,
1561-
) -> AlertManager:
1562-
"""
1563-
Disable managed alerts.
1564-
Disable the sending of managed alerts for the specified Project.
1565-
:param region: Region to target. If none is passed will use default region from the config.
1566-
:param project_id: ID of the Project.
1567-
:return: :class:`AlertManager <AlertManager>`
1568-
1569-
Usage:
1570-
::
1571-
1572-
result = await api.disable_managed_alerts()
1573-
"""
1574-
1575-
param_region = validate_path_param(
1576-
"region", region or self.client.default_region
1577-
)
1578-
1579-
res = self._request(
1580-
"POST",
1581-
f"/cockpit/v1/regions/{param_region}/alert-manager/managed-alerts/disable",
1582-
body=marshal_RegionalApiDisableManagedAlertsRequest(
1583-
RegionalApiDisableManagedAlertsRequest(
1584-
region=region,
1585-
project_id=project_id,
1586-
),
1587-
self.client,
1588-
),
1589-
)
1590-
1591-
self._throw_on_error(res)
1592-
return unmarshal_AlertManager(res.json())
1593-
15941514
async def enable_alert_rules(
15951515
self,
15961516
*,

scaleway-async/scaleway_async/cockpit/v1/marshalling.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@
5454
RegionalApiDeleteContactPointRequest,
5555
RegionalApiDisableAlertManagerRequest,
5656
RegionalApiDisableAlertRulesRequest,
57-
RegionalApiDisableManagedAlertsRequest,
5857
RegionalApiEnableAlertManagerRequest,
5958
RegionalApiEnableAlertRulesRequest,
60-
RegionalApiEnableManagedAlertsRequest,
6159
RegionalApiTriggerTestAlertRequest,
6260
RegionalApiUpdateContactPointRequest,
6361
RegionalApiUpdateDataSourceRequest,
@@ -1204,20 +1202,6 @@ def marshal_RegionalApiDisableAlertRulesRequest(
12041202
return output
12051203

12061204

1207-
def marshal_RegionalApiDisableManagedAlertsRequest(
1208-
request: RegionalApiDisableManagedAlertsRequest,
1209-
defaults: ProfileDefaults,
1210-
) -> dict[str, Any]:
1211-
output: dict[str, Any] = {}
1212-
1213-
if request.project_id is not None:
1214-
output["project_id"] = request.project_id
1215-
else:
1216-
output["project_id"] = defaults.default_project_id
1217-
1218-
return output
1219-
1220-
12211205
def marshal_RegionalApiEnableAlertManagerRequest(
12221206
request: RegionalApiEnableAlertManagerRequest,
12231207
defaults: ProfileDefaults,
@@ -1249,20 +1233,6 @@ def marshal_RegionalApiEnableAlertRulesRequest(
12491233
return output
12501234

12511235

1252-
def marshal_RegionalApiEnableManagedAlertsRequest(
1253-
request: RegionalApiEnableManagedAlertsRequest,
1254-
defaults: ProfileDefaults,
1255-
) -> dict[str, Any]:
1256-
output: dict[str, Any] = {}
1257-
1258-
if request.project_id is not None:
1259-
output["project_id"] = request.project_id
1260-
else:
1261-
output["project_id"] = defaults.default_project_id
1262-
1263-
return output
1264-
1265-
12661236
def marshal_RegionalApiTriggerTestAlertRequest(
12671237
request: RegionalApiTriggerTestAlertRequest,
12681238
defaults: ProfileDefaults,

scaleway-async/scaleway_async/cockpit/v1/types.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,23 +1152,6 @@ class RegionalApiDisableAlertRulesRequest:
11521152
"""
11531153

11541154

1155-
@dataclass
1156-
class RegionalApiDisableManagedAlertsRequest:
1157-
"""
1158-
Disable the sending of managed alerts.
1159-
"""
1160-
1161-
region: Optional[ScwRegion] = None
1162-
"""
1163-
Region to target. If none is passed will use default region from the config.
1164-
"""
1165-
1166-
project_id: Optional[str] = None
1167-
"""
1168-
ID of the Project.
1169-
"""
1170-
1171-
11721155
@dataclass
11731156
class RegionalApiEnableAlertManagerRequest:
11741157
"""
@@ -1204,23 +1187,6 @@ class RegionalApiEnableAlertRulesRequest:
12041187
"""
12051188

12061189

1207-
@dataclass
1208-
class RegionalApiEnableManagedAlertsRequest:
1209-
"""
1210-
Enable the sending of managed alerts.
1211-
"""
1212-
1213-
region: Optional[ScwRegion] = None
1214-
"""
1215-
Region to target. If none is passed will use default region from the config.
1216-
"""
1217-
1218-
project_id: Optional[str] = None
1219-
"""
1220-
ID of the Project.
1221-
"""
1222-
1223-
12241190
@dataclass
12251191
class RegionalApiGetAlertManagerRequest:
12261192
"""

scaleway-async/scaleway_async/edge_services/v1beta1/marshalling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ def unmarshal_DNSStage(data: Any) -> DNSStage:
307307
else:
308308
args["id"] = None
309309

310+
field = data.get("default_fqdn", None)
311+
if field is not None:
312+
args["default_fqdn"] = field
313+
else:
314+
args["default_fqdn"] = None
315+
310316
field = data.get("fqdns", None)
311317
if field is not None:
312318
args["fqdns"] = field

scaleway-async/scaleway_async/edge_services/v1beta1/types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,14 @@ class DNSStage:
441441
ID of the DNS stage.
442442
"""
443443

444+
default_fqdn: str
445+
"""
446+
Default Fully Qualified Domain Name attached to the stage.
447+
"""
448+
444449
fqdns: list[str]
445450
"""
446-
List of Fully Qualified Domain Names attached to the stage.
451+
List of additional (custom) Fully Qualified Domain Names attached to the stage.
447452
"""
448453

449454
type_: DNSStageType

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
from .types import ListUsersResponse
111111
from .types import LockUserRequest
112112
from .types import MFAOTP
113-
from .types import MigrateOrganizationGuestsRequest
114113
from .types import Organization
115114
from .types import OrganizationSecuritySettings
116115
from .types import RemoveGroupMemberRequest
@@ -247,7 +246,6 @@
247246
"ListUsersResponse",
248247
"LockUserRequest",
249248
"MFAOTP",
250-
"MigrateOrganizationGuestsRequest",
251249
"Organization",
252250
"OrganizationSecuritySettings",
253251
"RemoveGroupMemberRequest",

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

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
UpdateAPIKeyRequest,
8282
UpdateApplicationRequest,
8383
UpdateGroupRequest,
84+
UpdateOrganizationLoginMethodsRequest,
8485
UpdateOrganizationSecuritySettingsRequest,
8586
UpdatePolicyRequest,
8687
UpdateSSHKeyRequest,
@@ -144,6 +145,7 @@
144145
marshal_UpdateAPIKeyRequest,
145146
marshal_UpdateApplicationRequest,
146147
marshal_UpdateGroupRequest,
148+
marshal_UpdateOrganizationLoginMethodsRequest,
147149
marshal_UpdateOrganizationSecuritySettingsRequest,
148150
marshal_UpdatePolicyRequest,
149151
marshal_UpdateSSHKeyRequest,
@@ -3017,32 +3019,6 @@ async def get_organization(
30173019
self._throw_on_error(res)
30183020
return unmarshal_Organization(res.json())
30193021

3020-
async def migrate_organization_guests(
3021-
self,
3022-
*,
3023-
organization_id: Optional[str] = None,
3024-
) -> None:
3025-
"""
3026-
Migrate the organization's guests to IAM members.
3027-
:param organization_id: ID of the Organization.
3028-
3029-
Usage:
3030-
::
3031-
3032-
result = await api.migrate_organization_guests()
3033-
"""
3034-
3035-
param_organization_id = validate_path_param(
3036-
"organization_id", organization_id or self.client.default_organization_id
3037-
)
3038-
3039-
res = self._request(
3040-
"POST",
3041-
f"/iam/v1alpha1/organizations/{param_organization_id}/migrate-guests",
3042-
)
3043-
3044-
self._throw_on_error(res)
3045-
30463022
async def update_organization_login_methods(
30473023
self,
30483024
*,
@@ -3074,12 +3050,16 @@ async def update_organization_login_methods(
30743050
res = self._request(
30753051
"PATCH",
30763052
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-
},
3053+
body=marshal_UpdateOrganizationLoginMethodsRequest(
3054+
UpdateOrganizationLoginMethodsRequest(
3055+
organization_id=organization_id,
3056+
login_password_enabled=login_password_enabled,
3057+
login_oauth2_enabled=login_oauth2_enabled,
3058+
login_magic_code_enabled=login_magic_code_enabled,
3059+
login_saml_enabled=login_saml_enabled,
3060+
),
3061+
self.client,
3062+
),
30833063
)
30843064

30853065
self._throw_on_error(res)

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
UpdateAPIKeyRequest,
8282
UpdateApplicationRequest,
8383
UpdateGroupRequest,
84+
UpdateOrganizationLoginMethodsRequest,
8485
UpdateOrganizationSecuritySettingsRequest,
8586
UpdatePolicyRequest,
8687
UpdateSSHKeyRequest,
@@ -2147,6 +2148,27 @@ def marshal_UpdateGroupRequest(
21472148
return output
21482149

21492150

2151+
def marshal_UpdateOrganizationLoginMethodsRequest(
2152+
request: UpdateOrganizationLoginMethodsRequest,
2153+
defaults: ProfileDefaults,
2154+
) -> dict[str, Any]:
2155+
output: dict[str, Any] = {}
2156+
2157+
if request.login_password_enabled is not None:
2158+
output["login_password_enabled"] = request.login_password_enabled
2159+
2160+
if request.login_oauth2_enabled is not None:
2161+
output["login_oauth2_enabled"] = request.login_oauth2_enabled
2162+
2163+
if request.login_magic_code_enabled is not None:
2164+
output["login_magic_code_enabled"] = request.login_magic_code_enabled
2165+
2166+
if request.login_saml_enabled is not None:
2167+
output["login_saml_enabled"] = request.login_saml_enabled
2168+
2169+
return output
2170+
2171+
21502172
def marshal_UpdateOrganizationSecuritySettingsRequest(
21512173
request: UpdateOrganizationSecuritySettingsRequest,
21522174
defaults: ProfileDefaults,

0 commit comments

Comments
 (0)