@scaleway/sdk-billing 2.2.0 → 2.2.1

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