@scaleway/sdk-billing 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/license.md +3 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.gen.d.ts +6 -0
- package/dist/index.gen.js +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v2/api.gen.d.ts +87 -0
- package/dist/v2/api.gen.js +74 -0
- package/dist/v2/index.gen.d.ts +4 -0
- package/dist/v2/index.gen.js +21 -0
- package/dist/v2/marshalling.gen.d.ts +12 -0
- package/dist/v2/marshalling.gen.js +88 -0
- package/dist/v2/metadata.gen.d.ts +30 -0
- package/dist/v2/metadata.gen.js +32 -0
- package/dist/v2/types.gen.d.ts +220 -0
- package/dist/v2/types.gen.js +0 -0
- package/dist/v2/validation-rules.gen.d.ts +12 -0
- package/dist/v2/validation-rules.gen.js +16 -0
- package/dist/v2beta1/api.gen.d.ts +96 -0
- package/dist/v2beta1/api.gen.js +81 -0
- package/dist/v2beta1/index.gen.d.ts +4 -0
- package/dist/v2beta1/index.gen.js +19 -0
- package/dist/v2beta1/marshalling.gen.d.ts +8 -0
- package/dist/v2beta1/marshalling.gen.js +135 -0
- package/dist/v2beta1/metadata.gen.d.ts +78 -0
- package/dist/v2beta1/metadata.gen.js +86 -0
- package/dist/v2beta1/types.gen.d.ts +533 -0
- package/dist/v2beta1/types.gen.js +0 -0
- package/dist/v2beta1/validation-rules.gen.d.ts +6 -0
- package/dist/v2beta1/validation-rules.gen.js +9 -0
- package/package.json +5 -5
- package/LICENSE +0 -191
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Discount, DownloadInvoiceRequest, ExportInvoicesRequest, FinOpsApiListChargesRequest, GetInvoiceRequest, Invoice, ListChargesResponse, ListConsumptionsRequest, ListConsumptionsResponse, ListDiscountsRequest, ListDiscountsResponse, ListInvoicesRequest, ListInvoicesResponse, ListTaxesRequest, ListTaxesResponse, RedeemCouponRequest } from './types.gen.js';
|
|
3
|
+
/**
|
|
4
|
+
* Billing API.
|
|
5
|
+
|
|
6
|
+
This API allows you to manage and query your Scaleway billing and consumption.
|
|
7
|
+
*/
|
|
8
|
+
export declare class API extends ParentAPI {
|
|
9
|
+
protected pageOfListConsumptions: (request?: Readonly<ListConsumptionsRequest>) => Promise<ListConsumptionsResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category.
|
|
12
|
+
*
|
|
13
|
+
* @param request - The request {@link ListConsumptionsRequest}
|
|
14
|
+
* @returns A Promise of ListConsumptionsResponse
|
|
15
|
+
*/
|
|
16
|
+
listConsumptions: (request?: Readonly<ListConsumptionsRequest>) => Promise<ListConsumptionsResponse> & {
|
|
17
|
+
all: () => Promise<import("./types.gen.js").ListConsumptionsResponseConsumption[]>;
|
|
18
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ListConsumptionsResponseConsumption[], void, void>;
|
|
19
|
+
};
|
|
20
|
+
protected pageOfListTaxes: (request?: Readonly<ListTaxesRequest>) => Promise<ListTaxesResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category.
|
|
23
|
+
*
|
|
24
|
+
* @param request - The request {@link ListTaxesRequest}
|
|
25
|
+
* @returns A Promise of ListTaxesResponse
|
|
26
|
+
*/
|
|
27
|
+
listTaxes: (request?: Readonly<ListTaxesRequest>) => Promise<ListTaxesResponse> & {
|
|
28
|
+
all: () => Promise<import("./types.gen.js").ListTaxesResponseTax[]>;
|
|
29
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ListTaxesResponseTax[], void, void>;
|
|
30
|
+
};
|
|
31
|
+
protected pageOfListInvoices: (request?: Readonly<ListInvoicesRequest>) => Promise<ListInvoicesResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* List invoices. List all your invoices, filtering by `start_date` and `invoice_type`. Each invoice has its own ID.
|
|
34
|
+
*
|
|
35
|
+
* @param request - The request {@link ListInvoicesRequest}
|
|
36
|
+
* @returns A Promise of ListInvoicesResponse
|
|
37
|
+
*/
|
|
38
|
+
listInvoices: (request?: Readonly<ListInvoicesRequest>) => Promise<ListInvoicesResponse> & {
|
|
39
|
+
all: () => Promise<Invoice[]>;
|
|
40
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Invoice[], void, void>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Export invoices. Export invoices in a CSV file.
|
|
44
|
+
*
|
|
45
|
+
* @param request - The request {@link ExportInvoicesRequest}
|
|
46
|
+
* @returns A Promise of Blob
|
|
47
|
+
*/
|
|
48
|
+
exportInvoices: (request?: Readonly<ExportInvoicesRequest>) => Promise<Blob>;
|
|
49
|
+
/**
|
|
50
|
+
* Get an invoice. Get a specific invoice, specified by its ID.
|
|
51
|
+
*
|
|
52
|
+
* @param request - The request {@link GetInvoiceRequest}
|
|
53
|
+
* @returns A Promise of Invoice
|
|
54
|
+
*/
|
|
55
|
+
getInvoice: (request: Readonly<GetInvoiceRequest>) => Promise<Invoice>;
|
|
56
|
+
/**
|
|
57
|
+
* Download an invoice. Download a specific invoice, specified by its ID.
|
|
58
|
+
*
|
|
59
|
+
* @param request - The request {@link DownloadInvoiceRequest}
|
|
60
|
+
* @returns A Promise of Blob
|
|
61
|
+
*/
|
|
62
|
+
downloadInvoice: (request: Readonly<DownloadInvoiceRequest>) => Promise<Blob>;
|
|
63
|
+
protected pageOfListDiscounts: (request?: Readonly<ListDiscountsRequest>) => Promise<ListDiscountsResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* List discounts. List all discounts for your Organization and usable categories, products, offers, references, regions and zones where the discount can be applied. As a reseller:
|
|
66
|
+
- If you do not specify an `organization_id` you will list the discounts applied to your own Organization and your customers
|
|
67
|
+
- If you indicate your `organization_id` you will list only the discounts applied to your Organization
|
|
68
|
+
- If you indicate `the organization_id` of one of your customers, you will list the discounts applied to their Organization.
|
|
69
|
+
*
|
|
70
|
+
* @param request - The request {@link ListDiscountsRequest}
|
|
71
|
+
* @returns A Promise of ListDiscountsResponse
|
|
72
|
+
*/
|
|
73
|
+
listDiscounts: (request?: Readonly<ListDiscountsRequest>) => Promise<ListDiscountsResponse> & {
|
|
74
|
+
all: () => Promise<Discount[]>;
|
|
75
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Discount[], void, void>;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Redeem coupon. Redeem a coupon given the related code.
|
|
79
|
+
*
|
|
80
|
+
* @param request - The request {@link RedeemCouponRequest}
|
|
81
|
+
* @returns A Promise of Discount
|
|
82
|
+
*/
|
|
83
|
+
redeemCoupon: (request: Readonly<RedeemCouponRequest>) => Promise<Discount>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Billing FinOps API.
|
|
87
|
+
*/
|
|
88
|
+
export declare class FinOpsAPI extends ParentAPI {
|
|
89
|
+
/**
|
|
90
|
+
* List charges. List charges for organizations or projects. You must specify at least `organization_ids` or `project_ids`.
|
|
91
|
+
*
|
|
92
|
+
* @param request - The request {@link FinOpsApiListChargesRequest}
|
|
93
|
+
* @returns A Promise of ListChargesResponse
|
|
94
|
+
*/
|
|
95
|
+
listCharges: (request?: Readonly<FinOpsApiListChargesRequest>) => Promise<ListChargesResponse>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { unmarshalDiscount, unmarshalInvoice, unmarshalListChargesResponse, unmarshalListConsumptionsResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse, unmarshalListTaxesResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { API as API$1, enrichForPagination, resolveOneOf, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
//#region src/v2beta1/api.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Billing API.
|
|
6
|
+
|
|
7
|
+
This API allows you to manage and query your Scaleway billing and consumption.
|
|
8
|
+
*/
|
|
9
|
+
var API = class extends API$1 {
|
|
10
|
+
constructor(..._args) {
|
|
11
|
+
super(..._args);
|
|
12
|
+
this.pageOfListConsumptions = (request = {}) => this.client.fetch({
|
|
13
|
+
method: "GET",
|
|
14
|
+
path: `/billing/v2beta1/consumptions`,
|
|
15
|
+
urlParams: urlParams(["billing_period", request.billingPeriod], ["category_name", request.categoryName], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
|
|
16
|
+
default: this.client.settings.defaultOrganizationId,
|
|
17
|
+
param: "organization_id",
|
|
18
|
+
value: request.organizationId
|
|
19
|
+
}, {
|
|
20
|
+
default: this.client.settings.defaultProjectId,
|
|
21
|
+
param: "project_id",
|
|
22
|
+
value: request.projectId
|
|
23
|
+
}])))
|
|
24
|
+
}, unmarshalListConsumptionsResponse);
|
|
25
|
+
this.listConsumptions = (request = {}) => enrichForPagination("consumptions", this.pageOfListConsumptions, request);
|
|
26
|
+
this.pageOfListTaxes = (request = {}) => this.client.fetch({
|
|
27
|
+
method: "GET",
|
|
28
|
+
path: `/billing/v2beta1/taxes`,
|
|
29
|
+
urlParams: urlParams(["billing_period", request.billingPeriod], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
30
|
+
}, unmarshalListTaxesResponse);
|
|
31
|
+
this.listTaxes = (request = {}) => enrichForPagination("taxes", this.pageOfListTaxes, request);
|
|
32
|
+
this.pageOfListInvoices = (request = {}) => this.client.fetch({
|
|
33
|
+
method: "GET",
|
|
34
|
+
path: `/billing/v2beta1/invoices`,
|
|
35
|
+
urlParams: urlParams(["billing_period_start_after", request.billingPeriodStartAfter], ["billing_period_start_before", request.billingPeriodStartBefore], ["invoice_type", request.invoiceType], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
36
|
+
}, unmarshalListInvoicesResponse);
|
|
37
|
+
this.listInvoices = (request = {}) => enrichForPagination("invoices", this.pageOfListInvoices, request);
|
|
38
|
+
this.exportInvoices = (request = {}) => this.client.fetch({
|
|
39
|
+
method: "GET",
|
|
40
|
+
path: `/billing/v2beta1/export-invoices`,
|
|
41
|
+
urlParams: urlParams(["dl", 1], ["billing_period_start_after", request.billingPeriodStartAfter], ["billing_period_start_before", request.billingPeriodStartBefore], ["file_type", request.fileType], ["invoice_type", request.invoiceType], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]),
|
|
42
|
+
responseType: "blob"
|
|
43
|
+
});
|
|
44
|
+
this.getInvoice = (request) => this.client.fetch({
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: `/billing/v2beta1/invoices/${validatePathParam("invoiceId", request.invoiceId)}`
|
|
47
|
+
}, unmarshalInvoice);
|
|
48
|
+
this.downloadInvoice = (request) => this.client.fetch({
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: `/billing/v2beta1/invoices/${validatePathParam("invoiceId", request.invoiceId)}/download`,
|
|
51
|
+
urlParams: urlParams(["dl", 1], ["file_type", request.fileType]),
|
|
52
|
+
responseType: "blob"
|
|
53
|
+
});
|
|
54
|
+
this.pageOfListDiscounts = (request = {}) => this.client.fetch({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/billing/v2beta1/discounts`,
|
|
57
|
+
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
58
|
+
}, unmarshalListDiscountsResponse);
|
|
59
|
+
this.listDiscounts = (request = {}) => enrichForPagination("discounts", this.pageOfListDiscounts, request);
|
|
60
|
+
this.redeemCoupon = (request) => this.client.fetch({
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: `/billing/v2beta1/redeem-coupon`,
|
|
63
|
+
urlParams: urlParams(["code", request.code], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId])
|
|
64
|
+
}, unmarshalDiscount);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Billing FinOps API.
|
|
69
|
+
*/
|
|
70
|
+
var FinOpsAPI = class extends API$1 {
|
|
71
|
+
constructor(..._args2) {
|
|
72
|
+
super(..._args2);
|
|
73
|
+
this.listCharges = (request = {}) => this.client.fetch({
|
|
74
|
+
method: "GET",
|
|
75
|
+
path: `/billing/v2beta1/charges`,
|
|
76
|
+
urlParams: urlParams(["clamp_to_time_range", request.clampToTimeRange], ["end_date_before", request.endDateBefore], ["invoice_ids", request.invoiceIds], ["order_by", request.orderBy], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ["project_ids", request.projectIds], ["resource_ids", request.resourceIds], ["resource_names", request.resourceNames], ["skus", request.skus], ["start_date_after", request.startDateAfter])
|
|
77
|
+
}, unmarshalListChargesResponse);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { API, FinOpsAPI };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { API, FinOpsAPI, } from './api.gen.js';
|
|
2
|
+
export * from './marshalling.gen.js';
|
|
3
|
+
export type { Charge, Discount, DiscountCoupon, DiscountDiscountMode, DiscountFilter, DiscountFilterType, DownloadInvoiceRequest, DownloadInvoiceRequestFileType, ExportInvoicesRequest, ExportInvoicesRequestFileType, ExportInvoicesRequestOrderBy, FinOpsApiListChargesRequest, GetInvoiceRequest, Invoice, InvoiceType, ListChargesRequestOrderBy, ListChargesResponse, ListConsumptionsRequest, ListConsumptionsRequestOrderBy, ListConsumptionsResponse, ListConsumptionsResponseConsumption, ListDiscountsRequest, ListDiscountsRequestOrderBy, ListDiscountsResponse, ListInvoicesRequest, ListInvoicesRequestOrderBy, ListInvoicesResponse, ListTaxesRequest, ListTaxesRequestOrderBy, ListTaxesResponse, ListTaxesResponseTax, RedeemCouponRequest, } from './types.gen.js';
|
|
4
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { unmarshalDiscount, unmarshalInvoice, unmarshalListChargesResponse, unmarshalListConsumptionsResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse, unmarshalListTaxesResponse } from "./marshalling.gen.js";
|
|
3
|
+
import { API, FinOpsAPI } from "./api.gen.js";
|
|
4
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
5
|
+
//#region src/v2beta1/index.gen.ts
|
|
6
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
API: () => API,
|
|
8
|
+
FinOpsAPI: () => FinOpsAPI,
|
|
9
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
10
|
+
unmarshalDiscount: () => unmarshalDiscount,
|
|
11
|
+
unmarshalInvoice: () => unmarshalInvoice,
|
|
12
|
+
unmarshalListChargesResponse: () => unmarshalListChargesResponse,
|
|
13
|
+
unmarshalListConsumptionsResponse: () => unmarshalListConsumptionsResponse,
|
|
14
|
+
unmarshalListDiscountsResponse: () => unmarshalListDiscountsResponse,
|
|
15
|
+
unmarshalListInvoicesResponse: () => unmarshalListInvoicesResponse,
|
|
16
|
+
unmarshalListTaxesResponse: () => unmarshalListTaxesResponse
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { API, FinOpsAPI, validation_rules_gen_exports as ValidationRules, index_gen_exports, unmarshalDiscount, unmarshalInvoice, unmarshalListChargesResponse, unmarshalListConsumptionsResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse, unmarshalListTaxesResponse };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Discount, Invoice, ListChargesResponse, ListConsumptionsResponse, ListDiscountsResponse, ListInvoicesResponse, ListTaxesResponse } from './types.gen.js';
|
|
2
|
+
export declare const unmarshalDiscount: (data: unknown) => Discount;
|
|
3
|
+
export declare const unmarshalInvoice: (data: unknown) => Invoice;
|
|
4
|
+
export declare const unmarshalListChargesResponse: (data: unknown) => ListChargesResponse;
|
|
5
|
+
export declare const unmarshalListConsumptionsResponse: (data: unknown) => ListConsumptionsResponse;
|
|
6
|
+
export declare const unmarshalListDiscountsResponse: (data: unknown) => ListDiscountsResponse;
|
|
7
|
+
export declare const unmarshalListInvoicesResponse: (data: unknown) => ListInvoicesResponse;
|
|
8
|
+
export declare const unmarshalListTaxesResponse: (data: unknown) => ListTaxesResponse;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney } from "@scaleway/sdk-client";
|
|
2
|
+
//#region src/v2beta1/marshalling.gen.ts
|
|
3
|
+
const unmarshalDiscountCoupon = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.`);
|
|
5
|
+
return { description: data.description };
|
|
6
|
+
};
|
|
7
|
+
const unmarshalDiscountFilter = (data) => {
|
|
8
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.`);
|
|
9
|
+
return {
|
|
10
|
+
exclude: data.exclude,
|
|
11
|
+
type: data.type,
|
|
12
|
+
value: data.value
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalDiscount = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Discount' failed as data isn't a dictionary.`);
|
|
17
|
+
return {
|
|
18
|
+
coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : void 0,
|
|
19
|
+
creationDate: unmarshalDate(data.creation_date),
|
|
20
|
+
description: data.description,
|
|
21
|
+
filters: unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter),
|
|
22
|
+
id: data.id,
|
|
23
|
+
mode: data.mode,
|
|
24
|
+
organizationId: data.organization_id,
|
|
25
|
+
startDate: unmarshalDate(data.start_date),
|
|
26
|
+
stopDate: unmarshalDate(data.stop_date),
|
|
27
|
+
value: data.value,
|
|
28
|
+
valueRemaining: data.value_remaining,
|
|
29
|
+
valueUsed: data.value_used
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const unmarshalInvoice = (data) => {
|
|
33
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
|
|
34
|
+
return {
|
|
35
|
+
billingPeriod: unmarshalDate(data.billing_period),
|
|
36
|
+
dueDate: unmarshalDate(data.due_date),
|
|
37
|
+
id: data.id,
|
|
38
|
+
issuedDate: unmarshalDate(data.issued_date),
|
|
39
|
+
number: data.number,
|
|
40
|
+
organizationId: data.organization_id,
|
|
41
|
+
organizationName: data.organization_name,
|
|
42
|
+
sellerName: data.seller_name,
|
|
43
|
+
startDate: unmarshalDate(data.start_date),
|
|
44
|
+
state: data.state,
|
|
45
|
+
stopDate: unmarshalDate(data.stop_date),
|
|
46
|
+
totalDiscount: data.total_discount ? unmarshalMoney(data.total_discount) : void 0,
|
|
47
|
+
totalTax: data.total_tax ? unmarshalMoney(data.total_tax) : void 0,
|
|
48
|
+
totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : void 0,
|
|
49
|
+
totalUndiscount: data.total_undiscount ? unmarshalMoney(data.total_undiscount) : void 0,
|
|
50
|
+
totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : void 0,
|
|
51
|
+
type: data.type
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const unmarshalCharge = (data) => {
|
|
55
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Charge' failed as data isn't a dictionary.`);
|
|
56
|
+
return {
|
|
57
|
+
endDate: unmarshalDate(data.end_date),
|
|
58
|
+
invoiceId: data.invoice_id,
|
|
59
|
+
organizationId: data.organization_id,
|
|
60
|
+
organizationName: data.organization_name,
|
|
61
|
+
price: data.price ? unmarshalMoney(data.price) : void 0,
|
|
62
|
+
projectId: data.project_id,
|
|
63
|
+
projectName: data.project_name,
|
|
64
|
+
resourceId: data.resource_id,
|
|
65
|
+
resourceName: data.resource_name,
|
|
66
|
+
sku: data.sku,
|
|
67
|
+
startDate: unmarshalDate(data.start_date),
|
|
68
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const unmarshalListChargesResponse = (data) => {
|
|
72
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListChargesResponse' failed as data isn't a dictionary.`);
|
|
73
|
+
return {
|
|
74
|
+
charges: unmarshalArrayOfObject(data.charges, unmarshalCharge),
|
|
75
|
+
nextPageToken: data.next_page_token
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
const unmarshalListConsumptionsResponseConsumption = (data) => {
|
|
79
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListConsumptionsResponseConsumption' failed as data isn't a dictionary.`);
|
|
80
|
+
return {
|
|
81
|
+
billedQuantity: data.billed_quantity,
|
|
82
|
+
categoryName: data.category_name,
|
|
83
|
+
consumerId: data.consumer_id,
|
|
84
|
+
organizationName: data.organization_name,
|
|
85
|
+
productName: data.product_name,
|
|
86
|
+
projectId: data.project_id,
|
|
87
|
+
projectName: data.project_name,
|
|
88
|
+
resourceName: data.resource_name,
|
|
89
|
+
sku: data.sku,
|
|
90
|
+
unit: data.unit,
|
|
91
|
+
value: data.value ? unmarshalMoney(data.value) : void 0
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const unmarshalListConsumptionsResponse = (data) => {
|
|
95
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListConsumptionsResponse' failed as data isn't a dictionary.`);
|
|
96
|
+
return {
|
|
97
|
+
consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalListConsumptionsResponseConsumption),
|
|
98
|
+
totalCount: data.total_count,
|
|
99
|
+
totalDiscountUntaxedValue: data.total_discount_untaxed_value,
|
|
100
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
const unmarshalListDiscountsResponse = (data) => {
|
|
104
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`);
|
|
105
|
+
return {
|
|
106
|
+
discounts: unmarshalArrayOfObject(data.discounts, unmarshalDiscount),
|
|
107
|
+
totalCount: data.total_count
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const unmarshalListInvoicesResponse = (data) => {
|
|
111
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);
|
|
112
|
+
return {
|
|
113
|
+
invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice),
|
|
114
|
+
totalCount: data.total_count
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const unmarshalListTaxesResponseTax = (data) => {
|
|
118
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTaxesResponseTax' failed as data isn't a dictionary.`);
|
|
119
|
+
return {
|
|
120
|
+
currency: data.currency,
|
|
121
|
+
description: data.description,
|
|
122
|
+
rate: data.rate,
|
|
123
|
+
totalTaxValue: data.total_tax_value
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
const unmarshalListTaxesResponse = (data) => {
|
|
127
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTaxesResponse' failed as data isn't a dictionary.`);
|
|
128
|
+
return {
|
|
129
|
+
taxes: unmarshalArrayOfObject(data.taxes, unmarshalListTaxesResponseTax),
|
|
130
|
+
totalCount: data.total_count,
|
|
131
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
//#endregion
|
|
135
|
+
export { unmarshalDiscount, unmarshalInvoice, unmarshalListChargesResponse, unmarshalListConsumptionsResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse, unmarshalListTaxesResponse };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const queriesMetadata: {
|
|
2
|
+
readonly namespace: 'billing';
|
|
3
|
+
readonly version: 'v2beta1';
|
|
4
|
+
readonly folderName: 'billingv2beta1';
|
|
5
|
+
readonly services: readonly [{
|
|
6
|
+
readonly apiClass: 'API';
|
|
7
|
+
readonly methods: readonly [{
|
|
8
|
+
readonly methodName: 'listConsumptions';
|
|
9
|
+
readonly protoName: 'ListConsumptions';
|
|
10
|
+
readonly paramsType: 'ListConsumptionsRequest';
|
|
11
|
+
readonly returnType: 'ListConsumptionsResponse';
|
|
12
|
+
readonly isList: true;
|
|
13
|
+
readonly paginationType: 'offset';
|
|
14
|
+
readonly pageParamKey: 'page';
|
|
15
|
+
readonly listItemType: 'ListConsumptionsResponseConsumption';
|
|
16
|
+
readonly isPrivate: false;
|
|
17
|
+
readonly description: '"';
|
|
18
|
+
}, {
|
|
19
|
+
readonly methodName: 'listTaxes';
|
|
20
|
+
readonly protoName: 'ListTaxes';
|
|
21
|
+
readonly paramsType: 'ListTaxesRequest';
|
|
22
|
+
readonly returnType: 'ListTaxesResponse';
|
|
23
|
+
readonly isList: true;
|
|
24
|
+
readonly paginationType: 'offset';
|
|
25
|
+
readonly pageParamKey: 'page';
|
|
26
|
+
readonly listItemType: 'ListTaxesResponseTax';
|
|
27
|
+
readonly isPrivate: false;
|
|
28
|
+
readonly description: '"';
|
|
29
|
+
}, {
|
|
30
|
+
readonly methodName: 'listInvoices';
|
|
31
|
+
readonly protoName: 'ListInvoices';
|
|
32
|
+
readonly paramsType: 'ListInvoicesRequest';
|
|
33
|
+
readonly returnType: 'ListInvoicesResponse';
|
|
34
|
+
readonly isList: true;
|
|
35
|
+
readonly paginationType: 'offset';
|
|
36
|
+
readonly pageParamKey: 'page';
|
|
37
|
+
readonly listItemType: 'Invoice';
|
|
38
|
+
readonly isPrivate: false;
|
|
39
|
+
readonly description: '"';
|
|
40
|
+
}, {
|
|
41
|
+
readonly methodName: 'getInvoice';
|
|
42
|
+
readonly protoName: 'GetInvoice';
|
|
43
|
+
readonly paramsType: 'GetInvoiceRequest';
|
|
44
|
+
readonly returnType: 'Invoice';
|
|
45
|
+
readonly isList: false;
|
|
46
|
+
readonly paginationType: 'none';
|
|
47
|
+
readonly isPrivate: false;
|
|
48
|
+
readonly description: '"';
|
|
49
|
+
}, {
|
|
50
|
+
readonly methodName: 'listDiscounts';
|
|
51
|
+
readonly protoName: 'ListDiscounts';
|
|
52
|
+
readonly paramsType: 'ListDiscountsRequest';
|
|
53
|
+
readonly returnType: 'ListDiscountsResponse';
|
|
54
|
+
readonly isList: true;
|
|
55
|
+
readonly paginationType: 'offset';
|
|
56
|
+
readonly pageParamKey: 'page';
|
|
57
|
+
readonly listItemType: 'Discount';
|
|
58
|
+
readonly isPrivate: false;
|
|
59
|
+
readonly description: '"';
|
|
60
|
+
}];
|
|
61
|
+
}, {
|
|
62
|
+
readonly apiClass: 'FinOpsAPI';
|
|
63
|
+
readonly methods: readonly [{
|
|
64
|
+
readonly methodName: 'listCharges';
|
|
65
|
+
readonly protoName: 'ListCharges';
|
|
66
|
+
readonly paramsType: 'FinOpsApiListChargesRequest';
|
|
67
|
+
readonly returnType: 'ListChargesResponse';
|
|
68
|
+
readonly isList: true;
|
|
69
|
+
readonly paginationType: 'cursor';
|
|
70
|
+
readonly pageParamKey: 'pageToken';
|
|
71
|
+
readonly listItemType: 'Charge';
|
|
72
|
+
readonly nextPageField: 'nextPageToken';
|
|
73
|
+
readonly isPrivate: false;
|
|
74
|
+
readonly description: '"';
|
|
75
|
+
}];
|
|
76
|
+
}];
|
|
77
|
+
};
|
|
78
|
+
export type QueriesMetadata = typeof queriesMetadata;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/v2beta1/metadata.gen.ts
|
|
2
|
+
const queriesMetadata = {
|
|
3
|
+
namespace: "billing",
|
|
4
|
+
version: "v2beta1",
|
|
5
|
+
folderName: "billingv2beta1",
|
|
6
|
+
services: [{
|
|
7
|
+
apiClass: "API",
|
|
8
|
+
methods: [
|
|
9
|
+
{
|
|
10
|
+
methodName: "listConsumptions",
|
|
11
|
+
protoName: "ListConsumptions",
|
|
12
|
+
paramsType: "ListConsumptionsRequest",
|
|
13
|
+
returnType: "ListConsumptionsResponse",
|
|
14
|
+
isList: true,
|
|
15
|
+
paginationType: "offset",
|
|
16
|
+
pageParamKey: "page",
|
|
17
|
+
listItemType: "ListConsumptionsResponseConsumption",
|
|
18
|
+
isPrivate: false,
|
|
19
|
+
description: "\""
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
methodName: "listTaxes",
|
|
23
|
+
protoName: "ListTaxes",
|
|
24
|
+
paramsType: "ListTaxesRequest",
|
|
25
|
+
returnType: "ListTaxesResponse",
|
|
26
|
+
isList: true,
|
|
27
|
+
paginationType: "offset",
|
|
28
|
+
pageParamKey: "page",
|
|
29
|
+
listItemType: "ListTaxesResponseTax",
|
|
30
|
+
isPrivate: false,
|
|
31
|
+
description: "\""
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
methodName: "listInvoices",
|
|
35
|
+
protoName: "ListInvoices",
|
|
36
|
+
paramsType: "ListInvoicesRequest",
|
|
37
|
+
returnType: "ListInvoicesResponse",
|
|
38
|
+
isList: true,
|
|
39
|
+
paginationType: "offset",
|
|
40
|
+
pageParamKey: "page",
|
|
41
|
+
listItemType: "Invoice",
|
|
42
|
+
isPrivate: false,
|
|
43
|
+
description: "\""
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
methodName: "getInvoice",
|
|
47
|
+
protoName: "GetInvoice",
|
|
48
|
+
paramsType: "GetInvoiceRequest",
|
|
49
|
+
returnType: "Invoice",
|
|
50
|
+
isList: false,
|
|
51
|
+
paginationType: "none",
|
|
52
|
+
isPrivate: false,
|
|
53
|
+
description: "\""
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
methodName: "listDiscounts",
|
|
57
|
+
protoName: "ListDiscounts",
|
|
58
|
+
paramsType: "ListDiscountsRequest",
|
|
59
|
+
returnType: "ListDiscountsResponse",
|
|
60
|
+
isList: true,
|
|
61
|
+
paginationType: "offset",
|
|
62
|
+
pageParamKey: "page",
|
|
63
|
+
listItemType: "Discount",
|
|
64
|
+
isPrivate: false,
|
|
65
|
+
description: "\""
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}, {
|
|
69
|
+
apiClass: "FinOpsAPI",
|
|
70
|
+
methods: [{
|
|
71
|
+
methodName: "listCharges",
|
|
72
|
+
protoName: "ListCharges",
|
|
73
|
+
paramsType: "FinOpsApiListChargesRequest",
|
|
74
|
+
returnType: "ListChargesResponse",
|
|
75
|
+
isList: true,
|
|
76
|
+
paginationType: "cursor",
|
|
77
|
+
pageParamKey: "pageToken",
|
|
78
|
+
listItemType: "Charge",
|
|
79
|
+
nextPageField: "nextPageToken",
|
|
80
|
+
isPrivate: false,
|
|
81
|
+
description: "\""
|
|
82
|
+
}]
|
|
83
|
+
}]
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { queriesMetadata };
|