Skip to content

Commit d5e8f07

Browse files
committed
feat: update generated APIs
1 parent b985b98 commit d5e8f07

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

packages/clients/src/api/edge_services/v1alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type {
6969
Plan,
7070
PlanDetails,
7171
PlanName,
72+
PlanUsageDetails,
7273
PurgeRequest,
7374
PurgeRequestStatus,
7475
ScalewayLb,

packages/clients/src/api/edge_services/v1alpha1/marshalling.gen.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
resolveOneOf,
66
unmarshalArrayOfObject,
77
unmarshalDate,
8+
unmarshalMapOfObject,
89
unmarshalMoney,
910
} from '../../../bridge'
1011
import type { DefaultValues } from '../../../bridge'
@@ -39,6 +40,7 @@ import type {
3940
PipelineStages,
4041
Plan,
4142
PlanDetails,
43+
PlanUsageDetails,
4244
PurgeRequest,
4345
ScalewayLb,
4446
ScalewayLbBackendConfig,
@@ -323,9 +325,22 @@ const unmarshalPlanDetails = (data: unknown): PlanDetails => {
323325
packageGb: data.package_gb,
324326
pipelineLimit: data.pipeline_limit,
325327
planName: data.plan_name,
328+
wafRequests: data.waf_requests,
326329
} as PlanDetails
327330
}
328331

332+
const unmarshalPlanUsageDetails = (data: unknown): PlanUsageDetails => {
333+
if (!isJSONObject(data)) {
334+
throw new TypeError(
335+
`Unmarshalling the type 'PlanUsageDetails' failed as data isn't a dictionary.`,
336+
)
337+
}
338+
339+
return {
340+
planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : undefined,
341+
} as PlanUsageDetails
342+
}
343+
329344
export const unmarshalGetBillingResponse = (
330345
data: unknown,
331346
): GetBillingResponse => {
@@ -340,16 +355,26 @@ export const unmarshalGetBillingResponse = (
340355
? unmarshalPlanDetails(data.current_plan)
341356
: undefined,
342357
currentPlanCacheUsage: data.current_plan_cache_usage,
358+
currentPlanWafUsage: data.current_plan_waf_usage,
343359
extraCacheCost: data.extra_cache_cost
344360
? unmarshalMoney(data.extra_cache_cost)
345361
: undefined,
346362
extraCacheUsage: data.extra_cache_usage,
347363
extraPipelinesCost: data.extra_pipelines_cost
348364
? unmarshalMoney(data.extra_pipelines_cost)
349365
: undefined,
366+
extraWafCost: data.extra_waf_cost
367+
? unmarshalMoney(data.extra_waf_cost)
368+
: undefined,
369+
extraWafUsage: data.extra_waf_usage,
350370
pipelineNumber: data.pipeline_number,
351371
planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : undefined,
372+
plansUsageDetails: unmarshalMapOfObject(
373+
data.plans_usage_details,
374+
unmarshalPlanUsageDetails,
375+
),
352376
totalCost: data.total_cost ? unmarshalMoney(data.total_cost) : undefined,
377+
wafAddOn: data.waf_add_on ? unmarshalMoney(data.waf_add_on) : undefined,
353378
} as GetBillingResponse
354379
}
355380

packages/clients/src/api/edge_services/v1alpha1/types.gen.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ export interface PlanDetails {
297297
packageGb: number
298298
/** Number of pipelines included in subscription plan. */
299299
pipelineLimit: number
300+
/** Number of WAF requests included in subscription plan. */
301+
wafRequests: number
302+
}
303+
304+
export interface PlanUsageDetails {
305+
/**
306+
* Cost to date (this month) for the corresponding Edge Services subscription
307+
* plan.
308+
*/
309+
planCost?: Money
300310
}
301311

302312
export interface PipelineStages {
@@ -562,6 +572,31 @@ export interface GetBillingResponse {
562572
* included in the subscription plans.
563573
*/
564574
extraCacheCost?: Money
575+
/**
576+
* Total number of requests processed by the WAF since the beginning of the
577+
* current month, for the active subscription plan.
578+
*/
579+
currentPlanWafUsage: number
580+
/**
581+
* Total number of extra requests processed by the WAF from the beginning of
582+
* the month, not included in the subscription plans.
583+
*/
584+
extraWafUsage: number
585+
/**
586+
* Cost to date (this month) of the extra requests processed by the WAF that
587+
* were not included in the subscription plans.
588+
*/
589+
extraWafCost?: Money
590+
/**
591+
* Cost of activating WAF add-on (where subscription plan does not include
592+
* WAF).
593+
*/
594+
wafAddOn?: Money
595+
/**
596+
* Detailed costs and usage for all Edge Services subscription plans that were
597+
* activated during the month.
598+
*/
599+
plansUsageDetails: Record<string, PlanUsageDetails>
565600
/**
566601
* Total cost to date (this month) of all Edge Services resources including
567602
* active subscription plan, previously active plans, extra pipelines and

0 commit comments

Comments
 (0)