@scaleway/sdk-billing 2.10.0 → 2.12.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.
@@ -0,0 +1,533 @@
1
+ import type { Money } from '@scaleway/sdk-client';
2
+ export type DiscountDiscountMode = 'unknown_discount_mode' | 'discount_mode_rate' | 'discount_mode_value' | 'discount_mode_splittable';
3
+ export type DiscountFilterType = 'unknown_type' | 'category_name' | 'product_name' | 'product_range' | 'resource_name' | 'region' | 'zone';
4
+ export type DownloadInvoiceRequestFileType = 'pdf';
5
+ export type ExportInvoicesRequestFileType = 'csv';
6
+ export type ExportInvoicesRequestOrderBy = 'invoice_number_desc' | 'invoice_number_asc' | 'start_date_desc' | 'start_date_asc' | 'issued_date_desc' | 'issued_date_asc' | 'due_date_desc' | 'due_date_asc' | 'total_untaxed_desc' | 'total_untaxed_asc' | 'total_taxed_desc' | 'total_taxed_asc' | 'invoice_type_desc' | 'invoice_type_asc';
7
+ export type InvoiceType = 'unknown_type' | 'periodic' | 'purchase' | 'credit_note';
8
+ export type ListChargesRequestOrderBy = 'start_date_asc' | 'start_date_desc';
9
+ export type ListConsumptionsRequestOrderBy = 'updated_at_desc' | 'updated_at_asc' | 'category_name_desc' | 'category_name_asc';
10
+ export type ListDiscountsRequestOrderBy = 'creation_date_desc' | 'creation_date_asc' | 'start_date_desc' | 'start_date_asc' | 'stop_date_desc' | 'stop_date_asc';
11
+ export type ListInvoicesRequestOrderBy = 'invoice_number_desc' | 'invoice_number_asc' | 'start_date_desc' | 'start_date_asc' | 'issued_date_desc' | 'issued_date_asc' | 'due_date_desc' | 'due_date_asc' | 'total_untaxed_desc' | 'total_untaxed_asc' | 'total_taxed_desc' | 'total_taxed_asc' | 'invoice_type_desc' | 'invoice_type_asc';
12
+ export type ListTaxesRequestOrderBy = 'updated_at_desc' | 'updated_at_asc' | 'category_name_desc' | 'category_name_asc';
13
+ export interface DiscountCoupon {
14
+ /**
15
+ * The description of the coupon.
16
+ */
17
+ description?: string;
18
+ }
19
+ export interface DiscountFilter {
20
+ /**
21
+ * Type of the filter (category name, product name, product range, resource name, region or zone).
22
+ */
23
+ type: DiscountFilterType;
24
+ /**
25
+ * Value of filter.
26
+ */
27
+ value: string;
28
+ /**
29
+ * Boolean to describe if filter is an excluding filter.
30
+ */
31
+ exclude: boolean;
32
+ }
33
+ export interface Charge {
34
+ /**
35
+ * ID of the charged organization.
36
+ */
37
+ organizationId: string;
38
+ /**
39
+ * Name of the charged organization.
40
+ */
41
+ organizationName: string;
42
+ /**
43
+ * ID of the charged project.
44
+ */
45
+ projectId: string;
46
+ /**
47
+ * Name of the charged project.
48
+ */
49
+ projectName: string;
50
+ /**
51
+ * ID of the SKU the charge is priced with.
52
+ */
53
+ sku: string;
54
+ /**
55
+ * ID of the invoice including the charge.
56
+ */
57
+ invoiceId: string;
58
+ /**
59
+ * ID of the resource that incurs the charge.
60
+ */
61
+ resourceId: string;
62
+ /**
63
+ * Optional display name assigned to the resource that incurs the charge.
64
+ */
65
+ resourceName?: string;
66
+ /**
67
+ * Price of the charge.
68
+ */
69
+ price?: Money;
70
+ /**
71
+ * Start date of the charge.
72
+ */
73
+ startDate?: Date;
74
+ /**
75
+ * End date of the charge, included.
76
+ */
77
+ endDate?: Date;
78
+ /**
79
+ * Date the charge was last updated.
80
+ */
81
+ updatedAt?: Date;
82
+ }
83
+ export interface ListConsumptionsResponseConsumption {
84
+ /**
85
+ * Monetary value of the consumption.
86
+ */
87
+ value?: Money;
88
+ /**
89
+ * The product name. For example, "VPC Public Gateway S", "VPC Public Gateway M" for the VPC product.
90
+ */
91
+ productName: string;
92
+ /**
93
+ * Identifies the reference based on the category.
94
+ */
95
+ resourceName: string;
96
+ /**
97
+ * Unique identifier of the product.
98
+ */
99
+ sku: string;
100
+ /**
101
+ * Project ID of the consumption.
102
+ */
103
+ projectId: string;
104
+ /**
105
+ * Name of consumption category.
106
+ */
107
+ categoryName: string;
108
+ /**
109
+ * Unit of consumed quantity.
110
+ */
111
+ unit: string;
112
+ /**
113
+ * Consumed quantity.
114
+ */
115
+ billedQuantity: string;
116
+ /**
117
+ * Organization ID of the consumer for this consumption.
118
+ */
119
+ consumerId: string;
120
+ /**
121
+ * Project name of the consumpiton.
122
+ */
123
+ projectName: string;
124
+ /**
125
+ * Organization name of the consumer for this consumption.
126
+ */
127
+ organizationName: string;
128
+ }
129
+ export interface Discount {
130
+ /**
131
+ * The ID of the discount.
132
+ */
133
+ id: string;
134
+ /**
135
+ * The creation date of the discount.
136
+ */
137
+ creationDate?: Date;
138
+ /**
139
+ * The Organization ID of the discount.
140
+ */
141
+ organizationId: string;
142
+ /**
143
+ * The description of the discount.
144
+ */
145
+ description: string;
146
+ /**
147
+ * The initial value of the discount.
148
+ */
149
+ value: number;
150
+ /**
151
+ * The value indicating how much of the discount has been used.
152
+ */
153
+ valueUsed: number;
154
+ /**
155
+ * The remaining value of the discount.
156
+ */
157
+ valueRemaining: number;
158
+ /**
159
+ * The mode of the discount.
160
+ */
161
+ mode: DiscountDiscountMode;
162
+ /**
163
+ * The start date of the discount.
164
+ */
165
+ startDate?: Date;
166
+ /**
167
+ * The stop date of the discount.
168
+ */
169
+ stopDate?: Date;
170
+ /**
171
+ * The description of the coupon.
172
+ */
173
+ coupon?: DiscountCoupon;
174
+ /**
175
+ * List of the discount scopes.
176
+ */
177
+ filters: DiscountFilter[];
178
+ }
179
+ export interface Invoice {
180
+ /**
181
+ * Invoice ID.
182
+ */
183
+ id: string;
184
+ organizationId: string;
185
+ organizationName: string;
186
+ /**
187
+ * Start date of the billing period.
188
+ */
189
+ startDate?: Date;
190
+ stopDate?: Date;
191
+ /**
192
+ * The billing period of the invoice in the YYYY-MM format.
193
+ */
194
+ billingPeriod?: Date;
195
+ /**
196
+ * Date when the invoice was sent to the customer.
197
+ */
198
+ issuedDate?: Date;
199
+ /**
200
+ * Payment time limit, set according to the Organization's payment conditions.
201
+ */
202
+ dueDate?: Date;
203
+ /**
204
+ * Total amount, untaxed.
205
+ */
206
+ totalUntaxed?: Money;
207
+ /**
208
+ * Total amount, taxed.
209
+ */
210
+ totalTaxed?: Money;
211
+ /**
212
+ * The total tax amount of the invoice.
213
+ */
214
+ totalTax?: Money;
215
+ /**
216
+ * The total discount amount of the invoice.
217
+ */
218
+ totalDiscount?: Money;
219
+ /**
220
+ * The total amount of the invoice before applying the discount.
221
+ */
222
+ totalUndiscount?: Money;
223
+ /**
224
+ * Type of invoice, either periodic or purchase.
225
+ */
226
+ type: InvoiceType;
227
+ /**
228
+ * The state of the Invoice.
229
+ */
230
+ state: string;
231
+ /**
232
+ * Invoice number.
233
+ */
234
+ number: number;
235
+ /**
236
+ * The name of the seller (Scaleway).
237
+ */
238
+ sellerName: string;
239
+ }
240
+ export interface ListTaxesResponseTax {
241
+ /**
242
+ * Description of the tax applied.
243
+ */
244
+ description: string;
245
+ /**
246
+ * The three-letter currency code.
247
+ */
248
+ currency: string;
249
+ /**
250
+ * Applied tax rate (0.2 means a VAT of 20%).
251
+ */
252
+ rate?: number;
253
+ /**
254
+ * The total tax value of the consumption.
255
+ */
256
+ totalTaxValue?: number;
257
+ }
258
+ export type DownloadInvoiceRequest = {
259
+ /**
260
+ * Invoice ID.
261
+ */
262
+ invoiceId: string;
263
+ /**
264
+ * File type. PDF by default.
265
+ */
266
+ fileType?: DownloadInvoiceRequestFileType;
267
+ };
268
+ export type ExportInvoicesRequest = {
269
+ /**
270
+ * Organization ID. If specified, only invoices from this Organization will be returned.
271
+ */
272
+ organizationId?: string;
273
+ /**
274
+ * Return only invoice with start date greater than billing_period_start.
275
+ */
276
+ billingPeriodStartAfter?: Date;
277
+ /**
278
+ * Return only invoice with start date less than billing_period_start.
279
+ */
280
+ billingPeriodStartBefore?: Date;
281
+ /**
282
+ * Invoice type. It can either be `periodic`, `purchase` or `credit_note`.
283
+ */
284
+ invoiceType?: InvoiceType;
285
+ /**
286
+ * Page number.
287
+ */
288
+ page?: number;
289
+ /**
290
+ * Positive integer lower or equal to 100 to select the number of items to return.
291
+ */
292
+ pageSize?: number;
293
+ /**
294
+ * How invoices are ordered in the response.
295
+ */
296
+ orderBy?: ExportInvoicesRequestOrderBy;
297
+ /**
298
+ * File format for exporting the invoice list.
299
+ */
300
+ fileType?: ExportInvoicesRequestFileType;
301
+ };
302
+ export type FinOpsApiListChargesRequest = {
303
+ /**
304
+ * Sort order of charges in the response.
305
+ */
306
+ orderBy?: ListChargesRequestOrderBy;
307
+ /**
308
+ * Token returned by previous call to list next paginated charges, omitted for first page.
309
+ */
310
+ pageToken?: string;
311
+ /**
312
+ * Number of charges to return per page.
313
+ */
314
+ pageSize?: number;
315
+ /**
316
+ * Minimum start date of charges to filter for, defaults to the start of the billing period.
317
+ */
318
+ startDateAfter?: Date;
319
+ /**
320
+ * Maximum end date of charges to filter for, defaults to the end of the billing period.
321
+ */
322
+ endDateBefore?: Date;
323
+ /**
324
+ * Invoice IDs to filter for, only charges from these invoices will be returned.
325
+ */
326
+ invoiceIds?: string[];
327
+ /**
328
+ * Organization ID to filter for, only charges for this organization will be returned.
329
+ */
330
+ organizationId?: string;
331
+ /**
332
+ * Project IDs to filter for, only charges for these projects will be returned.
333
+ */
334
+ projectIds?: string[];
335
+ /**
336
+ * Resource IDs to filter for, only charges for these resources will be returned.
337
+ */
338
+ resourceIds?: string[];
339
+ /**
340
+ * Resource display names to filter for, only charges for these resources will be returned.
341
+ */
342
+ resourceNames?: string[];
343
+ /**
344
+ * SKU IDs to filter for, only charges for these SKUs will be returned.
345
+ */
346
+ skus?: string[];
347
+ /**
348
+ * Clamp charges to the requested time range.
349
+ */
350
+ clampToTimeRange?: boolean;
351
+ };
352
+ export type GetInvoiceRequest = {
353
+ /**
354
+ * Invoice ID.
355
+ */
356
+ invoiceId: string;
357
+ };
358
+ export interface ListChargesResponse {
359
+ /**
360
+ * Paginated matching charges.
361
+ */
362
+ charges: Charge[];
363
+ /**
364
+ * Page token to use with following call to keep listing charges if there are more.
365
+ */
366
+ nextPageToken?: string;
367
+ }
368
+ export type ListConsumptionsRequest = {
369
+ /**
370
+ * Order consumptions list in the response by their update date.
371
+ */
372
+ orderBy?: ListConsumptionsRequestOrderBy;
373
+ /**
374
+ * Positive integer to choose the page to return.
375
+ */
376
+ page?: number;
377
+ /**
378
+ * Positive integer lower or equal to 100 to select the number of items to return.
379
+ */
380
+ pageSize?: number;
381
+ /**
382
+ * Filter by Organization ID.
383
+ *
384
+ * One-of ('projectIdentifier'): at most one of 'organizationId', 'projectId' could be set.
385
+ */
386
+ organizationId?: string;
387
+ /**
388
+ * Filter by Project ID.
389
+ *
390
+ * One-of ('projectIdentifier'): at most one of 'organizationId', 'projectId' could be set.
391
+ */
392
+ projectId?: string;
393
+ /**
394
+ * Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability).
395
+ */
396
+ categoryName?: string;
397
+ /**
398
+ * Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.
399
+ */
400
+ billingPeriod?: string;
401
+ };
402
+ export interface ListConsumptionsResponse {
403
+ /**
404
+ * Detailed consumption list.
405
+ */
406
+ consumptions: ListConsumptionsResponseConsumption[];
407
+ /**
408
+ * Total number of returned items.
409
+ */
410
+ totalCount: number;
411
+ /**
412
+ * Sum of all discounts, displayed only when no category or project ID filter is applied.
413
+ */
414
+ totalDiscountUntaxedValue: number;
415
+ /**
416
+ * Last consumption update date.
417
+ */
418
+ updatedAt?: Date;
419
+ }
420
+ export type ListDiscountsRequest = {
421
+ /**
422
+ * Order discounts in the response by their description.
423
+ */
424
+ orderBy?: ListDiscountsRequestOrderBy;
425
+ /**
426
+ * Positive integer to choose the page to return.
427
+ */
428
+ page?: number;
429
+ /**
430
+ * Positive integer lower or equal to 100 to select the number of items to return.
431
+ */
432
+ pageSize?: number;
433
+ /**
434
+ * ID of the organization.
435
+ */
436
+ organizationId?: string;
437
+ };
438
+ export interface ListDiscountsResponse {
439
+ /**
440
+ * Total number of discounts.
441
+ */
442
+ totalCount: number;
443
+ /**
444
+ * Paginated returned discounts.
445
+ */
446
+ discounts: Discount[];
447
+ }
448
+ export type ListInvoicesRequest = {
449
+ /**
450
+ * Organization ID. If specified, only invoices from this Organization will be returned.
451
+ */
452
+ organizationId?: string;
453
+ /**
454
+ * Return only invoice with start date greater than billing_period_start.
455
+ */
456
+ billingPeriodStartAfter?: Date;
457
+ /**
458
+ * Return only invoice with start date less than billing_period_start.
459
+ */
460
+ billingPeriodStartBefore?: Date;
461
+ /**
462
+ * Invoice type. It can either be `periodic`, `purchase` or `credit_note`.
463
+ */
464
+ invoiceType?: InvoiceType;
465
+ /**
466
+ * Page number.
467
+ */
468
+ page?: number;
469
+ /**
470
+ * Positive integer lower or equal to 100 to select the number of items to return.
471
+ */
472
+ pageSize?: number;
473
+ /**
474
+ * How invoices are ordered in the response.
475
+ */
476
+ orderBy?: ListInvoicesRequestOrderBy;
477
+ };
478
+ export interface ListInvoicesResponse {
479
+ /**
480
+ * Total number of invoices.
481
+ */
482
+ totalCount: number;
483
+ /**
484
+ * Paginated returned invoices.
485
+ */
486
+ invoices: Invoice[];
487
+ }
488
+ export type ListTaxesRequest = {
489
+ /**
490
+ * Order consumed taxes list in the response by their update date.
491
+ */
492
+ orderBy?: ListTaxesRequestOrderBy;
493
+ /**
494
+ * Page number.
495
+ */
496
+ page?: number;
497
+ /**
498
+ * Positive integer lower or equal to 100 to select the number of items to return.
499
+ */
500
+ pageSize?: number;
501
+ /**
502
+ * Filter by Organization ID.
503
+ */
504
+ organizationId?: string;
505
+ /**
506
+ * Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.
507
+ */
508
+ billingPeriod?: string;
509
+ };
510
+ export interface ListTaxesResponse {
511
+ /**
512
+ * Detailed consumption tax.
513
+ */
514
+ taxes: ListTaxesResponseTax[];
515
+ /**
516
+ * Total number of returned items.
517
+ */
518
+ totalCount: number;
519
+ /**
520
+ * Last consumption update date.
521
+ */
522
+ updatedAt?: Date;
523
+ }
524
+ export type RedeemCouponRequest = {
525
+ /**
526
+ * The Organization ID of the discount.
527
+ */
528
+ organizationId?: string;
529
+ /**
530
+ * The code of the coupon to redeem.
531
+ */
532
+ code: string;
533
+ };
File without changes
@@ -0,0 +1,6 @@
1
+ export declare const FinOpsApiListChargesRequest: {
2
+ pageSize: {
3
+ greaterThanOrEqual: number;
4
+ lessThanOrEqual: number;
5
+ };
6
+ };
@@ -0,0 +1,9 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/v2beta1/validation-rules.gen.ts
3
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({ FinOpsApiListChargesRequest: () => FinOpsApiListChargesRequest });
4
+ const FinOpsApiListChargesRequest = { pageSize: {
5
+ greaterThanOrEqual: 1,
6
+ lessThanOrEqual: 1e3
7
+ } };
8
+ //#endregion
9
+ export { FinOpsApiListChargesRequest, validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-billing",
3
- "version": "2.10.0",
3
+ "version": "2.12.0",
4
4
  "description": "Scaleway SDK billing",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@scaleway/random-name": "6.0.2",
36
- "@scaleway/sdk-std": "2.5.0"
36
+ "@scaleway/sdk-std": "2.6.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@repo/configs": "^0.1.1",
40
- "@scaleway/sdk-client": "^2.5.0"
39
+ "@scaleway/sdk-client": "^2.6.0",
40
+ "@repo/configs": "^0.1.1"
41
41
  },
42
42
  "peerDependencies": {
43
- "@scaleway/sdk-client": "^2.5.0"
43
+ "@scaleway/sdk-client": "^2.6.0"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=20.20.2"