Skip to content

Commit 8c2f969

Browse files
authored
Merge branch 'main' into v1.5511.0
2 parents bbaed72 + e6ad3dc commit 8c2f969

File tree

10 files changed

+241
-237
lines changed

10 files changed

+241
-237
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
from .types import ScalewayS3BackendConfig
2323
from .types import PipelineError
2424
from .types import TLSSecret
25-
from .types import CheckPEMChainRequestSecretChain
2625
from .types import BackendStage
2726
from .types import CacheStage
2827
from .types import DNSStage
2928
from .types import Pipeline
29+
from .types import TLSStage
30+
from .types import CheckPEMChainRequestSecretChain
3031
from .types import PlanDetails
3132
from .types import PurgeRequest
32-
from .types import TLSStage
3333
from .types import TLSSecretsConfig
3434
from .types import CheckDomainRequest
3535
from .types import CheckDomainResponse
@@ -101,14 +101,14 @@
101101
"ScalewayS3BackendConfig",
102102
"PipelineError",
103103
"TLSSecret",
104-
"CheckPEMChainRequestSecretChain",
105104
"BackendStage",
106105
"CacheStage",
107106
"DNSStage",
108107
"Pipeline",
108+
"TLSStage",
109+
"CheckPEMChainRequestSecretChain",
109110
"PlanDetails",
110111
"PurgeRequest",
111-
"TLSStage",
112112
"TLSSecretsConfig",
113113
"CheckDomainRequest",
114114
"CheckDomainResponse",

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
unmarshal_CacheStage,
6767
unmarshal_DNSStage,
6868
unmarshal_Pipeline,
69-
unmarshal_PurgeRequest,
7069
unmarshal_TLSStage,
70+
unmarshal_PurgeRequest,
7171
unmarshal_CheckDomainResponse,
7272
unmarshal_CheckLbOriginResponse,
7373
unmarshal_CheckPEMChainResponse,
@@ -1674,12 +1674,13 @@ async def get_current_plan(
16741674
result = await api.get_current_plan()
16751675
"""
16761676

1677+
param_project_id = validate_path_param(
1678+
"project_id", project_id or self.client.default_project_id
1679+
)
1680+
16771681
res = self._request(
16781682
"GET",
1679-
"/edge-services/v1alpha1/current-plan",
1680-
params={
1681-
"project_id": project_id or self.client.default_project_id,
1682-
},
1683+
f"/edge-services/v1alpha1/current-plan/{param_project_id}",
16831684
)
16841685

16851686
self._throw_on_error(res)
@@ -1699,12 +1700,13 @@ async def delete_current_plan(
16991700
result = await api.delete_current_plan()
17001701
"""
17011702

1703+
param_project_id = validate_path_param(
1704+
"project_id", project_id or self.client.default_project_id
1705+
)
1706+
17021707
res = self._request(
17031708
"DELETE",
1704-
"/edge-services/v1alpha1/current-plan",
1705-
params={
1706-
"project_id": project_id or self.client.default_project_id,
1707-
},
1709+
f"/edge-services/v1alpha1/current-plan/{param_project_id}",
17081710
)
17091711

17101712
self._throw_on_error(res)

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

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
DNSStage,
1919
PipelineError,
2020
Pipeline,
21-
PurgeRequest,
2221
TLSSecret,
2322
TLSStage,
23+
PurgeRequest,
2424
CheckDomainResponse,
2525
CheckLbOriginResponse,
2626
CheckPEMChainResponse,
@@ -381,53 +381,6 @@ def unmarshal_Pipeline(data: Any) -> Pipeline:
381381
return Pipeline(**args)
382382

383383

384-
def unmarshal_PurgeRequest(data: Any) -> PurgeRequest:
385-
if not isinstance(data, dict):
386-
raise TypeError(
387-
"Unmarshalling the type 'PurgeRequest' failed as data isn't a dictionary."
388-
)
389-
390-
args: Dict[str, Any] = {}
391-
392-
field = data.get("id", None)
393-
if field is not None:
394-
args["id"] = field
395-
396-
field = data.get("pipeline_id", None)
397-
if field is not None:
398-
args["pipeline_id"] = field
399-
400-
field = data.get("status", None)
401-
if field is not None:
402-
args["status"] = field
403-
404-
field = data.get("assets", None)
405-
if field is not None:
406-
args["assets"] = field
407-
else:
408-
args["assets"] = None
409-
410-
field = data.get("all", None)
411-
if field is not None:
412-
args["all"] = field
413-
else:
414-
args["all"] = None
415-
416-
field = data.get("created_at", None)
417-
if field is not None:
418-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
419-
else:
420-
args["created_at"] = None
421-
422-
field = data.get("updated_at", None)
423-
if field is not None:
424-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
425-
else:
426-
args["updated_at"] = None
427-
428-
return PurgeRequest(**args)
429-
430-
431384
def unmarshal_TLSSecret(data: Any) -> TLSSecret:
432385
if not isinstance(data, dict):
433386
raise TypeError(
@@ -514,6 +467,53 @@ def unmarshal_TLSStage(data: Any) -> TLSStage:
514467
return TLSStage(**args)
515468

516469

470+
def unmarshal_PurgeRequest(data: Any) -> PurgeRequest:
471+
if not isinstance(data, dict):
472+
raise TypeError(
473+
"Unmarshalling the type 'PurgeRequest' failed as data isn't a dictionary."
474+
)
475+
476+
args: Dict[str, Any] = {}
477+
478+
field = data.get("id", None)
479+
if field is not None:
480+
args["id"] = field
481+
482+
field = data.get("pipeline_id", None)
483+
if field is not None:
484+
args["pipeline_id"] = field
485+
486+
field = data.get("status", None)
487+
if field is not None:
488+
args["status"] = field
489+
490+
field = data.get("assets", None)
491+
if field is not None:
492+
args["assets"] = field
493+
else:
494+
args["assets"] = None
495+
496+
field = data.get("all", None)
497+
if field is not None:
498+
args["all"] = field
499+
else:
500+
args["all"] = None
501+
502+
field = data.get("created_at", None)
503+
if field is not None:
504+
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
505+
else:
506+
args["created_at"] = None
507+
508+
field = data.get("updated_at", None)
509+
if field is not None:
510+
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
511+
else:
512+
args["updated_at"] = None
513+
514+
return PurgeRequest(**args)
515+
516+
517517
def unmarshal_CheckDomainResponse(data: Any) -> CheckDomainResponse:
518518
if not isinstance(data, dict):
519519
raise TypeError(

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

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,6 @@ class TLSSecret:
259259
"""
260260

261261

262-
@dataclass
263-
class CheckPEMChainRequestSecretChain:
264-
secret_id: str
265-
266-
secret_region: str
267-
268-
269262
@dataclass
270263
class BackendStage:
271264
id: str
@@ -423,91 +416,98 @@ class Pipeline:
423416

424417

425418
@dataclass
426-
class PlanDetails:
427-
plan_name: PlanName
428-
429-
package_gb: int
419+
class TLSStage:
420+
id: str
421+
"""
422+
ID of the TLS stage.
423+
"""
430424

431-
pipeline_limit: int
425+
secrets: List[TLSSecret]
426+
"""
427+
Secret (from Scaleway Secret Manager) containing your custom certificate.
428+
"""
432429

430+
managed_certificate: bool
431+
"""
432+
True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint.
433+
"""
433434

434-
@dataclass
435-
class PurgeRequest:
436-
id: str
435+
project_id: str
437436
"""
438-
ID of the purge request.
437+
Project ID of the TLS stage.
439438
"""
440439

441-
pipeline_id: str
440+
pipeline_id: Optional[str]
442441
"""
443-
Pipeline ID the purge request belongs to.
442+
Pipeline ID the TLS stage belongs to.
444443
"""
445444

446-
status: PurgeRequestStatus
445+
certificate_expires_at: Optional[datetime]
447446
"""
448-
Status of the purge request.
447+
Expiration date of the certificate.
449448
"""
450449

451450
created_at: Optional[datetime]
452451
"""
453-
Date the purge request was created.
452+
Date the TLS stage was created.
454453
"""
455454

456455
updated_at: Optional[datetime]
457456
"""
458-
Date the purge request was last updated.
457+
Date the TLS stage was last updated.
459458
"""
460459

461-
assets: Optional[List[str]]
460+
cache_stage_id: Optional[str]
462461

463-
all: Optional[bool]
462+
backend_stage_id: Optional[str]
464463

465464

466465
@dataclass
467-
class TLSStage:
468-
id: str
469-
"""
470-
ID of the TLS stage.
471-
"""
466+
class CheckPEMChainRequestSecretChain:
467+
secret_id: str
472468

473-
secrets: List[TLSSecret]
474-
"""
475-
Secret (from Scaleway Secret Manager) containing your custom certificate.
476-
"""
469+
secret_region: str
477470

478-
managed_certificate: bool
479-
"""
480-
True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint.
481-
"""
482471

483-
project_id: str
472+
@dataclass
473+
class PlanDetails:
474+
plan_name: PlanName
475+
476+
package_gb: int
477+
478+
pipeline_limit: int
479+
480+
481+
@dataclass
482+
class PurgeRequest:
483+
id: str
484484
"""
485-
Project ID of the TLS stage.
485+
ID of the purge request.
486486
"""
487487

488-
pipeline_id: Optional[str]
488+
pipeline_id: str
489489
"""
490-
Pipeline ID the TLS stage belongs to.
490+
Pipeline ID the purge request belongs to.
491491
"""
492492

493-
certificate_expires_at: Optional[datetime]
493+
status: PurgeRequestStatus
494494
"""
495-
Expiration date of the certificate.
495+
Status of the purge request.
496496
"""
497497

498498
created_at: Optional[datetime]
499499
"""
500-
Date the TLS stage was created.
500+
Date the purge request was created.
501501
"""
502502

503503
updated_at: Optional[datetime]
504504
"""
505-
Date the TLS stage was last updated.
505+
Date the purge request was last updated.
506506
"""
507507

508-
cache_stage_id: Optional[str]
508+
assets: Optional[List[str]]
509509

510-
backend_stage_id: Optional[str]
510+
all: Optional[bool]
511511

512512

513513
@dataclass

0 commit comments

Comments
 (0)