From 4dd5469a28000aec4daa7a8abc4041ba289e5a96 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 12 Feb 2025 15:23:09 +0000 Subject: [PATCH] feat: update generated APIs --- .../edge_services/v1alpha1/__init__.py | 2 + .../edge_services/v1alpha1/marshalling.py | 58 +++++++++++++++++-- .../edge_services/v1alpha1/types.py | 44 +++++++++++++- .../edge_services/v1alpha1/__init__.py | 2 + .../edge_services/v1alpha1/marshalling.py | 58 +++++++++++++++++-- .../scaleway/edge_services/v1alpha1/types.py | 44 +++++++++++++- 6 files changed, 194 insertions(+), 14 deletions(-) diff --git a/scaleway-async/scaleway_async/edge_services/v1alpha1/__init__.py b/scaleway-async/scaleway_async/edge_services/v1alpha1/__init__.py index 3b7aa44b5..a69731fd4 100644 --- a/scaleway-async/scaleway_async/edge_services/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/edge_services/v1alpha1/__init__.py @@ -30,6 +30,7 @@ from .types import TLSStage from .types import CheckPEMChainRequestSecretChain from .types import PlanDetails +from .types import PlanUsageDetails from .types import PipelineStages from .types import PurgeRequest from .types import TLSSecretsConfig @@ -115,6 +116,7 @@ "TLSStage", "CheckPEMChainRequestSecretChain", "PlanDetails", + "PlanUsageDetails", "PipelineStages", "PurgeRequest", "TLSSecretsConfig", diff --git a/scaleway-async/scaleway_async/edge_services/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/edge_services/v1alpha1/marshalling.py index d9c1b61f7..f9145ff06 100644 --- a/scaleway-async/scaleway_async/edge_services/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/edge_services/v1alpha1/marshalling.py @@ -29,6 +29,7 @@ CheckLbOriginResponse, CheckPEMChainResponse, PlanDetails, + PlanUsageDetails, GetBillingResponse, ListBackendStagesResponse, ListCacheStagesResponse, @@ -634,9 +635,30 @@ def unmarshal_PlanDetails(data: Any) -> PlanDetails: if field is not None: args["pipeline_limit"] = field + field = data.get("waf_requests", None) + if field is not None: + args["waf_requests"] = field + return PlanDetails(**args) +def unmarshal_PlanUsageDetails(data: Any) -> PlanUsageDetails: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PlanUsageDetails' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("plan_cost", None) + if field is not None: + args["plan_cost"] = unmarshal_Money(field) + else: + args["plan_cost"] = None + + return PlanUsageDetails(**args) + + def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: if not isinstance(data, dict): raise TypeError( @@ -645,6 +667,12 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: args: Dict[str, Any] = {} + field = data.get("current_plan", None) + if field is not None: + args["current_plan"] = unmarshal_PlanDetails(field) + else: + args["current_plan"] = None + field = data.get("pipeline_number", None) if field is not None: args["pipeline_number"] = field @@ -657,11 +685,13 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: if field is not None: args["extra_cache_usage"] = field - field = data.get("current_plan", None) + field = data.get("current_plan_waf_usage", None) if field is not None: - args["current_plan"] = unmarshal_PlanDetails(field) - else: - args["current_plan"] = None + args["current_plan_waf_usage"] = field + + field = data.get("extra_waf_usage", None) + if field is not None: + args["extra_waf_usage"] = field field = data.get("plan_cost", None) if field is not None: @@ -675,12 +705,32 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: else: args["extra_pipelines_cost"] = None + field = data.get("plans_usage_details", None) + if field is not None: + args["plans_usage_details"] = ( + {key: unmarshal_PlanUsageDetails(value) for key, value in field.items()} + if field is not None + else None + ) + field = data.get("extra_cache_cost", None) if field is not None: args["extra_cache_cost"] = unmarshal_Money(field) else: args["extra_cache_cost"] = None + field = data.get("extra_waf_cost", None) + if field is not None: + args["extra_waf_cost"] = unmarshal_Money(field) + else: + args["extra_waf_cost"] = None + + field = data.get("waf_add_on", None) + if field is not None: + args["waf_add_on"] = unmarshal_Money(field) + else: + args["waf_add_on"] = None + field = data.get("total_cost", None) if field is not None: args["total_cost"] = unmarshal_Money(field) diff --git a/scaleway-async/scaleway_async/edge_services/v1alpha1/types.py b/scaleway-async/scaleway_async/edge_services/v1alpha1/types.py index db2835ea0..a4121656a 100644 --- a/scaleway-async/scaleway_async/edge_services/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/edge_services/v1alpha1/types.py @@ -5,7 +5,7 @@ from dataclasses import dataclass from datetime import datetime from enum import Enum -from typing import List, Optional +from typing import Dict, List, Optional from scaleway_core.bridge import ( Money, @@ -502,6 +502,19 @@ class PlanDetails: Number of pipelines included in subscription plan. """ + waf_requests: int + """ + Number of WAF requests included in subscription plan. + """ + + +@dataclass +class PlanUsageDetails: + plan_cost: Optional[Money] + """ + Cost to date (this month) for the corresponding Edge Services subscription plan. + """ + @dataclass class PipelineStages: @@ -758,6 +771,11 @@ class GetBillingRequest: @dataclass class GetBillingResponse: + current_plan: Optional[PlanDetails] + """ + Information on the currently-selected, active Edge Services subscription plan. + """ + pipeline_number: int """ Total number of pipelines currently configured. @@ -773,9 +791,14 @@ class GetBillingResponse: Total amount of extra data egressed from cache in gigabytes from the beginning of the month, not included in the subscription plans. """ - current_plan: Optional[PlanDetails] + current_plan_waf_usage: int """ - Information on the currently-selected, active Edge Services subscription plan. + Total number of requests processed by the WAF since the beginning of the current month, for the active subscription plan. + """ + + extra_waf_usage: int + """ + Total number of extra requests processed by the WAF from the beginning of the month, not included in the subscription plans. """ plan_cost: Optional[Money] @@ -788,11 +811,26 @@ class GetBillingResponse: Cost to date (this month) of pipelines not included in the subscription plans. """ + plans_usage_details: Dict[str, PlanUsageDetails] + """ + Detailed costs and usage for all Edge Services subscription plans that were activated during the month. + """ + extra_cache_cost: Optional[Money] """ Cost to date (this month) of the data egressed from the cache that is not included in the subscription plans. """ + extra_waf_cost: Optional[Money] + """ + Cost to date (this month) of the extra requests processed by the WAF that were not included in the subscription plans. + """ + + waf_add_on: Optional[Money] + """ + Cost of activating WAF add-on (where subscription plan does not include WAF). + """ + total_cost: Optional[Money] """ 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. diff --git a/scaleway/scaleway/edge_services/v1alpha1/__init__.py b/scaleway/scaleway/edge_services/v1alpha1/__init__.py index 3b7aa44b5..a69731fd4 100644 --- a/scaleway/scaleway/edge_services/v1alpha1/__init__.py +++ b/scaleway/scaleway/edge_services/v1alpha1/__init__.py @@ -30,6 +30,7 @@ from .types import TLSStage from .types import CheckPEMChainRequestSecretChain from .types import PlanDetails +from .types import PlanUsageDetails from .types import PipelineStages from .types import PurgeRequest from .types import TLSSecretsConfig @@ -115,6 +116,7 @@ "TLSStage", "CheckPEMChainRequestSecretChain", "PlanDetails", + "PlanUsageDetails", "PipelineStages", "PurgeRequest", "TLSSecretsConfig", diff --git a/scaleway/scaleway/edge_services/v1alpha1/marshalling.py b/scaleway/scaleway/edge_services/v1alpha1/marshalling.py index d9c1b61f7..f9145ff06 100644 --- a/scaleway/scaleway/edge_services/v1alpha1/marshalling.py +++ b/scaleway/scaleway/edge_services/v1alpha1/marshalling.py @@ -29,6 +29,7 @@ CheckLbOriginResponse, CheckPEMChainResponse, PlanDetails, + PlanUsageDetails, GetBillingResponse, ListBackendStagesResponse, ListCacheStagesResponse, @@ -634,9 +635,30 @@ def unmarshal_PlanDetails(data: Any) -> PlanDetails: if field is not None: args["pipeline_limit"] = field + field = data.get("waf_requests", None) + if field is not None: + args["waf_requests"] = field + return PlanDetails(**args) +def unmarshal_PlanUsageDetails(data: Any) -> PlanUsageDetails: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PlanUsageDetails' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("plan_cost", None) + if field is not None: + args["plan_cost"] = unmarshal_Money(field) + else: + args["plan_cost"] = None + + return PlanUsageDetails(**args) + + def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: if not isinstance(data, dict): raise TypeError( @@ -645,6 +667,12 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: args: Dict[str, Any] = {} + field = data.get("current_plan", None) + if field is not None: + args["current_plan"] = unmarshal_PlanDetails(field) + else: + args["current_plan"] = None + field = data.get("pipeline_number", None) if field is not None: args["pipeline_number"] = field @@ -657,11 +685,13 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: if field is not None: args["extra_cache_usage"] = field - field = data.get("current_plan", None) + field = data.get("current_plan_waf_usage", None) if field is not None: - args["current_plan"] = unmarshal_PlanDetails(field) - else: - args["current_plan"] = None + args["current_plan_waf_usage"] = field + + field = data.get("extra_waf_usage", None) + if field is not None: + args["extra_waf_usage"] = field field = data.get("plan_cost", None) if field is not None: @@ -675,12 +705,32 @@ def unmarshal_GetBillingResponse(data: Any) -> GetBillingResponse: else: args["extra_pipelines_cost"] = None + field = data.get("plans_usage_details", None) + if field is not None: + args["plans_usage_details"] = ( + {key: unmarshal_PlanUsageDetails(value) for key, value in field.items()} + if field is not None + else None + ) + field = data.get("extra_cache_cost", None) if field is not None: args["extra_cache_cost"] = unmarshal_Money(field) else: args["extra_cache_cost"] = None + field = data.get("extra_waf_cost", None) + if field is not None: + args["extra_waf_cost"] = unmarshal_Money(field) + else: + args["extra_waf_cost"] = None + + field = data.get("waf_add_on", None) + if field is not None: + args["waf_add_on"] = unmarshal_Money(field) + else: + args["waf_add_on"] = None + field = data.get("total_cost", None) if field is not None: args["total_cost"] = unmarshal_Money(field) diff --git a/scaleway/scaleway/edge_services/v1alpha1/types.py b/scaleway/scaleway/edge_services/v1alpha1/types.py index db2835ea0..a4121656a 100644 --- a/scaleway/scaleway/edge_services/v1alpha1/types.py +++ b/scaleway/scaleway/edge_services/v1alpha1/types.py @@ -5,7 +5,7 @@ from dataclasses import dataclass from datetime import datetime from enum import Enum -from typing import List, Optional +from typing import Dict, List, Optional from scaleway_core.bridge import ( Money, @@ -502,6 +502,19 @@ class PlanDetails: Number of pipelines included in subscription plan. """ + waf_requests: int + """ + Number of WAF requests included in subscription plan. + """ + + +@dataclass +class PlanUsageDetails: + plan_cost: Optional[Money] + """ + Cost to date (this month) for the corresponding Edge Services subscription plan. + """ + @dataclass class PipelineStages: @@ -758,6 +771,11 @@ class GetBillingRequest: @dataclass class GetBillingResponse: + current_plan: Optional[PlanDetails] + """ + Information on the currently-selected, active Edge Services subscription plan. + """ + pipeline_number: int """ Total number of pipelines currently configured. @@ -773,9 +791,14 @@ class GetBillingResponse: Total amount of extra data egressed from cache in gigabytes from the beginning of the month, not included in the subscription plans. """ - current_plan: Optional[PlanDetails] + current_plan_waf_usage: int """ - Information on the currently-selected, active Edge Services subscription plan. + Total number of requests processed by the WAF since the beginning of the current month, for the active subscription plan. + """ + + extra_waf_usage: int + """ + Total number of extra requests processed by the WAF from the beginning of the month, not included in the subscription plans. """ plan_cost: Optional[Money] @@ -788,11 +811,26 @@ class GetBillingResponse: Cost to date (this month) of pipelines not included in the subscription plans. """ + plans_usage_details: Dict[str, PlanUsageDetails] + """ + Detailed costs and usage for all Edge Services subscription plans that were activated during the month. + """ + extra_cache_cost: Optional[Money] """ Cost to date (this month) of the data egressed from the cache that is not included in the subscription plans. """ + extra_waf_cost: Optional[Money] + """ + Cost to date (this month) of the extra requests processed by the WAF that were not included in the subscription plans. + """ + + waf_add_on: Optional[Money] + """ + Cost of activating WAF add-on (where subscription plan does not include WAF). + """ + total_cost: Optional[Money] """ 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.