@scaleway/sdk-product-catalog 1.8.0 → 2.1.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.
package/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # @scaleway/sdk-product-catalog
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@scaleway/sdk-product-catalog.svg)](https://www.npmjs.com/package/@scaleway/sdk-product-catalog)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@scaleway/sdk-product-catalog.svg)](https://www.npmjs.com/package/@scaleway/sdk-product-catalog)
5
+ [![license](https://img.shields.io/npm/l/@scaleway/sdk-product-catalog.svg)](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
6
+
7
+ Scaleway SDK for Product Catalog API.
8
+
9
+ > **Note**
10
+ > This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @scaleway/sdk-product-catalog @scaleway/sdk-client
16
+ ```
17
+
18
+ or with pnpm:
19
+
20
+ ```bash
21
+ pnpm add @scaleway/sdk-product-catalog @scaleway/sdk-client
22
+ ```
23
+
24
+ or with yarn:
25
+
26
+ ```bash
27
+ yarn add @scaleway/sdk-product-catalog @scaleway/sdk-client
28
+ ```
29
+
30
+ ## Getting Started
31
+
32
+ You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
33
+
34
+ ### Basic Usage
35
+
36
+ ```typescript
37
+ import { createClient } from '@scaleway/sdk-client'
38
+ import { ProductCatalog } from '@scaleway/sdk-product-catalog'
39
+
40
+ const client = createClient({
41
+ accessKey: 'SCWXXXXXXXXXXXXXXXXX',
42
+ secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
43
+ defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
44
+ defaultRegion: 'fr-par',
45
+ defaultZone: 'fr-par-1',
46
+ })
47
+
48
+ const api = new ProductCatalog.v1.API(client)
49
+
50
+ // Use the API
51
+ // Example: await api.listServers()
52
+ ```
53
+
54
+ ### Using Configuration Loader
55
+
56
+ For a simpler setup, you can load credentials from the configuration file or environment variables:
57
+
58
+ ```typescript
59
+ import { createClient } from '@scaleway/sdk-client'
60
+ import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
61
+ import { ProductCatalog } from '@scaleway/sdk-product-catalog'
62
+
63
+ const profile = loadProfileFromConfigurationFile()
64
+ const client = createClient(profile)
65
+ const api = new ProductCatalog.v1.API(client)
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ - 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
71
+ - 🌐 [Scaleway Product Catalog API Documentation](https://www.scaleway.com/en/developers/api/product-catalog/)
72
+ - 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
73
+ - 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
74
+
75
+ ## Features
76
+
77
+ - ✅ Full TypeScript support with complete type definitions
78
+ - ✅ Promise-based API
79
+ - ✅ Automatic pagination helpers
80
+ - ✅ Built-in error handling
81
+ - ✅ Compatible with Node.js ≥ 20
82
+
83
+ ## Support
84
+
85
+ We love feedback! Feel free to reach us on:
86
+ - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
+ - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
+
89
+ ## Contributing
90
+
91
+ This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
92
+
93
+ ## License
94
+
95
+ This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
+
@@ -7,27 +7,29 @@ class PublicCatalogAPI extends API {
7
7
  path: `/product-catalog/v2alpha1/public-catalog/products`,
8
8
  urlParams: urlParams(
9
9
  ["page", request.page],
10
- [
11
- "page_size",
12
- request.pageSize ?? this.client.settings.defaultPageSize
13
- ],
10
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
14
11
  ["product_types", request.productTypes],
15
- ...Object.entries(
16
- resolveOneOf([
17
- { param: "global", value: request.global },
18
- {
19
- default: this.client.settings.defaultRegion,
20
- param: "region",
21
- value: request.region
22
- },
23
- {
24
- default: this.client.settings.defaultZone,
25
- param: "zone",
26
- value: request.zone
27
- },
28
- { param: "datacenter", value: request.datacenter }
29
- ])
30
- )
12
+ ["status", request.status],
13
+ ...Object.entries(resolveOneOf([
14
+ {
15
+ param: "global",
16
+ value: request.global
17
+ },
18
+ {
19
+ default: this.client.settings.defaultRegion,
20
+ param: "region",
21
+ value: request.region
22
+ },
23
+ {
24
+ default: this.client.settings.defaultZone,
25
+ param: "zone",
26
+ value: request.zone
27
+ },
28
+ {
29
+ param: "datacenter",
30
+ value: request.datacenter
31
+ }
32
+ ]))
31
33
  )
32
34
  },
33
35
  unmarshalListPublicCatalogProductsResponse
@@ -38,11 +40,7 @@ class PublicCatalogAPI extends API {
38
40
  * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
39
41
  * @returns A Promise of ListPublicCatalogProductsResponse
40
42
  */
41
- listPublicCatalogProducts = (request = {}) => enrichForPagination(
42
- "products",
43
- this.pageOfListPublicCatalogProducts,
44
- request
45
- );
43
+ listPublicCatalogProducts = (request = {}) => enrichForPagination("products", this.pageOfListPublicCatalogProducts, request);
46
44
  }
47
45
  export {
48
46
  PublicCatalogAPI
@@ -1,4 +1,4 @@
1
- export { PublicCatalogAPI } from './api.gen.js';
1
+ export { PublicCatalogAPI, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
- export type { ListPublicCatalogProductsRequestProductType, ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesBlockStorage, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductStatus, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, } from './types.gen.js';
3
+ export type { ListPublicCatalogProductsRequestProductType, ListPublicCatalogProductsRequestStatus, ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductProductBadge, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesBlockStorage, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesGenerativeApis, PublicCatalogProductPropertiesGenerativeApisConsumptionMode, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, PublicCatalogProductPropertiesKeyManager, PublicCatalogProductPropertiesLoadBalancer, PublicCatalogProductPropertiesManagedInference, PublicCatalogProductPropertiesManagedRedisDatabase, PublicCatalogProductPropertiesObjectStorage, PublicCatalogProductPropertiesObjectStorageClassType, PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass, PublicCatalogProductPropertiesObjectStorageInternetTrafficType, PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType, PublicCatalogProductPropertiesObjectStorageRegionTrafficType, PublicCatalogProductPropertiesObjectStorageRestoreType, PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType, PublicCatalogProductPropertiesSecretManager, PublicCatalogProductStatus, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, } from './types.gen.js';
4
4
  export * as ValidationRules from './validation-rules.gen.js';
@@ -32,9 +32,7 @@ const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data) => {
32
32
  return {
33
33
  arch: data.arch,
34
34
  description: data.description,
35
- physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(
36
- data.physical
37
- ) : void 0,
35
+ physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(data.physical) : void 0,
38
36
  threads: data.threads,
39
37
  type: data.type,
40
38
  virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : void 0
@@ -88,6 +86,46 @@ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data) => {
88
86
  total: data.total
89
87
  };
90
88
  };
89
+ const unmarshalPublicCatalogProductPropertiesObjectStorageClassType = (data) => {
90
+ if (!isJSONObject(data)) {
91
+ throw new TypeError(
92
+ `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageClassType' failed as data isn't a dictionary.`
93
+ );
94
+ }
95
+ return {
96
+ storageClass: data.storage_class
97
+ };
98
+ };
99
+ const unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType = (data) => {
100
+ if (!isJSONObject(data)) {
101
+ throw new TypeError(
102
+ `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageInternetTrafficType' failed as data isn't a dictionary.`
103
+ );
104
+ }
105
+ return {
106
+ trafficType: data.traffic_type
107
+ };
108
+ };
109
+ const unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType = (data) => {
110
+ if (!isJSONObject(data)) {
111
+ throw new TypeError(
112
+ `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRegionTrafficType' failed as data isn't a dictionary.`
113
+ );
114
+ }
115
+ return {
116
+ regionDestination: data.region_destination
117
+ };
118
+ };
119
+ const unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType = (data) => {
120
+ if (!isJSONObject(data)) {
121
+ throw new TypeError(
122
+ `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRestoreType' failed as data isn't a dictionary.`
123
+ );
124
+ }
125
+ return {
126
+ restoreType: data.restore_type
127
+ };
128
+ };
91
129
  const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data) => {
92
130
  if (!isJSONObject(data)) {
93
131
  throw new TypeError(
@@ -132,6 +170,18 @@ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
132
170
  range: data.range
133
171
  };
134
172
  };
173
+ const unmarshalPublicCatalogProductPropertiesGenerativeApis = (data) => {
174
+ if (!isJSONObject(data)) {
175
+ throw new TypeError(
176
+ `Unmarshalling the type 'PublicCatalogProductPropertiesGenerativeApis' failed as data isn't a dictionary.`
177
+ );
178
+ }
179
+ return {
180
+ consumptionMode: data.consumption_mode,
181
+ reasoning: data.reasoning,
182
+ supportedApis: data.supported_apis
183
+ };
184
+ };
135
185
  const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
136
186
  if (!isJSONObject(data)) {
137
187
  throw new TypeError(
@@ -158,12 +208,59 @@ const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
158
208
  recommendedReplacementOfferIds: data.recommended_replacement_offer_ids
159
209
  };
160
210
  };
211
+ const unmarshalPublicCatalogProductPropertiesKeyManager = (data) => {
212
+ if (!isJSONObject(data)) {
213
+ throw new TypeError(
214
+ `Unmarshalling the type 'PublicCatalogProductPropertiesKeyManager' failed as data isn't a dictionary.`
215
+ );
216
+ }
217
+ return {};
218
+ };
219
+ const unmarshalPublicCatalogProductPropertiesLoadBalancer = (data) => {
220
+ if (!isJSONObject(data)) {
221
+ throw new TypeError(
222
+ `Unmarshalling the type 'PublicCatalogProductPropertiesLoadBalancer' failed as data isn't a dictionary.`
223
+ );
224
+ }
225
+ return {};
226
+ };
227
+ const unmarshalPublicCatalogProductPropertiesManagedInference = (data) => {
228
+ if (!isJSONObject(data)) {
229
+ throw new TypeError(
230
+ `Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary.`
231
+ );
232
+ }
233
+ return {
234
+ instanceGpuName: data.instance_gpu_name
235
+ };
236
+ };
237
+ const unmarshalPublicCatalogProductPropertiesManagedRedisDatabase = (data) => {
238
+ if (!isJSONObject(data)) {
239
+ throw new TypeError(
240
+ `Unmarshalling the type 'PublicCatalogProductPropertiesManagedRedisDatabase' failed as data isn't a dictionary.`
241
+ );
242
+ }
243
+ return {};
244
+ };
161
245
  const unmarshalPublicCatalogProductPropertiesObjectStorage = (data) => {
162
246
  if (!isJSONObject(data)) {
163
247
  throw new TypeError(
164
248
  `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorage' failed as data isn't a dictionary.`
165
249
  );
166
250
  }
251
+ return {
252
+ class: data.class ? unmarshalPublicCatalogProductPropertiesObjectStorageClassType(data.class) : void 0,
253
+ internetTraffic: data.internet_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType(data.internet_traffic) : void 0,
254
+ regionTraffic: data.region_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType(data.region_traffic) : void 0,
255
+ restore: data.restore ? unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType(data.restore) : void 0
256
+ };
257
+ };
258
+ const unmarshalPublicCatalogProductPropertiesSecretManager = (data) => {
259
+ if (!isJSONObject(data)) {
260
+ throw new TypeError(
261
+ `Unmarshalling the type 'PublicCatalogProductPropertiesSecretManager' failed as data isn't a dictionary.`
262
+ );
263
+ }
167
264
  return {};
168
265
  };
169
266
  const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
@@ -211,11 +308,15 @@ const unmarshalPublicCatalogProductProperties = (data) => {
211
308
  blockStorage: data.block_storage ? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage) : void 0,
212
309
  dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
213
310
  elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
311
+ generativeApis: data.generative_apis ? unmarshalPublicCatalogProductPropertiesGenerativeApis(data.generative_apis) : void 0,
214
312
  hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
215
313
  instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0,
216
- objectStorage: data.object_storage ? unmarshalPublicCatalogProductPropertiesObjectStorage(
217
- data.object_storage
218
- ) : void 0
314
+ keyManager: data.key_manager ? unmarshalPublicCatalogProductPropertiesKeyManager(data.key_manager) : void 0,
315
+ loadBalancer: data.load_balancer ? unmarshalPublicCatalogProductPropertiesLoadBalancer(data.load_balancer) : void 0,
316
+ managedInference: data.managed_inference ? unmarshalPublicCatalogProductPropertiesManagedInference(data.managed_inference) : void 0,
317
+ managedRedisDatabase: data.managed_redis_database ? unmarshalPublicCatalogProductPropertiesManagedRedisDatabase(data.managed_redis_database) : void 0,
318
+ objectStorage: data.object_storage ? unmarshalPublicCatalogProductPropertiesObjectStorage(data.object_storage) : void 0,
319
+ secretManager: data.secret_manager ? unmarshalPublicCatalogProductPropertiesSecretManager(data.secret_manager) : void 0
219
320
  };
220
321
  };
221
322
  const unmarshalPublicCatalogProductUnitOfMeasure = (data) => {
@@ -236,11 +337,10 @@ const unmarshalPublicCatalogProduct = (data) => {
236
337
  );
237
338
  }
238
339
  return {
340
+ badges: data.badges,
239
341
  description: data.description,
240
342
  endOfLifeAt: unmarshalDate(data.end_of_life_at),
241
- environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
242
- data.environmental_impact_estimation
243
- ) : void 0,
343
+ environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(data.environmental_impact_estimation) : void 0,
244
344
  locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
245
345
  price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
246
346
  product: data.product,
@@ -260,10 +360,7 @@ const unmarshalListPublicCatalogProductsResponse = (data) => {
260
360
  );
261
361
  }
262
362
  return {
263
- products: unmarshalArrayOfObject(
264
- data.products,
265
- unmarshalPublicCatalogProduct
266
- ),
363
+ products: unmarshalArrayOfObject(data.products, unmarshalPublicCatalogProduct),
267
364
  totalCount: data.total_count
268
365
  };
269
366
  };
@@ -1,7 +1,13 @@
1
1
  import type { Money, Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client';
2
- export type ListPublicCatalogProductsRequestProductType = 'unknown_product_type' | 'instance' | 'apple_silicon' | 'elastic_metal' | 'dedibox' | 'block_storage' | 'object_storage';
2
+ export type ListPublicCatalogProductsRequestProductType = 'unknown_product_type' | 'instance' | 'apple_silicon' | 'elastic_metal' | 'dedibox' | 'block_storage' | 'object_storage' | 'managed_inference' | 'generative_apis' | 'load_balancer' | 'secret_manager' | 'key_manager' | 'managed_redis_database';
3
+ export type ListPublicCatalogProductsRequestStatus = 'unknown_status' | 'public_beta' | 'preview' | 'general_availability' | 'end_of_new_features' | 'end_of_growth' | 'end_of_deployment' | 'end_of_support' | 'end_of_sale' | 'end_of_life' | 'retired';
4
+ export type PublicCatalogProductProductBadge = 'unknown_product_badge' | 'new_product' | 'best_seller' | 'best_value' | 'popular';
5
+ export type PublicCatalogProductPropertiesGenerativeApisConsumptionMode = 'unknown_consumption_mode' | 'realtime' | 'batch';
3
6
  export type PublicCatalogProductPropertiesHardwareCPUArch = 'unknown_arch' | 'x64' | 'arm64' | 'riscv' | 'apple_silicon';
4
- export type PublicCatalogProductStatus = 'unknown_status' | 'public_beta' | 'preview' | 'general_availability' | 'end_of_deployment' | 'end_of_support' | 'end_of_sale';
7
+ export type PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass = 'unknown_storage_class' | 'standard' | 'glacier' | 'onezone_ia';
8
+ export type PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType = 'unknown_traffic_type' | 'ingress' | 'egress' | 'alliance';
9
+ export type PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType = 'unknown_restore_type' | 'standard';
10
+ export type PublicCatalogProductStatus = 'unknown_status' | 'public_beta' | 'preview' | 'general_availability' | 'end_of_new_features' | 'end_of_growth' | 'end_of_deployment' | 'end_of_support' | 'end_of_sale' | 'end_of_life' | 'retired';
5
11
  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' | 'second' | 'sample_day' | 'gigabyte_day' | 'mvcpu';
6
12
  export interface PublicCatalogProductPropertiesHardwareCPUPhysical {
7
13
  /**
@@ -117,6 +123,30 @@ export interface PublicCatalogProductPropertiesHardwareStorage {
117
123
  */
118
124
  total: number;
119
125
  }
126
+ export interface PublicCatalogProductPropertiesObjectStorageClassType {
127
+ /**
128
+ * The storage class.
129
+ */
130
+ storageClass: PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass;
131
+ }
132
+ export interface PublicCatalogProductPropertiesObjectStorageInternetTrafficType {
133
+ /**
134
+ * The type of internet traffic.
135
+ */
136
+ trafficType: PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType;
137
+ }
138
+ export interface PublicCatalogProductPropertiesObjectStorageRegionTrafficType {
139
+ /**
140
+ * The destination region for the region traffic.
141
+ */
142
+ regionDestination: string;
143
+ }
144
+ export interface PublicCatalogProductPropertiesObjectStorageRestoreType {
145
+ /**
146
+ * The type of restore.
147
+ */
148
+ restoreType: PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType;
149
+ }
120
150
  export interface PublicCatalogProductPropertiesAppleSilicon {
121
151
  /**
122
152
  * The range of the Apple Silicon server.
@@ -157,6 +187,11 @@ export interface PublicCatalogProductPropertiesElasticMetal {
157
187
  */
158
188
  offerId: string;
159
189
  }
190
+ export interface PublicCatalogProductPropertiesGenerativeApis {
191
+ reasoning: boolean;
192
+ supportedApis: string[];
193
+ consumptionMode: PublicCatalogProductPropertiesGenerativeApisConsumptionMode;
194
+ }
160
195
  export interface PublicCatalogProductPropertiesHardware {
161
196
  /**
162
197
  * The CPU hardware properties.
@@ -193,7 +228,45 @@ export interface PublicCatalogProductPropertiesInstance {
193
228
  */
194
229
  recommendedReplacementOfferIds: string[];
195
230
  }
231
+ export interface PublicCatalogProductPropertiesKeyManager {
232
+ }
233
+ export interface PublicCatalogProductPropertiesLoadBalancer {
234
+ }
235
+ export interface PublicCatalogProductPropertiesManagedInference {
236
+ /**
237
+ * The name of the associated instance GPU to this node type.
238
+ */
239
+ instanceGpuName: string;
240
+ }
241
+ export interface PublicCatalogProductPropertiesManagedRedisDatabase {
242
+ }
196
243
  export interface PublicCatalogProductPropertiesObjectStorage {
244
+ /**
245
+ * The properties related to Object Storage class.
246
+ *
247
+ * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
248
+ */
249
+ class?: PublicCatalogProductPropertiesObjectStorageClassType;
250
+ /**
251
+ * The properties related to Object Storage restore operations.
252
+ *
253
+ * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
254
+ */
255
+ restore?: PublicCatalogProductPropertiesObjectStorageRestoreType;
256
+ /**
257
+ * The properties related to Object Storage internet traffic.
258
+ *
259
+ * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
260
+ */
261
+ internetTraffic?: PublicCatalogProductPropertiesObjectStorageInternetTrafficType;
262
+ /**
263
+ * The properties related to Object Storage region traffic.
264
+ *
265
+ * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set.
266
+ */
267
+ regionTraffic?: PublicCatalogProductPropertiesObjectStorageRegionTrafficType;
268
+ }
269
+ export interface PublicCatalogProductPropertiesSecretManager {
197
270
  }
198
271
  export interface PublicCatalogProductEnvironmentalImpactEstimation {
199
272
  kgCo2Equivalent?: number;
@@ -239,39 +312,73 @@ export interface PublicCatalogProductProperties {
239
312
  /**
240
313
  * The properties of Dedibox products.
241
314
  *
242
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
315
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
243
316
  */
244
317
  dedibox?: PublicCatalogProductPropertiesDedibox;
245
318
  /**
246
319
  * The properties of Elastic Metal products.
247
320
  *
248
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
321
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
249
322
  */
250
323
  elasticMetal?: PublicCatalogProductPropertiesElasticMetal;
251
324
  /**
252
325
  * The properties of Apple Silicon products.
253
326
  *
254
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
327
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
255
328
  */
256
329
  appleSilicon?: PublicCatalogProductPropertiesAppleSilicon;
257
330
  /**
258
331
  * The properties of Instance products.
259
332
  *
260
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
333
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
261
334
  */
262
335
  instance?: PublicCatalogProductPropertiesInstance;
263
336
  /**
264
337
  * The properties of Block Storage products.
265
338
  *
266
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
339
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
267
340
  */
268
341
  blockStorage?: PublicCatalogProductPropertiesBlockStorage;
269
342
  /**
270
343
  * The properties of Object Storage products.
271
344
  *
272
- * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
345
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
273
346
  */
274
347
  objectStorage?: PublicCatalogProductPropertiesObjectStorage;
348
+ /**
349
+ * The properties of Managed Inference products.
350
+ *
351
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
352
+ */
353
+ managedInference?: PublicCatalogProductPropertiesManagedInference;
354
+ /**
355
+ * The properties of Generative APIs products.
356
+ *
357
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
358
+ */
359
+ generativeApis?: PublicCatalogProductPropertiesGenerativeApis;
360
+ /**
361
+ * The properties of Load Balancer products.
362
+ *
363
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
364
+ */
365
+ loadBalancer?: PublicCatalogProductPropertiesLoadBalancer;
366
+ /**
367
+ *
368
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
369
+ */
370
+ secretManager?: PublicCatalogProductPropertiesSecretManager;
371
+ /**
372
+ * The properties of Managed Redis Database products.
373
+ *
374
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
375
+ */
376
+ managedRedisDatabase?: PublicCatalogProductPropertiesManagedRedisDatabase;
377
+ /**
378
+ *
379
+ * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set.
380
+ */
381
+ keyManager?: PublicCatalogProductPropertiesKeyManager;
275
382
  }
276
383
  export interface PublicCatalogProductUnitOfMeasure {
277
384
  unit: PublicCatalogProductUnitOfMeasureCountableUnit;
@@ -330,6 +437,10 @@ export interface PublicCatalogProduct {
330
437
  * The end of life date of the product.
331
438
  */
332
439
  endOfLifeAt?: Date;
440
+ /**
441
+ * Different badges that can be associated with the product.
442
+ */
443
+ badges: PublicCatalogProductProductBadge[];
333
444
  }
334
445
  export interface ListPublicCatalogProductsResponse {
335
446
  /**
@@ -378,4 +489,8 @@ export type PublicCatalogApiListPublicCatalogProductsRequest = {
378
489
  * One-of ('locality'): at most one of 'global', 'region', 'zone', 'datacenter' could be set.
379
490
  */
380
491
  datacenter?: string;
492
+ /**
493
+ * The lists of filtered product status, if empty only products with status public_beta, general_availability, preview, end_of_new_features, end_of_growth, end_of_deployment, end_of_support, end_of_sale, end_of_life or retired will be returned.
494
+ */
495
+ status?: ListPublicCatalogProductsRequestStatus[];
381
496
  };
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-product-catalog",
3
- "version": "1.8.0",
3
+ "version": "2.1.1",
4
4
  "description": "Scaleway SDK product-catalog",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
+ "README.md",
7
8
  "dist"
8
9
  ],
9
10
  "type": "module",
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/index.gen.d.ts",
13
- "import": "./dist/index.gen.js",
14
- "require": "./dist/index.gen.cjs",
15
14
  "default": "./dist/index.gen.js"
16
15
  },
17
16
  "./*": {
18
17
  "types": "./dist/*/index.gen.d.ts",
19
- "import": "./dist/*/index.gen.js",
20
- "require": "./dist/*/index.gen.cjs",
21
18
  "default": "./dist/*/index.gen.js"
22
19
  }
23
20
  },
@@ -26,17 +23,17 @@
26
23
  "directory": "packages_generated/product-catalog"
27
24
  },
28
25
  "engines": {
29
- "node": ">=20.19.4"
26
+ "node": ">=20.19.6"
30
27
  },
31
28
  "dependencies": {
32
29
  "@scaleway/random-name": "5.1.2",
33
- "@scaleway/sdk-std": "1.1.0"
30
+ "@scaleway/sdk-std": "2.1.0"
34
31
  },
35
32
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.2"
33
+ "@scaleway/sdk-client": "^2.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.2"
36
+ "@scaleway/sdk-client": "^2.1.0"
40
37
  },
41
38
  "scripts": {
42
39
  "package:check": "pnpm publint",
@@ -1,4 +0,0 @@
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;
@@ -1,49 +0,0 @@
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
- ["product_types", request.productTypes],
17
- ...Object.entries(
18
- sdkClient.resolveOneOf([
19
- { param: "global", value: request.global },
20
- {
21
- default: this.client.settings.defaultRegion,
22
- param: "region",
23
- value: request.region
24
- },
25
- {
26
- default: this.client.settings.defaultZone,
27
- param: "zone",
28
- value: request.zone
29
- },
30
- { param: "datacenter", value: request.datacenter }
31
- ])
32
- )
33
- )
34
- },
35
- marshalling_gen.unmarshalListPublicCatalogProductsResponse
36
- );
37
- /**
38
- * 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.
39
- *
40
- * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
41
- * @returns A Promise of ListPublicCatalogProductsResponse
42
- */
43
- listPublicCatalogProducts = (request = {}) => sdkClient.enrichForPagination(
44
- "products",
45
- this.pageOfListPublicCatalogProducts,
46
- request
47
- );
48
- }
49
- exports.PublicCatalogAPI = PublicCatalogAPI;
@@ -1,8 +0,0 @@
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;
@@ -1,272 +0,0 @@
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
- serverType: data.server_type
102
- };
103
- };
104
- const unmarshalPublicCatalogProductPropertiesBlockStorage = (data) => {
105
- if (!sdkClient.isJSONObject(data)) {
106
- throw new TypeError(
107
- `Unmarshalling the type 'PublicCatalogProductPropertiesBlockStorage' failed as data isn't a dictionary.`
108
- );
109
- }
110
- return {
111
- maxVolumeSize: data.max_volume_size,
112
- minVolumeSize: data.min_volume_size
113
- };
114
- };
115
- const unmarshalPublicCatalogProductPropertiesDedibox = (data) => {
116
- if (!sdkClient.isJSONObject(data)) {
117
- throw new TypeError(
118
- `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`
119
- );
120
- }
121
- return {
122
- offerId: data.offer_id,
123
- range: data.range
124
- };
125
- };
126
- const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
127
- if (!sdkClient.isJSONObject(data)) {
128
- throw new TypeError(
129
- `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`
130
- );
131
- }
132
- return {
133
- offerId: data.offer_id,
134
- range: data.range
135
- };
136
- };
137
- const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
138
- if (!sdkClient.isJSONObject(data)) {
139
- throw new TypeError(
140
- `Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`
141
- );
142
- }
143
- return {
144
- cpu: data.cpu ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) : void 0,
145
- gpu: data.gpu ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) : void 0,
146
- network: data.network ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) : void 0,
147
- ram: data.ram ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) : void 0,
148
- storage: data.storage ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) : void 0
149
- };
150
- };
151
- const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
152
- if (!sdkClient.isJSONObject(data)) {
153
- throw new TypeError(
154
- `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`
155
- );
156
- }
157
- return {
158
- offerId: data.offer_id,
159
- range: data.range,
160
- recommendedReplacementOfferIds: data.recommended_replacement_offer_ids
161
- };
162
- };
163
- const unmarshalPublicCatalogProductPropertiesObjectStorage = (data) => {
164
- if (!sdkClient.isJSONObject(data)) {
165
- throw new TypeError(
166
- `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorage' failed as data isn't a dictionary.`
167
- );
168
- }
169
- return {};
170
- };
171
- const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data) => {
172
- if (!sdkClient.isJSONObject(data)) {
173
- throw new TypeError(
174
- `Unmarshalling the type 'PublicCatalogProductEnvironmentalImpactEstimation' failed as data isn't a dictionary.`
175
- );
176
- }
177
- return {
178
- kgCo2Equivalent: data.kg_co2_equivalent,
179
- m3WaterUsage: data.m3_water_usage
180
- };
181
- };
182
- const unmarshalPublicCatalogProductLocality = (data) => {
183
- if (!sdkClient.isJSONObject(data)) {
184
- throw new TypeError(
185
- `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`
186
- );
187
- }
188
- return {
189
- datacenter: data.datacenter,
190
- global: data.global,
191
- region: data.region,
192
- zone: data.zone
193
- };
194
- };
195
- const unmarshalPublicCatalogProductPrice = (data) => {
196
- if (!sdkClient.isJSONObject(data)) {
197
- throw new TypeError(
198
- `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`
199
- );
200
- }
201
- return {
202
- retailPrice: data.retail_price ? sdkClient.unmarshalMoney(data.retail_price) : void 0
203
- };
204
- };
205
- const unmarshalPublicCatalogProductProperties = (data) => {
206
- if (!sdkClient.isJSONObject(data)) {
207
- throw new TypeError(
208
- `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`
209
- );
210
- }
211
- return {
212
- appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : void 0,
213
- blockStorage: data.block_storage ? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage) : void 0,
214
- dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
215
- elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
216
- hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
217
- instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0,
218
- objectStorage: data.object_storage ? unmarshalPublicCatalogProductPropertiesObjectStorage(
219
- data.object_storage
220
- ) : void 0
221
- };
222
- };
223
- const unmarshalPublicCatalogProductUnitOfMeasure = (data) => {
224
- if (!sdkClient.isJSONObject(data)) {
225
- throw new TypeError(
226
- `Unmarshalling the type 'PublicCatalogProductUnitOfMeasure' failed as data isn't a dictionary.`
227
- );
228
- }
229
- return {
230
- size: data.size,
231
- unit: data.unit
232
- };
233
- };
234
- const unmarshalPublicCatalogProduct = (data) => {
235
- if (!sdkClient.isJSONObject(data)) {
236
- throw new TypeError(
237
- `Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`
238
- );
239
- }
240
- return {
241
- description: data.description,
242
- endOfLifeAt: sdkClient.unmarshalDate(data.end_of_life_at),
243
- environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(
244
- data.environmental_impact_estimation
245
- ) : void 0,
246
- locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
247
- price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
248
- product: data.product,
249
- productCategory: data.product_category,
250
- properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
251
- serviceCategory: data.service_category,
252
- sku: data.sku,
253
- status: data.status,
254
- unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : void 0,
255
- variant: data.variant
256
- };
257
- };
258
- const unmarshalListPublicCatalogProductsResponse = (data) => {
259
- if (!sdkClient.isJSONObject(data)) {
260
- throw new TypeError(
261
- `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`
262
- );
263
- }
264
- return {
265
- products: sdkClient.unmarshalArrayOfObject(
266
- data.products,
267
- unmarshalPublicCatalogProduct
268
- ),
269
- totalCount: data.total_count
270
- };
271
- };
272
- exports.unmarshalListPublicCatalogProductsResponse = unmarshalListPublicCatalogProductsResponse;
@@ -1,11 +0,0 @@
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;