Skip to content

Commit ce8ebc2

Browse files
authored
Merge branch 'main' into v1.5575.0
2 parents 85ee9a5 + 180462b commit ce8ebc2

File tree

22 files changed

+1460
-132
lines changed

22 files changed

+1460
-132
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,6 @@ def unmarshal_ServerInstall(data: Any) -> ServerInstall:
894894
if field is not None:
895895
args["service_url"] = field
896896

897-
field = data.get("partitioning_schema", None)
898-
if field is not None:
899-
args["partitioning_schema"] = unmarshal_Schema(field)
900-
else:
901-
args["partitioning_schema"] = None
902-
903897
return ServerInstall(**args)
904898

905899

@@ -1525,11 +1519,6 @@ def marshal_CreateServerRequestInstall(
15251519
if request.service_password is not None:
15261520
output["service_password"] = request.service_password
15271521

1528-
if request.partitioning_schema is not None:
1529-
output["partitioning_schema"] = marshal_Schema(
1530-
request.partitioning_schema, defaults
1531-
)
1532-
15331522
return output
15341523

15351524

@@ -1603,11 +1592,6 @@ def marshal_InstallServerRequest(
16031592
if request.service_password is not None:
16041593
output["service_password"] = request.service_password
16051594

1606-
if request.partitioning_schema is not None:
1607-
output["partitioning_schema"] = marshal_Schema(
1608-
request.partitioning_schema, defaults
1609-
)
1610-
16111595
return output
16121596

16131597

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
from .types import DeletePipelineRequest
5151
from .types import DeleteTLSStageRequest
5252
from .types import GetBackendStageRequest
53+
from .types import GetBillingRequest
54+
from .types import GetBillingResponse
5355
from .types import GetCacheStageRequest
5456
from .types import GetCurrentPlanRequest
5557
from .types import GetDNSStageRequest
@@ -129,6 +131,8 @@
129131
"DeletePipelineRequest",
130132
"DeleteTLSStageRequest",
131133
"GetBackendStageRequest",
134+
"GetBillingRequest",
135+
"GetBillingResponse",
132136
"GetCacheStageRequest",
133137
"GetCurrentPlanRequest",
134138
"GetDNSStageRequest",

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
CreatePurgeRequestRequest,
3535
CreateTLSStageRequest,
3636
DNSStage,
37+
GetBillingResponse,
3738
ListBackendStagesResponse,
3839
ListCacheStagesResponse,
3940
ListDNSStagesResponse,
@@ -71,6 +72,7 @@
7172
unmarshal_CheckDomainResponse,
7273
unmarshal_CheckLbOriginResponse,
7374
unmarshal_CheckPEMChainResponse,
75+
unmarshal_GetBillingResponse,
7476
unmarshal_ListBackendStagesResponse,
7577
unmarshal_ListCacheStagesResponse,
7678
unmarshal_ListDNSStagesResponse,
@@ -1710,3 +1712,31 @@ async def delete_current_plan(
17101712
)
17111713

17121714
self._throw_on_error(res)
1715+
1716+
async def get_billing(
1717+
self,
1718+
*,
1719+
project_id: Optional[str] = None,
1720+
) -> GetBillingResponse:
1721+
"""
1722+
Gives information on current edge-services subscription plan and used resources with associated price.
1723+
:param project_id:
1724+
:return: :class:`GetBillingResponse <GetBillingResponse>`
1725+
1726+
Usage:
1727+
::
1728+
1729+
result = await api.get_billing()
1730+
"""
1731+
1732+
param_project_id = validate_path_param(
1733+
"project_id", project_id or self.client.default_project_id
1734+
)
1735+
1736+
res = self._request(
1737+
"GET",
1738+
f"/edge-services/v1alpha1/billing/{param_project_id}",
1739+
)
1740+
1741+
self._throw_on_error(res)
1742+
return unmarshal_GetBillingResponse(res.json())

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

Lines changed: 81 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from dateutil import parser
66

77
from scaleway_core.profile import ProfileDefaults
8+
from scaleway_core.bridge import (
9+
unmarshal_Money,
10+
)
811
from scaleway_core.utils import (
912
OneOfPossibility,
1013
resolve_one_of,
@@ -24,11 +27,12 @@
2427
CheckDomainResponse,
2528
CheckLbOriginResponse,
2629
CheckPEMChainResponse,
30+
PlanDetails,
31+
GetBillingResponse,
2732
ListBackendStagesResponse,
2833
ListCacheStagesResponse,
2934
ListDNSStagesResponse,
3035
ListPipelinesResponse,
31-
PlanDetails,
3236
ListPlansResponse,
3337
ListPurgeRequestsResponse,
3438
ListTLSStagesResponse,
@@ -563,6 +567,82 @@ def unmarshal_CheckPEMChainResponse(data: Any) -> CheckPEMChainResponse:
563567
return CheckPEMChainResponse(**args)
564568

565569

570+
def unmarshal_PlanDetails(data: Any) -> PlanDetails:
571+
if not isinstance(data, dict):
572+
raise TypeError(
573+
"Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary."
574+
)
575+
576+
args: Dict[str, Any] = {}
577+
578+
field = data.get("plan_name", None)
579+
if field is not None:
580+
args["plan_name"] = field
581+
582+
field = data.get("package_gb", None)
583+
if field is not None:
584+
args["package_gb"] = field
585+
586+
field = data.get("pipeline_limit", None)
587+
if field is not None:
588+
args["pipeline_limit"] = field
589+
590+
return PlanDetails(**args)
591+
592+
593+
def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse:
594+
if not isinstance(data, dict):
595+
raise TypeError(
596+
"Unmarshalling the type 'GetBillingResponse' failed as data isn't a dictionary."
597+
)
598+
599+
args: Dict[str, Any] = {}
600+
601+
field = data.get("pipeline_number", None)
602+
if field is not None:
603+
args["pipeline_number"] = field
604+
605+
field = data.get("current_plan_cache_usage", None)
606+
if field is not None:
607+
args["current_plan_cache_usage"] = field
608+
609+
field = data.get("extra_cache_usage", None)
610+
if field is not None:
611+
args["extra_cache_usage"] = field
612+
613+
field = data.get("current_plan", None)
614+
if field is not None:
615+
args["current_plan"] = unmarshal_PlanDetails(field)
616+
else:
617+
args["current_plan"] = None
618+
619+
field = data.get("plan_cost", None)
620+
if field is not None:
621+
args["plan_cost"] = unmarshal_Money(field)
622+
else:
623+
args["plan_cost"] = None
624+
625+
field = data.get("extra_pipelines_cost", None)
626+
if field is not None:
627+
args["extra_pipelines_cost"] = unmarshal_Money(field)
628+
else:
629+
args["extra_pipelines_cost"] = None
630+
631+
field = data.get("extra_cache_cost", None)
632+
if field is not None:
633+
args["extra_cache_cost"] = unmarshal_Money(field)
634+
else:
635+
args["extra_cache_cost"] = None
636+
637+
field = data.get("total_cost", None)
638+
if field is not None:
639+
args["total_cost"] = unmarshal_Money(field)
640+
else:
641+
args["total_cost"] = None
642+
643+
return GetBillingResponse(**args)
644+
645+
566646
def unmarshal_ListBackendStagesResponse(data: Any) -> ListBackendStagesResponse:
567647
if not isinstance(data, dict):
568648
raise TypeError(
@@ -647,29 +727,6 @@ def unmarshal_ListPipelinesResponse(data: Any) -> ListPipelinesResponse:
647727
return ListPipelinesResponse(**args)
648728

649729

650-
def unmarshal_PlanDetails(data: Any) -> PlanDetails:
651-
if not isinstance(data, dict):
652-
raise TypeError(
653-
"Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary."
654-
)
655-
656-
args: Dict[str, Any] = {}
657-
658-
field = data.get("plan_name", None)
659-
if field is not None:
660-
args["plan_name"] = field
661-
662-
field = data.get("package_gb", None)
663-
if field is not None:
664-
args["package_gb"] = field
665-
666-
field = data.get("pipeline_limit", None)
667-
if field is not None:
668-
args["pipeline_limit"] = field
669-
670-
return PlanDetails(**args)
671-
672-
673730
def unmarshal_ListPlansResponse(data: Any) -> ListPlansResponse:
674731
if not isinstance(data, dict):
675732
raise TypeError(

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import List, Optional
99

1010
from scaleway_core.bridge import (
11+
Money,
1112
Region,
1213
Zone,
1314
)
@@ -472,10 +473,19 @@ class CheckPEMChainRequestSecretChain:
472473
@dataclass
473474
class PlanDetails:
474475
plan_name: PlanName
476+
"""
477+
Subscription plan name.
478+
"""
475479

476480
package_gb: int
481+
"""
482+
Amount of egress data from cache included in subscription plan.
483+
"""
477484

478485
pipeline_limit: int
486+
"""
487+
Number of pipeline included in subscription plan.
488+
"""
479489

480490

481491
@dataclass
@@ -713,6 +723,54 @@ class GetBackendStageRequest:
713723
"""
714724

715725

726+
@dataclass
727+
class GetBillingRequest:
728+
project_id: Optional[str]
729+
730+
731+
@dataclass
732+
class GetBillingResponse:
733+
pipeline_number: int
734+
"""
735+
Total number of pipeline currently configured.
736+
"""
737+
738+
current_plan_cache_usage: int
739+
"""
740+
Total amount of data egressed from cache in current subscription plan.
741+
"""
742+
743+
extra_cache_usage: int
744+
"""
745+
Total amount of data egressed from cache not included in the plans.
746+
"""
747+
748+
current_plan: Optional[PlanDetails]
749+
"""
750+
Information on the current edge-service subscription plan.
751+
"""
752+
753+
plan_cost: Optional[Money]
754+
"""
755+
Price of the current subscription plan.
756+
"""
757+
758+
extra_pipelines_cost: Optional[Money]
759+
"""
760+
Cost to date of the pipelines not included in the plans.
761+
"""
762+
763+
extra_cache_cost: Optional[Money]
764+
"""
765+
Cost to date of the data egressed from cache not included in the plans.
766+
"""
767+
768+
total_cost: Optional[Money]
769+
"""
770+
Total cost to date of edge-service product for the month including current plan, previous plans, extra pipelines and extra egress cache data.
771+
"""
772+
773+
716774
@dataclass
717775
class GetCacheStageRequest:
718776
cache_stage_id: str

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,6 @@ def unmarshal_APIKey(data: Any) -> APIKey:
126126
if field is not None:
127127
args["default_project_id"] = field
128128

129-
field = data.get("editable", None)
130-
if field is not None:
131-
args["editable"] = field
132-
133-
field = data.get("managed", None)
134-
if field is not None:
135-
args["managed"] = field
136-
137-
field = data.get("creation_ip", None)
138-
if field is not None:
139-
args["creation_ip"] = field
140-
141129
field = data.get("secret_key", None)
142130
if field is not None:
143131
args["secret_key"] = field
@@ -150,6 +138,22 @@ def unmarshal_APIKey(data: Any) -> APIKey:
150138
else:
151139
args["application_id"] = None
152140

141+
field = data.get("editable", None)
142+
if field is not None:
143+
args["editable"] = field
144+
145+
field = data.get("deletable", None)
146+
if field is not None:
147+
args["deletable"] = field
148+
149+
field = data.get("managed", None)
150+
if field is not None:
151+
args["managed"] = field
152+
153+
field = data.get("creation_ip", None)
154+
if field is not None:
155+
args["creation_ip"] = field
156+
153157
field = data.get("user_id", None)
154158
if field is not None:
155159
args["user_id"] = field

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ class APIKey:
287287
Defines whether or not the API key is editable.
288288
"""
289289

290+
deletable: bool
291+
"""
292+
Defines whether or not the API key is deletable.
293+
"""
294+
290295
managed: bool
291296
"""
292297
Defines whether or not the API key is managed.

0 commit comments

Comments
 (0)