Skip to content

Commit ae7e69f

Browse files
committed
feat: update generated APIs
1 parent d6ab2af commit ae7e69f

File tree

8 files changed

+426
-18
lines changed

8 files changed

+426
-18
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .types import ListCacheStagesRequestOrderBy
77
from .types import ListDNSStagesRequestOrderBy
88
from .types import ListPipelinesRequestOrderBy
9+
from .types import ListPipelinesWithStagesRequestOrderBy
910
from .types import ListPurgeRequestsRequestOrderBy
1011
from .types import ListTLSStagesRequestOrderBy
1112
from .types import PipelineErrorCode
@@ -29,6 +30,7 @@
2930
from .types import TLSStage
3031
from .types import CheckPEMChainRequestSecretChain
3132
from .types import PlanDetails
33+
from .types import PipelineStages
3234
from .types import PurgeRequest
3335
from .types import TLSSecretsConfig
3436
from .types import CheckDomainRequest
@@ -66,6 +68,8 @@
6668
from .types import ListDNSStagesResponse
6769
from .types import ListPipelinesRequest
6870
from .types import ListPipelinesResponse
71+
from .types import ListPipelinesWithStagesRequest
72+
from .types import ListPipelinesWithStagesResponse
6973
from .types import ListPlansResponse
7074
from .types import ListPurgeRequestsRequest
7175
from .types import ListPurgeRequestsResponse
@@ -87,6 +91,7 @@
8791
"ListCacheStagesRequestOrderBy",
8892
"ListDNSStagesRequestOrderBy",
8993
"ListPipelinesRequestOrderBy",
94+
"ListPipelinesWithStagesRequestOrderBy",
9095
"ListPurgeRequestsRequestOrderBy",
9196
"ListTLSStagesRequestOrderBy",
9297
"PipelineErrorCode",
@@ -110,6 +115,7 @@
110115
"TLSStage",
111116
"CheckPEMChainRequestSecretChain",
112117
"PlanDetails",
118+
"PipelineStages",
113119
"PurgeRequest",
114120
"TLSSecretsConfig",
115121
"CheckDomainRequest",
@@ -147,6 +153,8 @@
147153
"ListDNSStagesResponse",
148154
"ListPipelinesRequest",
149155
"ListPipelinesResponse",
156+
"ListPipelinesWithStagesRequest",
157+
"ListPipelinesWithStagesResponse",
150158
"ListPlansResponse",
151159
"ListPurgeRequestsRequest",
152160
"ListPurgeRequestsResponse",

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

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
ListCacheStagesRequestOrderBy,
1616
ListDNSStagesRequestOrderBy,
1717
ListPipelinesRequestOrderBy,
18+
ListPipelinesWithStagesRequestOrderBy,
1819
ListPurgeRequestsRequestOrderBy,
1920
ListTLSStagesRequestOrderBy,
2021
PlanName,
@@ -39,10 +40,12 @@
3940
ListCacheStagesResponse,
4041
ListDNSStagesResponse,
4142
ListPipelinesResponse,
43+
ListPipelinesWithStagesResponse,
4244
ListPlansResponse,
4345
ListPurgeRequestsResponse,
4446
ListTLSStagesResponse,
4547
Pipeline,
48+
PipelineStages,
4649
Plan,
4750
PurgeRequest,
4851
ScalewayLb,
@@ -77,6 +80,7 @@
7780
unmarshal_ListCacheStagesResponse,
7881
unmarshal_ListDNSStagesResponse,
7982
unmarshal_ListPipelinesResponse,
83+
unmarshal_ListPipelinesWithStagesResponse,
8084
unmarshal_ListPlansResponse,
8185
unmarshal_ListPurgeRequestsResponse,
8286
unmarshal_ListTLSStagesResponse,
@@ -302,6 +306,87 @@ async def wait_for_pipeline(
302306
},
303307
)
304308

309+
async def list_pipelines_with_stages(
310+
self,
311+
*,
312+
order_by: Optional[ListPipelinesWithStagesRequestOrderBy] = None,
313+
page: Optional[int] = None,
314+
page_size: Optional[int] = None,
315+
name: Optional[str] = None,
316+
organization_id: Optional[str] = None,
317+
project_id: Optional[str] = None,
318+
) -> ListPipelinesWithStagesResponse:
319+
"""
320+
:param order_by:
321+
:param page:
322+
:param page_size:
323+
:param name:
324+
:param organization_id:
325+
:param project_id:
326+
:return: :class:`ListPipelinesWithStagesResponse <ListPipelinesWithStagesResponse>`
327+
328+
Usage:
329+
::
330+
331+
result = await api.list_pipelines_with_stages()
332+
"""
333+
334+
res = self._request(
335+
"GET",
336+
"/edge-services/v1alpha1/pipelines-stages",
337+
params={
338+
"name": name,
339+
"order_by": order_by,
340+
"organization_id": organization_id
341+
or self.client.default_organization_id,
342+
"page": page,
343+
"page_size": page_size or self.client.default_page_size,
344+
"project_id": project_id or self.client.default_project_id,
345+
},
346+
)
347+
348+
self._throw_on_error(res)
349+
return unmarshal_ListPipelinesWithStagesResponse(res.json())
350+
351+
async def list_pipelines_with_stages_all(
352+
self,
353+
*,
354+
order_by: Optional[ListPipelinesWithStagesRequestOrderBy] = None,
355+
page: Optional[int] = None,
356+
page_size: Optional[int] = None,
357+
name: Optional[str] = None,
358+
organization_id: Optional[str] = None,
359+
project_id: Optional[str] = None,
360+
) -> List[PipelineStages]:
361+
"""
362+
:param order_by:
363+
:param page:
364+
:param page_size:
365+
:param name:
366+
:param organization_id:
367+
:param project_id:
368+
:return: :class:`List[PipelineStages] <List[PipelineStages]>`
369+
370+
Usage:
371+
::
372+
373+
result = await api.list_pipelines_with_stages_all()
374+
"""
375+
376+
return await fetch_all_pages_async(
377+
type=ListPipelinesWithStagesResponse,
378+
key="pipelines",
379+
fetcher=self.list_pipelines_with_stages,
380+
args={
381+
"order_by": order_by,
382+
"page": page,
383+
"page_size": page_size,
384+
"name": name,
385+
"organization_id": organization_id,
386+
"project_id": project_id,
387+
},
388+
)
389+
305390
async def update_pipeline(
306391
self,
307392
*,
@@ -1719,7 +1804,7 @@ async def get_billing(
17191804
project_id: Optional[str] = None,
17201805
) -> GetBillingResponse:
17211806
"""
1722-
Gives information on current edge-services subscription plan and used resources with associated price.
1807+
Gives information on the currently selected Edge Services subscription plan, resource usage and associated billing information for this calendar month (including whether consumption falls within or exceeds the currently selected subscription plan.).
17231808
:param project_id:
17241809
:return: :class:`GetBillingResponse <GetBillingResponse>`
17251810

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Pipeline,
2424
TLSSecret,
2525
TLSStage,
26+
PipelineStages,
2627
PurgeRequest,
2728
CheckDomainResponse,
2829
CheckLbOriginResponse,
@@ -33,6 +34,7 @@
3334
ListCacheStagesResponse,
3435
ListDNSStagesResponse,
3536
ListPipelinesResponse,
37+
ListPipelinesWithStagesResponse,
3638
ListPlansResponse,
3739
ListPurgeRequestsResponse,
3840
ListTLSStagesResponse,
@@ -471,6 +473,47 @@ def unmarshal_TLSStage(data: Any) -> TLSStage:
471473
return TLSStage(**args)
472474

473475

476+
def unmarshal_PipelineStages(data: Any) -> PipelineStages:
477+
if not isinstance(data, dict):
478+
raise TypeError(
479+
"Unmarshalling the type 'PipelineStages' failed as data isn't a dictionary."
480+
)
481+
482+
args: Dict[str, Any] = {}
483+
484+
field = data.get("dns_stages", None)
485+
if field is not None:
486+
args["dns_stages"] = (
487+
[unmarshal_DNSStage(v) for v in field] if field is not None else None
488+
)
489+
490+
field = data.get("tls_stages", None)
491+
if field is not None:
492+
args["tls_stages"] = (
493+
[unmarshal_TLSStage(v) for v in field] if field is not None else None
494+
)
495+
496+
field = data.get("cache_stages", None)
497+
if field is not None:
498+
args["cache_stages"] = (
499+
[unmarshal_CacheStage(v) for v in field] if field is not None else None
500+
)
501+
502+
field = data.get("backend_stages", None)
503+
if field is not None:
504+
args["backend_stages"] = (
505+
[unmarshal_BackendStage(v) for v in field] if field is not None else None
506+
)
507+
508+
field = data.get("pipeline", None)
509+
if field is not None:
510+
args["pipeline"] = unmarshal_Pipeline(field)
511+
else:
512+
args["pipeline"] = None
513+
514+
return PipelineStages(**args)
515+
516+
474517
def unmarshal_PurgeRequest(data: Any) -> PurgeRequest:
475518
if not isinstance(data, dict):
476519
raise TypeError(
@@ -727,6 +770,29 @@ def unmarshal_ListPipelinesResponse(data: Any) -> ListPipelinesResponse:
727770
return ListPipelinesResponse(**args)
728771

729772

773+
def unmarshal_ListPipelinesWithStagesResponse(
774+
data: Any,
775+
) -> ListPipelinesWithStagesResponse:
776+
if not isinstance(data, dict):
777+
raise TypeError(
778+
"Unmarshalling the type 'ListPipelinesWithStagesResponse' failed as data isn't a dictionary."
779+
)
780+
781+
args: Dict[str, Any] = {}
782+
783+
field = data.get("pipelines", None)
784+
if field is not None:
785+
args["pipelines"] = (
786+
[unmarshal_PipelineStages(v) for v in field] if field is not None else None
787+
)
788+
789+
field = data.get("total_count", None)
790+
if field is not None:
791+
args["total_count"] = field
792+
793+
return ListPipelinesWithStagesResponse(**args)
794+
795+
730796
def unmarshal_ListPlansResponse(data: Any) -> ListPlansResponse:
731797
if not isinstance(data, dict):
732798
raise TypeError(

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

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ def __str__(self) -> str:
7171
return str(self.value)
7272

7373

74+
class ListPipelinesWithStagesRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
75+
CREATED_AT_ASC = "created_at_asc"
76+
CREATED_AT_DESC = "created_at_desc"
77+
NAME_ASC = "name_asc"
78+
NAME_DESC = "name_desc"
79+
80+
def __str__(self) -> str:
81+
return str(self.value)
82+
83+
7484
class ListPurgeRequestsRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
7585
CREATED_AT_ASC = "created_at_asc"
7686
CREATED_AT_DESC = "created_at_desc"
@@ -484,10 +494,23 @@ class PlanDetails:
484494

485495
pipeline_limit: int
486496
"""
487-
Number of pipeline included in subscription plan.
497+
Number of pipelines included in subscription plan.
488498
"""
489499

490500

501+
@dataclass
502+
class PipelineStages:
503+
dns_stages: List[DNSStage]
504+
505+
tls_stages: List[TLSStage]
506+
507+
cache_stages: List[CacheStage]
508+
509+
backend_stages: List[BackendStage]
510+
511+
pipeline: Optional[Pipeline]
512+
513+
491514
@dataclass
492515
class PurgeRequest:
493516
id: str
@@ -732,22 +755,22 @@ class GetBillingRequest:
732755
class GetBillingResponse:
733756
pipeline_number: int
734757
"""
735-
Total number of pipeline currently configured.
758+
Total number of pipelines currently configured.
736759
"""
737760

738761
current_plan_cache_usage: int
739762
"""
740-
Total amount of data egressed from cache in current subscription plan.
763+
Total amount of data egressed from the cache (this month), included in the active subscription plan.
741764
"""
742765

743766
extra_cache_usage: int
744767
"""
745-
Total amount of data egressed from cache not included in the plans.
768+
Total amount of data egressed from cache (this month), not included in the active subscription plan.
746769
"""
747770

748771
current_plan: Optional[PlanDetails]
749772
"""
750-
Information on the current edge-service subscription plan.
773+
Information on the currently-selected, active Edge Services subscription plan.
751774
"""
752775

753776
plan_cost: Optional[Money]
@@ -757,17 +780,17 @@ class GetBillingResponse:
757780

758781
extra_pipelines_cost: Optional[Money]
759782
"""
760-
Cost to date of the pipelines not included in the plans.
783+
Cost to date (this month) of pipelines not included in the subscription plan.
761784
"""
762785

763786
extra_cache_cost: Optional[Money]
764787
"""
765-
Cost to date of the data egressed from cache not included in the plans.
788+
Cost to date (this month) of the data egressed from the cache that is not included in the active subscription plan.
766789
"""
767790

768791
total_cost: Optional[Money]
769792
"""
770-
Total cost to date of edge-service product for the month including current plan, previous plans, extra pipelines and extra egress cache data.
793+
Total cost to date (this month) of all Edge Services resources including active subscription plan, previously active plans, extra pipelines and extra egress cache data.
771794
"""
772795

773796

@@ -1010,6 +1033,28 @@ class ListPipelinesResponse:
10101033
"""
10111034

10121035

1036+
@dataclass
1037+
class ListPipelinesWithStagesRequest:
1038+
order_by: Optional[ListPipelinesWithStagesRequestOrderBy]
1039+
1040+
page: Optional[int]
1041+
1042+
page_size: Optional[int]
1043+
1044+
name: Optional[str]
1045+
1046+
organization_id: Optional[str]
1047+
1048+
project_id: Optional[str]
1049+
1050+
1051+
@dataclass
1052+
class ListPipelinesWithStagesResponse:
1053+
pipelines: List[PipelineStages]
1054+
1055+
total_count: int
1056+
1057+
10131058
@dataclass
10141059
class ListPlansResponse:
10151060
total_count: int

0 commit comments

Comments
 (0)