@scaleway/sdk-billing 2.1.1 → 2.2.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/v2beta1/api.gen.js
CHANGED
|
@@ -10,19 +10,24 @@ class API extends API$1 {
|
|
|
10
10
|
["category_name", request.categoryName],
|
|
11
11
|
["order_by", request.orderBy],
|
|
12
12
|
["page", request.page],
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
[
|
|
14
|
+
"page_size",
|
|
15
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
16
|
+
],
|
|
17
|
+
...Object.entries(
|
|
18
|
+
resolveOneOf([
|
|
19
|
+
{
|
|
20
|
+
default: this.client.settings.defaultOrganizationId,
|
|
21
|
+
param: "organization_id",
|
|
22
|
+
value: request.organizationId
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
default: this.client.settings.defaultProjectId,
|
|
26
|
+
param: "project_id",
|
|
27
|
+
value: request.projectId
|
|
28
|
+
}
|
|
29
|
+
])
|
|
30
|
+
)
|
|
26
31
|
)
|
|
27
32
|
},
|
|
28
33
|
unmarshalListConsumptionsResponse
|
|
@@ -41,9 +46,15 @@ class API extends API$1 {
|
|
|
41
46
|
urlParams: urlParams(
|
|
42
47
|
["billing_period", request.billingPeriod],
|
|
43
48
|
["order_by", request.orderBy],
|
|
44
|
-
[
|
|
49
|
+
[
|
|
50
|
+
"organization_id",
|
|
51
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
52
|
+
],
|
|
45
53
|
["page", request.page],
|
|
46
|
-
[
|
|
54
|
+
[
|
|
55
|
+
"page_size",
|
|
56
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
57
|
+
]
|
|
47
58
|
)
|
|
48
59
|
},
|
|
49
60
|
unmarshalListTaxesResponse
|
|
@@ -66,7 +77,10 @@ class API extends API$1 {
|
|
|
66
77
|
["order_by", request.orderBy],
|
|
67
78
|
["organization_id", request.organizationId],
|
|
68
79
|
["page", request.page],
|
|
69
|
-
[
|
|
80
|
+
[
|
|
81
|
+
"page_size",
|
|
82
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
83
|
+
]
|
|
70
84
|
)
|
|
71
85
|
},
|
|
72
86
|
unmarshalListInvoicesResponse
|
|
@@ -84,24 +98,22 @@ class API extends API$1 {
|
|
|
84
98
|
* @param request - The request {@link ExportInvoicesRequest}
|
|
85
99
|
* @returns A Promise of Blob
|
|
86
100
|
*/
|
|
87
|
-
exportInvoices = (request = {}) => this.client.fetch(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
);
|
|
101
|
+
exportInvoices = (request = {}) => this.client.fetch({
|
|
102
|
+
method: "GET",
|
|
103
|
+
path: `/billing/v2beta1/export-invoices`,
|
|
104
|
+
urlParams: urlParams(
|
|
105
|
+
["dl", 1],
|
|
106
|
+
["billing_period_start_after", request.billingPeriodStartAfter],
|
|
107
|
+
["billing_period_start_before", request.billingPeriodStartBefore],
|
|
108
|
+
["file_type", request.fileType],
|
|
109
|
+
["invoice_type", request.invoiceType],
|
|
110
|
+
["order_by", request.orderBy],
|
|
111
|
+
["organization_id", request.organizationId],
|
|
112
|
+
["page", request.page],
|
|
113
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
114
|
+
),
|
|
115
|
+
responseType: "blob"
|
|
116
|
+
});
|
|
105
117
|
/**
|
|
106
118
|
* Get an invoice. Get a specific invoice, specified by its ID.
|
|
107
119
|
*
|
|
@@ -121,17 +133,12 @@ class API extends API$1 {
|
|
|
121
133
|
* @param request - The request {@link DownloadInvoiceRequest}
|
|
122
134
|
* @returns A Promise of Blob
|
|
123
135
|
*/
|
|
124
|
-
downloadInvoice = (request) => this.client.fetch(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
["file_type", request.fileType]
|
|
131
|
-
),
|
|
132
|
-
responseType: "blob"
|
|
133
|
-
}
|
|
134
|
-
);
|
|
136
|
+
downloadInvoice = (request) => this.client.fetch({
|
|
137
|
+
method: "GET",
|
|
138
|
+
path: `/billing/v2beta1/invoices/${validatePathParam("invoiceId", request.invoiceId)}/download`,
|
|
139
|
+
urlParams: urlParams(["dl", 1], ["file_type", request.fileType]),
|
|
140
|
+
responseType: "blob"
|
|
141
|
+
});
|
|
135
142
|
pageOfListDiscounts = (request = {}) => this.client.fetch(
|
|
136
143
|
{
|
|
137
144
|
method: "GET",
|
|
@@ -140,7 +147,10 @@ class API extends API$1 {
|
|
|
140
147
|
["order_by", request.orderBy],
|
|
141
148
|
["organization_id", request.organizationId],
|
|
142
149
|
["page", request.page],
|
|
143
|
-
[
|
|
150
|
+
[
|
|
151
|
+
"page_size",
|
|
152
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
153
|
+
]
|
|
144
154
|
)
|
|
145
155
|
},
|
|
146
156
|
unmarshalListDiscountsResponse
|
|
@@ -167,7 +177,10 @@ class API extends API$1 {
|
|
|
167
177
|
path: `/billing/v2beta1/redeem-coupon`,
|
|
168
178
|
urlParams: urlParams(
|
|
169
179
|
["code", request.code],
|
|
170
|
-
[
|
|
180
|
+
[
|
|
181
|
+
"organization_id",
|
|
182
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
183
|
+
]
|
|
171
184
|
)
|
|
172
185
|
},
|
|
173
186
|
unmarshalDiscount
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { API
|
|
1
|
+
export { API } from './api.gen.js';
|
|
2
2
|
export * from './marshalling.gen.js';
|
|
3
3
|
export type { Discount, DiscountCoupon, DiscountDiscountMode, DiscountFilter, DiscountFilterType, DownloadInvoiceRequest, DownloadInvoiceRequestFileType, ExportInvoicesRequest, ExportInvoicesRequestFileType, ExportInvoicesRequestOrderBy, GetInvoiceRequest, Invoice, InvoiceType, ListConsumptionsRequest, ListConsumptionsRequestOrderBy, ListConsumptionsResponse, ListConsumptionsResponseConsumption, ListDiscountsRequest, ListDiscountsRequestOrderBy, ListDiscountsResponse, ListInvoicesRequest, ListInvoicesRequestOrderBy, ListInvoicesResponse, ListTaxesRequest, ListTaxesRequestOrderBy, ListTaxesResponse, ListTaxesResponseTax, RedeemCouponRequest, } from './types.gen.js';
|
|
@@ -93,7 +93,10 @@ const unmarshalListConsumptionsResponse = (data) => {
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
-
consumptions: unmarshalArrayOfObject(
|
|
96
|
+
consumptions: unmarshalArrayOfObject(
|
|
97
|
+
data.consumptions,
|
|
98
|
+
unmarshalListConsumptionsResponseConsumption
|
|
99
|
+
),
|
|
97
100
|
totalCount: data.total_count,
|
|
98
101
|
totalDiscountUntaxedValue: data.total_discount_untaxed_value,
|
|
99
102
|
updatedAt: unmarshalDate(data.updated_at)
|