@scaleway/sdk-product-catalog 1.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/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ https://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2019 Scaleway.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ https://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index_gen = require("./v2alpha1/index.gen.cjs");
4
+ exports.ProductCatalogv2alpha1 = index_gen;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as ProductCatalogv2alpha1 from './v2alpha1/index.gen';
@@ -0,0 +1,4 @@
1
+ import * as index_gen from "./v2alpha1/index.gen.js";
2
+ export {
3
+ index_gen as ProductCatalogv2alpha1
4
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const marshalling_gen = require("./marshalling.gen.cjs");
5
+ class PublicCatalogAPI extends sdkClient.API {
6
+ pageOfListPublicCatalogProducts = (request = {}) => this.client.fetch(
7
+ {
8
+ method: "GET",
9
+ path: `/product-catalog/v2alpha1/public-catalog/products`,
10
+ urlParams: sdkClient.urlParams(
11
+ ["page", request.page],
12
+ [
13
+ "page_size",
14
+ request.pageSize ?? this.client.settings.defaultPageSize
15
+ ]
16
+ )
17
+ },
18
+ marshalling_gen.unmarshalListPublicCatalogProductsResponse
19
+ );
20
+ /**
21
+ * List all available products. List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
22
+ *
23
+ * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
24
+ * @returns A Promise of ListPublicCatalogProductsResponse
25
+ */
26
+ listPublicCatalogProducts = (request = {}) => sdkClient.enrichForPagination(
27
+ "products",
28
+ this.pageOfListPublicCatalogProducts,
29
+ request
30
+ );
31
+ }
32
+ exports.PublicCatalogAPI = PublicCatalogAPI;
@@ -0,0 +1,18 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest } from './types.gen';
3
+ /**
4
+ * Product Catalog API.
5
+ */
6
+ export declare class PublicCatalogAPI extends ParentAPI {
7
+ protected pageOfListPublicCatalogProducts: (request?: Readonly<PublicCatalogApiListPublicCatalogProductsRequest>) => Promise<ListPublicCatalogProductsResponse>;
8
+ /**
9
+ * List all available products. List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
10
+ *
11
+ * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
12
+ * @returns A Promise of ListPublicCatalogProductsResponse
13
+ */
14
+ listPublicCatalogProducts: (request?: Readonly<PublicCatalogApiListPublicCatalogProductsRequest>) => Promise<ListPublicCatalogProductsResponse> & {
15
+ all: () => Promise<import("./types.gen").PublicCatalogProduct[]>;
16
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").PublicCatalogProduct[], void, void>;
17
+ };
18
+ }
@@ -0,0 +1,32 @@
1
+ import { API, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
+ import { unmarshalListPublicCatalogProductsResponse } from "./marshalling.gen.js";
3
+ class PublicCatalogAPI extends API {
4
+ pageOfListPublicCatalogProducts = (request = {}) => this.client.fetch(
5
+ {
6
+ method: "GET",
7
+ path: `/product-catalog/v2alpha1/public-catalog/products`,
8
+ urlParams: urlParams(
9
+ ["page", request.page],
10
+ [
11
+ "page_size",
12
+ request.pageSize ?? this.client.settings.defaultPageSize
13
+ ]
14
+ )
15
+ },
16
+ unmarshalListPublicCatalogProductsResponse
17
+ );
18
+ /**
19
+ * List all available products. List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
20
+ *
21
+ * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
22
+ * @returns A Promise of ListPublicCatalogProductsResponse
23
+ */
24
+ listPublicCatalogProducts = (request = {}) => enrichForPagination(
25
+ "products",
26
+ this.pageOfListPublicCatalogProducts,
27
+ request
28
+ );
29
+ }
30
+ export {
31
+ PublicCatalogAPI
32
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const marshalling_gen = require("./marshalling.gen.cjs");
5
+ const validationRules_gen = require("./validation-rules.gen.cjs");
6
+ exports.PublicCatalogAPI = api_gen.PublicCatalogAPI;
7
+ exports.unmarshalListPublicCatalogProductsResponse = marshalling_gen.unmarshalListPublicCatalogProductsResponse;
8
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,4 @@
1
+ export { PublicCatalogAPI } from './api.gen';
2
+ export * from './marshalling.gen';
3
+ export type { ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, } from './types.gen';
4
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,8 @@
1
+ import { PublicCatalogAPI } from "./api.gen.js";
2
+ import { unmarshalListPublicCatalogProductsResponse } from "./marshalling.gen.js";
3
+ import * as validationRules_gen from "./validation-rules.gen.js";
4
+ export {
5
+ PublicCatalogAPI,
6
+ validationRules_gen as ValidationRules,
7
+ unmarshalListPublicCatalogProductsResponse
8
+ };
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data) => {
5
+ if (!sdkClient.isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ benchmark: data.benchmark,
12
+ coresPerSocket: data.cores_per_socket,
13
+ frequency: data.frequency,
14
+ sockets: data.sockets,
15
+ threadsPerCore: data.threads_per_core
16
+ };
17
+ };
18
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data) => {
19
+ if (!sdkClient.isJSONObject(data)) {
20
+ throw new TypeError(
21
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`
22
+ );
23
+ }
24
+ return {
25
+ count: data.count
26
+ };
27
+ };
28
+ const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data) => {
29
+ if (!sdkClient.isJSONObject(data)) {
30
+ throw new TypeError(
31
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`
32
+ );
33
+ }
34
+ return {
35
+ arch: data.arch,
36
+ description: data.description,
37
+ physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(
38
+ data.physical
39
+ ) : void 0,
40
+ threads: data.threads,
41
+ type: data.type,
42
+ virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : void 0
43
+ };
44
+ };
45
+ const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data) => {
46
+ if (!sdkClient.isJSONObject(data)) {
47
+ throw new TypeError(
48
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`
49
+ );
50
+ }
51
+ return {
52
+ count: data.count,
53
+ description: data.description,
54
+ type: data.type
55
+ };
56
+ };
57
+ const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data) => {
58
+ if (!sdkClient.isJSONObject(data)) {
59
+ throw new TypeError(
60
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`
61
+ );
62
+ }
63
+ return {
64
+ description: data.description,
65
+ internalBandwidth: data.internal_bandwidth,
66
+ maxPublicBandwidth: data.max_public_bandwidth,
67
+ publicBandwidth: data.public_bandwidth
68
+ };
69
+ };
70
+ const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data) => {
71
+ if (!sdkClient.isJSONObject(data)) {
72
+ throw new TypeError(
73
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`
74
+ );
75
+ }
76
+ return {
77
+ description: data.description,
78
+ size: data.size,
79
+ type: data.type
80
+ };
81
+ };
82
+ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data) => {
83
+ if (!sdkClient.isJSONObject(data)) {
84
+ throw new TypeError(
85
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`
86
+ );
87
+ }
88
+ return {
89
+ description: data.description,
90
+ total: data.total
91
+ };
92
+ };
93
+ const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data) => {
94
+ if (!sdkClient.isJSONObject(data)) {
95
+ throw new TypeError(
96
+ `Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`
97
+ );
98
+ }
99
+ return {
100
+ range: data.range
101
+ };
102
+ };
103
+ const unmarshalPublicCatalogProductPropertiesDedibox = (data) => {
104
+ if (!sdkClient.isJSONObject(data)) {
105
+ throw new TypeError(
106
+ `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`
107
+ );
108
+ }
109
+ return {
110
+ range: data.range
111
+ };
112
+ };
113
+ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
114
+ if (!sdkClient.isJSONObject(data)) {
115
+ throw new TypeError(
116
+ `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`
117
+ );
118
+ }
119
+ return {
120
+ range: data.range
121
+ };
122
+ };
123
+ const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
124
+ if (!sdkClient.isJSONObject(data)) {
125
+ throw new TypeError(
126
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`
127
+ );
128
+ }
129
+ return {
130
+ cpu: data.cpu ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) : void 0,
131
+ gpu: data.gpu ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) : void 0,
132
+ network: data.network ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) : void 0,
133
+ ram: data.ram ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) : void 0,
134
+ storage: data.storage ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) : void 0
135
+ };
136
+ };
137
+ const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
138
+ if (!sdkClient.isJSONObject(data)) {
139
+ throw new TypeError(
140
+ `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`
141
+ );
142
+ }
143
+ return {
144
+ range: data.range
145
+ };
146
+ };
147
+ const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
148
+ if (!sdkClient.isJSONObject(data)) {
149
+ throw new TypeError(
150
+ `Unmarshalling the type 'PublicCatalogProductEnvironmentalImpactEstimation' failed as data isn't a dictionary.`
151
+ );
152
+ }
153
+ return {
154
+ kgCo2Equivalent: data.kg_co2_equivalent,
155
+ m3WaterUsage: data.m3_water_usage
156
+ };
157
+ };
158
+ const unmarshalPublicCatalogProductLocality = (data) => {
159
+ if (!sdkClient.isJSONObject(data)) {
160
+ throw new TypeError(
161
+ `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`
162
+ );
163
+ }
164
+ return {
165
+ datacenter: data.datacenter,
166
+ global: data.global,
167
+ region: data.region,
168
+ zone: data.zone
169
+ };
170
+ };
171
+ const unmarshalPublicCatalogProductPrice = (data) => {
172
+ if (!sdkClient.isJSONObject(data)) {
173
+ throw new TypeError(
174
+ `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`
175
+ );
176
+ }
177
+ return {
178
+ retailPrice: data.retail_price ? sdkClient.unmarshalMoney(data.retail_price) : void 0
179
+ };
180
+ };
181
+ const unmarshalPublicCatalogProductProperties = (data) => {
182
+ if (!sdkClient.isJSONObject(data)) {
183
+ throw new TypeError(
184
+ `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`
185
+ );
186
+ }
187
+ return {
188
+ appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : void 0,
189
+ dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
190
+ elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
191
+ hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
192
+ instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0
193
+ };
194
+ };
195
+ const unmarshalPublicCatalogProductUnitOfMeasure = (data) => {
196
+ if (!sdkClient.isJSONObject(data)) {
197
+ throw new TypeError(
198
+ `Unmarshalling the type 'PublicCatalogProductUnitOfMeasure' failed as data isn't a dictionary.`
199
+ );
200
+ }
201
+ return {
202
+ size: data.size,
203
+ unit: data.unit
204
+ };
205
+ };
206
+ const unmarshalPublicCatalogProduct = (data) => {
207
+ if (!sdkClient.isJSONObject(data)) {
208
+ throw new TypeError(
209
+ `Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`
210
+ );
211
+ }
212
+ return {
213
+ description: data.description,
214
+ environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
215
+ data.environmental_impact_estimation
216
+ ) : void 0,
217
+ locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
218
+ price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
219
+ product: data.product,
220
+ properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
221
+ serviceCategory: data.service_category,
222
+ sku: data.sku,
223
+ unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : void 0,
224
+ variant: data.variant
225
+ };
226
+ };
227
+ const unmarshalListPublicCatalogProductsResponse = (data) => {
228
+ if (!sdkClient.isJSONObject(data)) {
229
+ throw new TypeError(
230
+ `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`
231
+ );
232
+ }
233
+ return {
234
+ products: sdkClient.unmarshalArrayOfObject(
235
+ data.products,
236
+ unmarshalPublicCatalogProduct
237
+ ),
238
+ totalCount: data.total_count
239
+ };
240
+ };
241
+ exports.unmarshalListPublicCatalogProductsResponse = unmarshalListPublicCatalogProductsResponse;
@@ -0,0 +1,2 @@
1
+ import type { ListPublicCatalogProductsResponse } from './types.gen';
2
+ export declare const unmarshalListPublicCatalogProductsResponse: (data: unknown) => ListPublicCatalogProductsResponse;
@@ -0,0 +1,241 @@
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalMoney } from "@scaleway/sdk-client";
2
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data) => {
3
+ if (!isJSONObject(data)) {
4
+ throw new TypeError(
5
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`
6
+ );
7
+ }
8
+ return {
9
+ benchmark: data.benchmark,
10
+ coresPerSocket: data.cores_per_socket,
11
+ frequency: data.frequency,
12
+ sockets: data.sockets,
13
+ threadsPerCore: data.threads_per_core
14
+ };
15
+ };
16
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data) => {
17
+ if (!isJSONObject(data)) {
18
+ throw new TypeError(
19
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`
20
+ );
21
+ }
22
+ return {
23
+ count: data.count
24
+ };
25
+ };
26
+ const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data) => {
27
+ if (!isJSONObject(data)) {
28
+ throw new TypeError(
29
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`
30
+ );
31
+ }
32
+ return {
33
+ arch: data.arch,
34
+ description: data.description,
35
+ physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(
36
+ data.physical
37
+ ) : void 0,
38
+ threads: data.threads,
39
+ type: data.type,
40
+ virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : void 0
41
+ };
42
+ };
43
+ const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data) => {
44
+ if (!isJSONObject(data)) {
45
+ throw new TypeError(
46
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`
47
+ );
48
+ }
49
+ return {
50
+ count: data.count,
51
+ description: data.description,
52
+ type: data.type
53
+ };
54
+ };
55
+ const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data) => {
56
+ if (!isJSONObject(data)) {
57
+ throw new TypeError(
58
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`
59
+ );
60
+ }
61
+ return {
62
+ description: data.description,
63
+ internalBandwidth: data.internal_bandwidth,
64
+ maxPublicBandwidth: data.max_public_bandwidth,
65
+ publicBandwidth: data.public_bandwidth
66
+ };
67
+ };
68
+ const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data) => {
69
+ if (!isJSONObject(data)) {
70
+ throw new TypeError(
71
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`
72
+ );
73
+ }
74
+ return {
75
+ description: data.description,
76
+ size: data.size,
77
+ type: data.type
78
+ };
79
+ };
80
+ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data) => {
81
+ if (!isJSONObject(data)) {
82
+ throw new TypeError(
83
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`
84
+ );
85
+ }
86
+ return {
87
+ description: data.description,
88
+ total: data.total
89
+ };
90
+ };
91
+ const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data) => {
92
+ if (!isJSONObject(data)) {
93
+ throw new TypeError(
94
+ `Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`
95
+ );
96
+ }
97
+ return {
98
+ range: data.range
99
+ };
100
+ };
101
+ const unmarshalPublicCatalogProductPropertiesDedibox = (data) => {
102
+ if (!isJSONObject(data)) {
103
+ throw new TypeError(
104
+ `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`
105
+ );
106
+ }
107
+ return {
108
+ range: data.range
109
+ };
110
+ };
111
+ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
112
+ if (!isJSONObject(data)) {
113
+ throw new TypeError(
114
+ `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`
115
+ );
116
+ }
117
+ return {
118
+ range: data.range
119
+ };
120
+ };
121
+ const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
122
+ if (!isJSONObject(data)) {
123
+ throw new TypeError(
124
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`
125
+ );
126
+ }
127
+ return {
128
+ cpu: data.cpu ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) : void 0,
129
+ gpu: data.gpu ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) : void 0,
130
+ network: data.network ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) : void 0,
131
+ ram: data.ram ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) : void 0,
132
+ storage: data.storage ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) : void 0
133
+ };
134
+ };
135
+ const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
136
+ if (!isJSONObject(data)) {
137
+ throw new TypeError(
138
+ `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`
139
+ );
140
+ }
141
+ return {
142
+ range: data.range
143
+ };
144
+ };
145
+ const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
146
+ if (!isJSONObject(data)) {
147
+ throw new TypeError(
148
+ `Unmarshalling the type 'PublicCatalogProductEnvironmentalImpactEstimation' failed as data isn't a dictionary.`
149
+ );
150
+ }
151
+ return {
152
+ kgCo2Equivalent: data.kg_co2_equivalent,
153
+ m3WaterUsage: data.m3_water_usage
154
+ };
155
+ };
156
+ const unmarshalPublicCatalogProductLocality = (data) => {
157
+ if (!isJSONObject(data)) {
158
+ throw new TypeError(
159
+ `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`
160
+ );
161
+ }
162
+ return {
163
+ datacenter: data.datacenter,
164
+ global: data.global,
165
+ region: data.region,
166
+ zone: data.zone
167
+ };
168
+ };
169
+ const unmarshalPublicCatalogProductPrice = (data) => {
170
+ if (!isJSONObject(data)) {
171
+ throw new TypeError(
172
+ `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`
173
+ );
174
+ }
175
+ return {
176
+ retailPrice: data.retail_price ? unmarshalMoney(data.retail_price) : void 0
177
+ };
178
+ };
179
+ const unmarshalPublicCatalogProductProperties = (data) => {
180
+ if (!isJSONObject(data)) {
181
+ throw new TypeError(
182
+ `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`
183
+ );
184
+ }
185
+ return {
186
+ appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : void 0,
187
+ dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
188
+ elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
189
+ hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
190
+ instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0
191
+ };
192
+ };
193
+ const unmarshalPublicCatalogProductUnitOfMeasure = (data) => {
194
+ if (!isJSONObject(data)) {
195
+ throw new TypeError(
196
+ `Unmarshalling the type 'PublicCatalogProductUnitOfMeasure' failed as data isn't a dictionary.`
197
+ );
198
+ }
199
+ return {
200
+ size: data.size,
201
+ unit: data.unit
202
+ };
203
+ };
204
+ const unmarshalPublicCatalogProduct = (data) => {
205
+ if (!isJSONObject(data)) {
206
+ throw new TypeError(
207
+ `Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`
208
+ );
209
+ }
210
+ return {
211
+ description: data.description,
212
+ environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
213
+ data.environmental_impact_estimation
214
+ ) : void 0,
215
+ locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
216
+ price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
217
+ product: data.product,
218
+ properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
219
+ serviceCategory: data.service_category,
220
+ sku: data.sku,
221
+ unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : void 0,
222
+ variant: data.variant
223
+ };
224
+ };
225
+ const unmarshalListPublicCatalogProductsResponse = (data) => {
226
+ if (!isJSONObject(data)) {
227
+ throw new TypeError(
228
+ `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`
229
+ );
230
+ }
231
+ return {
232
+ products: unmarshalArrayOfObject(
233
+ data.products,
234
+ unmarshalPublicCatalogProduct
235
+ ),
236
+ totalCount: data.total_count
237
+ };
238
+ };
239
+ export {
240
+ unmarshalListPublicCatalogProductsResponse
241
+ };
@@ -0,0 +1,295 @@
1
+ import type { Money, Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client';
2
+ export type PublicCatalogProductPropertiesHardwareCPUArch = 'unknown_arch' | 'x64' | 'arm64' | 'riscv' | 'apple_silicon';
3
+ export type PublicCatalogProductUnitOfMeasureCountableUnit = 'unknown_countable_unit' | 'chunk' | 'core' | 'currency' | 'device' | 'domain' | 'email' | 'gb_s' | 'gigabyte' | 'hour' | 'iops_gigabyte' | 'ip' | 'month' | 'node' | 'plan' | 'query' | 'request' | 'session' | 'vcpu_s' | 'version' | 'year' | 'key' | 'token' | 'minute' | 'setup' | 'day';
4
+ export interface PublicCatalogProductPropertiesHardwareCPUPhysical {
5
+ /**
6
+ * The number of sockets of the CPU.
7
+ */
8
+ sockets: number;
9
+ /**
10
+ * The number of cores per socket.
11
+ */
12
+ coresPerSocket: number;
13
+ /**
14
+ * The number of threads per core.
15
+ */
16
+ threadsPerCore: number;
17
+ /**
18
+ * The frequency of the CPU in Hertz.
19
+ */
20
+ frequency: number;
21
+ /**
22
+ * The benchmark score of the CPU.
23
+ */
24
+ benchmark: number;
25
+ }
26
+ export interface PublicCatalogProductPropertiesHardwareCPUVirtual {
27
+ /**
28
+ * The number of vCPUs.
29
+ */
30
+ count: number;
31
+ }
32
+ export interface PublicCatalogProductPropertiesHardwareCPU {
33
+ /**
34
+ * A human readable description of the CPU.
35
+ */
36
+ description: string;
37
+ /**
38
+ * The architecture of the CPU.
39
+ */
40
+ arch: PublicCatalogProductPropertiesHardwareCPUArch;
41
+ /**
42
+ * The type of the CPU.
43
+ */
44
+ type: string;
45
+ /**
46
+ * Properties if the CPU is virtual.
47
+ *
48
+ * One-of ('computeUnit'): at most one of 'virtual', 'physical' could be set.
49
+ */
50
+ virtual?: PublicCatalogProductPropertiesHardwareCPUVirtual;
51
+ /**
52
+ * Properties if the CPU is physical.
53
+ *
54
+ * One-of ('computeUnit'): at most one of 'virtual', 'physical' could be set.
55
+ */
56
+ physical?: PublicCatalogProductPropertiesHardwareCPUPhysical;
57
+ /**
58
+ * The total number of threads.
59
+ */
60
+ threads: number;
61
+ }
62
+ export interface PublicCatalogProductPropertiesHardwareGPU {
63
+ /**
64
+ * A human-readable description of the GPU.
65
+ */
66
+ description: string;
67
+ /**
68
+ * The number of GPUs.
69
+ */
70
+ count: number;
71
+ /**
72
+ * The type of the GPU.
73
+ */
74
+ type: string;
75
+ }
76
+ export interface PublicCatalogProductPropertiesHardwareNetwork {
77
+ /**
78
+ * A human-readable description of the network.
79
+ */
80
+ description: string;
81
+ /**
82
+ * The internal bandwidth in bits per second.
83
+ */
84
+ internalBandwidth: number;
85
+ /**
86
+ * The default public bandwidth in bits per second.
87
+ */
88
+ publicBandwidth: number;
89
+ /**
90
+ * The maximum public bandwidth in bits per second (may require subscription to options).
91
+ */
92
+ maxPublicBandwidth: number;
93
+ }
94
+ export interface PublicCatalogProductPropertiesHardwareRAM {
95
+ /**
96
+ * A human-readable description of the RAM.
97
+ */
98
+ description: string;
99
+ /**
100
+ * The size of the RAM in bytes.
101
+ */
102
+ size: number;
103
+ /**
104
+ * The type of the RAM.
105
+ */
106
+ type: string;
107
+ }
108
+ export interface PublicCatalogProductPropertiesHardwareStorage {
109
+ /**
110
+ * A human-readable description of the storage.
111
+ */
112
+ description: string;
113
+ /**
114
+ * The total size of the storage in bytes.
115
+ */
116
+ total: number;
117
+ }
118
+ export interface PublicCatalogProductPropertiesAppleSilicon {
119
+ /**
120
+ * The range of the Apple Silicon server.
121
+ */
122
+ range: string;
123
+ }
124
+ export interface PublicCatalogProductPropertiesDedibox {
125
+ /**
126
+ * The range of the Dedibox server.
127
+ */
128
+ range: string;
129
+ }
130
+ export interface PublicCatalogProductPropertiesElasticMetal {
131
+ /**
132
+ * The range of the Elastic Metal server.
133
+ */
134
+ range: string;
135
+ }
136
+ export interface PublicCatalogProductPropertiesHardware {
137
+ /**
138
+ * The CPU hardware properties.
139
+ */
140
+ cpu?: PublicCatalogProductPropertiesHardwareCPU;
141
+ /**
142
+ * The RAM hardware properties.
143
+ */
144
+ ram?: PublicCatalogProductPropertiesHardwareRAM;
145
+ /**
146
+ * The storage hardware properties.
147
+ */
148
+ storage?: PublicCatalogProductPropertiesHardwareStorage;
149
+ /**
150
+ * The network hardware properties.
151
+ */
152
+ network?: PublicCatalogProductPropertiesHardwareNetwork;
153
+ /**
154
+ * The GPU hardware properties.
155
+ */
156
+ gpu?: PublicCatalogProductPropertiesHardwareGPU;
157
+ }
158
+ export interface PublicCatalogProductPropertiesInstance {
159
+ /**
160
+ * The range of the Instance server.
161
+ */
162
+ range: string;
163
+ }
164
+ export interface PublicCatalogProductEnvironmentalImpactEstimation {
165
+ kgCo2Equivalent?: number;
166
+ m3WaterUsage?: number;
167
+ }
168
+ export interface PublicCatalogProductLocality {
169
+ /**
170
+ * Whether or not the product is global.
171
+ *
172
+ * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set.
173
+ */
174
+ global?: boolean;
175
+ /**
176
+ * The region of the product.
177
+ *
178
+ * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set.
179
+ */
180
+ region?: ScwRegion;
181
+ /**
182
+ * The zone of the product.
183
+ *
184
+ * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set.
185
+ */
186
+ zone?: ScwZone;
187
+ /**
188
+ * The datacenter of the product.
189
+ *
190
+ * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set.
191
+ */
192
+ datacenter?: string;
193
+ }
194
+ export interface PublicCatalogProductPrice {
195
+ /**
196
+ * The retail price of the product.
197
+ */
198
+ retailPrice?: Money;
199
+ }
200
+ export interface PublicCatalogProductProperties {
201
+ /**
202
+ * The hardware properties of the product (if supported).
203
+ */
204
+ hardware?: PublicCatalogProductPropertiesHardware;
205
+ /**
206
+ * The properties of Dedibox products.
207
+ *
208
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
209
+ */
210
+ dedibox?: PublicCatalogProductPropertiesDedibox;
211
+ /**
212
+ * The properties of Elastic Metal products.
213
+ *
214
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
215
+ */
216
+ elasticMetal?: PublicCatalogProductPropertiesElasticMetal;
217
+ /**
218
+ * The properties of Apple Silicon products.
219
+ *
220
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
221
+ */
222
+ appleSilicon?: PublicCatalogProductPropertiesAppleSilicon;
223
+ /**
224
+ * The properties of Instance products.
225
+ *
226
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance' could be set.
227
+ */
228
+ instance?: PublicCatalogProductPropertiesInstance;
229
+ }
230
+ export interface PublicCatalogProductUnitOfMeasure {
231
+ unit: PublicCatalogProductUnitOfMeasureCountableUnit;
232
+ size: number;
233
+ }
234
+ export interface PublicCatalogProduct {
235
+ /**
236
+ * The unique identifier of the product.
237
+ */
238
+ sku: string;
239
+ /**
240
+ * The category of the product.
241
+ */
242
+ serviceCategory: string;
243
+ /**
244
+ * The product name.
245
+ */
246
+ product: string;
247
+ /**
248
+ * The product variant.
249
+ */
250
+ variant: string;
251
+ /**
252
+ * The product description.
253
+ */
254
+ description: string;
255
+ /**
256
+ * The locality of the product.
257
+ */
258
+ locality?: PublicCatalogProductLocality;
259
+ /**
260
+ * The price of the product.
261
+ */
262
+ price?: PublicCatalogProductPrice;
263
+ /**
264
+ * The properties of the product.
265
+ */
266
+ properties?: PublicCatalogProductProperties;
267
+ /**
268
+ * The environmental impact estimation of the product.
269
+ */
270
+ environmentalImpactEstimation?: PublicCatalogProductEnvironmentalImpactEstimation;
271
+ /**
272
+ * The unit of measure of the product.
273
+ */
274
+ unitOfMeasure?: PublicCatalogProductUnitOfMeasure;
275
+ }
276
+ export interface ListPublicCatalogProductsResponse {
277
+ /**
278
+ * The list of products.
279
+ */
280
+ products: PublicCatalogProduct[];
281
+ /**
282
+ * The total number of products in the catalog.
283
+ */
284
+ totalCount: number;
285
+ }
286
+ export type PublicCatalogApiListPublicCatalogProductsRequest = {
287
+ /**
288
+ * Number of the page. Value must be greater or equal to 1.
289
+ */
290
+ page?: number;
291
+ /**
292
+ * The number of products per page. Value must be greater or equal to 1.
293
+ */
294
+ pageSize?: number;
295
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const PublicCatalogApiListPublicCatalogProductsRequest = {
4
+ page: {
5
+ greaterThanOrEqual: 1
6
+ },
7
+ pageSize: {
8
+ greaterThanOrEqual: 1
9
+ }
10
+ };
11
+ exports.PublicCatalogApiListPublicCatalogProductsRequest = PublicCatalogApiListPublicCatalogProductsRequest;
@@ -0,0 +1,8 @@
1
+ export declare const PublicCatalogApiListPublicCatalogProductsRequest: {
2
+ page: {
3
+ greaterThanOrEqual: number;
4
+ };
5
+ pageSize: {
6
+ greaterThanOrEqual: number;
7
+ };
8
+ };
@@ -0,0 +1,11 @@
1
+ const PublicCatalogApiListPublicCatalogProductsRequest = {
2
+ page: {
3
+ greaterThanOrEqual: 1
4
+ },
5
+ pageSize: {
6
+ greaterThanOrEqual: 1
7
+ }
8
+ };
9
+ export {
10
+ PublicCatalogApiListPublicCatalogProductsRequest
11
+ };
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@scaleway/sdk-product-catalog",
3
+ "version": "1.2.0",
4
+ "description": "Scaleway SDK product-catalog",
5
+ "types": "dist/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.gen.d.ts",
13
+ "import": "./dist/index.gen.js",
14
+ "require": "./dist/index.gen.cjs",
15
+ "default": "./dist/index.gen.js"
16
+ },
17
+ "./*": {
18
+ "types": "./dist/*/index.gen.d.ts",
19
+ "import": "./dist/*/index.gen.js",
20
+ "require": "./dist/*/index.gen.cjs",
21
+ "default": "./dist/*/index.gen.js"
22
+ }
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "directory": "packages_generated/product-catalog"
27
+ },
28
+ "engines": {
29
+ "node": ">=20.18.3"
30
+ },
31
+ "dependencies": {
32
+ "@scaleway/random-name": "5.1.1",
33
+ "@scaleway/sdk-std": "1.0.1"
34
+ },
35
+ "peerDependencies": {
36
+ "@scaleway/sdk-client": "^1.2.1"
37
+ },
38
+ "devDependencies": {
39
+ "@scaleway/sdk-client": "^1.2.1"
40
+ },
41
+ "bundledDependencies": [
42
+ "@scaleway/random-name"
43
+ ],
44
+ "scripts": {
45
+ "package:check": "pnpm publint",
46
+ "typecheck": "tsc --noEmit",
47
+ "type:generate": "tsc --declaration -p tsconfig.build.json",
48
+ "build": "vite build --config vite.config.ts && pnpm run type:generate",
49
+ "build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
50
+ }
51
+ }