@scaleway/sdk 2.73.0 → 2.74.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.
Files changed (89) hide show
  1. package/dist/api/account/v3/index.gen.d.ts +1 -1
  2. package/dist/api/account/v3/marshalling.gen.cjs +94 -65
  3. package/dist/api/account/v3/marshalling.gen.js +94 -65
  4. package/dist/api/account/v3/types.gen.d.ts +79 -61
  5. package/dist/api/baremetal/v1/types.gen.d.ts +1 -1
  6. package/dist/api/cockpit/v1/api.gen.cjs +35 -3
  7. package/dist/api/cockpit/v1/api.gen.d.ts +17 -5
  8. package/dist/api/cockpit/v1/api.gen.js +36 -4
  9. package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
  10. package/dist/api/cockpit/v1/marshalling.gen.cjs +23 -0
  11. package/dist/api/cockpit/v1/marshalling.gen.d.ts +3 -1
  12. package/dist/api/cockpit/v1/marshalling.gen.js +23 -0
  13. package/dist/api/cockpit/v1/types.gen.d.ts +63 -2
  14. package/dist/api/dedibox/v1/types.gen.d.ts +3 -3
  15. package/dist/api/edge_services/v1beta1/api.gen.cjs +41 -22
  16. package/dist/api/edge_services/v1beta1/api.gen.d.ts +3 -2
  17. package/dist/api/edge_services/v1beta1/api.gen.js +41 -22
  18. package/dist/api/edge_services/v1beta1/index.gen.d.ts +1 -1
  19. package/dist/api/edge_services/v1beta1/types.gen.d.ts +7 -0
  20. package/dist/api/file/index.gen.cjs +4 -0
  21. package/dist/api/file/index.gen.d.ts +5 -0
  22. package/dist/api/file/index.gen.js +4 -0
  23. package/dist/api/file/v1alpha1/api.gen.cjs +142 -0
  24. package/dist/api/file/v1alpha1/api.gen.d.ts +73 -0
  25. package/dist/api/file/v1alpha1/api.gen.js +142 -0
  26. package/dist/api/file/v1alpha1/content.gen.cjs +7 -0
  27. package/dist/api/file/v1alpha1/content.gen.d.ts +3 -0
  28. package/dist/api/file/v1alpha1/content.gen.js +7 -0
  29. package/dist/api/file/v1alpha1/index.gen.cjs +8 -0
  30. package/dist/api/file/v1alpha1/index.gen.d.ts +4 -0
  31. package/dist/api/file/v1alpha1/index.gen.js +8 -0
  32. package/dist/api/file/v1alpha1/marshalling.gen.cjs +77 -0
  33. package/dist/api/file/v1alpha1/marshalling.gen.d.ts +7 -0
  34. package/dist/api/file/v1alpha1/marshalling.gen.js +77 -0
  35. package/dist/api/file/v1alpha1/types.gen.d.ts +239 -0
  36. package/dist/api/file/v1alpha1/validation-rules.gen.cjs +40 -0
  37. package/dist/api/file/v1alpha1/validation-rules.gen.d.ts +34 -0
  38. package/dist/api/file/v1alpha1/validation-rules.gen.js +40 -0
  39. package/dist/api/function/v1beta1/types.gen.d.ts +6 -6
  40. package/dist/api/iam/v1alpha1/api.gen.cjs +4 -4
  41. package/dist/api/iam/v1alpha1/api.gen.d.ts +4 -4
  42. package/dist/api/iam/v1alpha1/api.gen.js +4 -4
  43. package/dist/api/iam/v1alpha1/types.gen.d.ts +1 -1
  44. package/dist/api/index.gen.d.ts +3 -1
  45. package/dist/api/inference/v1beta1/api.gen.cjs +1 -1
  46. package/dist/api/inference/v1beta1/api.gen.d.ts +1 -1
  47. package/dist/api/inference/v1beta1/api.gen.js +1 -1
  48. package/dist/api/instance/v1/marshalling.gen.cjs +4 -1
  49. package/dist/api/instance/v1/marshalling.gen.js +4 -1
  50. package/dist/api/instance/v1/types.gen.d.ts +16 -1
  51. package/dist/api/interlink/v1beta1/api.gen.cjs +1 -1
  52. package/dist/api/interlink/v1beta1/api.gen.d.ts +1 -1
  53. package/dist/api/interlink/v1beta1/api.gen.js +1 -1
  54. package/dist/api/iot/v1/types.gen.d.ts +1 -1
  55. package/dist/api/lb/v1/marshalling.gen.cjs +4 -2
  56. package/dist/api/lb/v1/marshalling.gen.js +4 -2
  57. package/dist/api/lb/v1/types.gen.d.ts +4 -0
  58. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +1 -1
  59. package/dist/api/product_catalog/index.gen.cjs +4 -0
  60. package/dist/api/product_catalog/index.gen.d.ts +5 -0
  61. package/dist/api/product_catalog/index.gen.js +4 -0
  62. package/dist/api/product_catalog/v2alpha1/api.gen.cjs +36 -0
  63. package/dist/api/product_catalog/v2alpha1/api.gen.d.ts +18 -0
  64. package/dist/api/product_catalog/v2alpha1/api.gen.js +36 -0
  65. package/dist/api/product_catalog/v2alpha1/index.gen.cjs +6 -0
  66. package/dist/api/product_catalog/v2alpha1/index.gen.d.ts +3 -0
  67. package/dist/api/product_catalog/v2alpha1/index.gen.js +6 -0
  68. package/dist/api/product_catalog/v2alpha1/marshalling.gen.cjs +230 -0
  69. package/dist/api/product_catalog/v2alpha1/marshalling.gen.d.ts +2 -0
  70. package/dist/api/product_catalog/v2alpha1/marshalling.gen.js +230 -0
  71. package/dist/api/product_catalog/v2alpha1/types.gen.d.ts +293 -0
  72. package/dist/api/product_catalog/v2alpha1/validation-rules.gen.cjs +11 -0
  73. package/dist/api/product_catalog/v2alpha1/validation-rules.gen.d.ts +8 -0
  74. package/dist/api/product_catalog/v2alpha1/validation-rules.gen.js +11 -0
  75. package/dist/api/qaas/v1alpha1/types.gen.d.ts +2 -2
  76. package/dist/api/rdb/v1/api.gen.cjs +1 -1
  77. package/dist/api/rdb/v1/api.gen.d.ts +1 -1
  78. package/dist/api/rdb/v1/api.gen.js +1 -1
  79. package/dist/api/rdb/v1/types.gen.d.ts +2 -2
  80. package/dist/api/redis/v1/api.gen.cjs +1 -1
  81. package/dist/api/redis/v1/api.gen.d.ts +1 -1
  82. package/dist/api/redis/v1/api.gen.js +1 -1
  83. package/dist/api/registry/v1/types.gen.d.ts +1 -1
  84. package/dist/api/vpcgw/v1/api.gen.cjs +37 -0
  85. package/dist/api/vpcgw/v1/api.gen.d.ts +37 -0
  86. package/dist/api/vpcgw/v1/api.gen.js +37 -0
  87. package/dist/index.cjs +36 -32
  88. package/dist/index.js +36 -32
  89. package/package.json +2 -2
@@ -232,6 +232,7 @@ const unmarshalServer = (data) => {
232
232
  creationDate: unmarshalDate(data.creation_date),
233
233
  dynamicIpRequired: data.dynamic_ip_required,
234
234
  enableIpv6: data.enable_ipv6,
235
+ endOfService: data.end_of_service,
235
236
  hostname: data.hostname,
236
237
  id: data.id,
237
238
  image: data.image ? unmarshalImage(data.image) : void 0,
@@ -805,7 +806,8 @@ const unmarshalServerTypeCapabilities = (data) => {
805
806
  }
806
807
  return {
807
808
  blockStorage: data.block_storage,
808
- bootTypes: data.boot_types
809
+ bootTypes: data.boot_types,
810
+ maxFileSystems: data.max_file_systems
809
811
  };
810
812
  };
811
813
  const unmarshalServerTypeGPUInfo = (data) => {
@@ -1301,6 +1303,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
1301
1303
  image: request.image,
1302
1304
  name: request.name || randomName("srv"),
1303
1305
  placement_group: request.placementGroup,
1306
+ protected: request.protected,
1304
1307
  public_ip: request.publicIp,
1305
1308
  public_ips: request.publicIps,
1306
1309
  routed_ip_enabled: request.routedIpEnabled,
@@ -327,6 +327,10 @@ export interface ServerTypeCapabilities {
327
327
  * List of supported boot types.
328
328
  */
329
329
  bootTypes: BootType[];
330
+ /**
331
+ * Max number of SFS (Scaleway File Systems) that can be attached to the Instance.
332
+ */
333
+ maxFileSystems: number;
330
334
  }
331
335
  export interface ServerTypeGPUInfo {
332
336
  /**
@@ -506,6 +510,10 @@ export interface Server {
506
510
  * This value is reset when admin_password_encryption_ssh_key_id is set to an empty string.
507
511
  */
508
512
  adminPasswordEncryptedValue?: string;
513
+ /**
514
+ * True if the Instance type has reached end of service.
515
+ */
516
+ endOfService: boolean;
509
517
  }
510
518
  export interface VolumeTemplate {
511
519
  /**
@@ -755,7 +763,7 @@ export interface Task {
755
763
  hrefFrom: string;
756
764
  hrefResult: string;
757
765
  /**
758
- * Zone in which the task is excecuted.
766
+ * Zone in which the task is executed.
759
767
  */
760
768
  zone: ScwZone;
761
769
  }
@@ -1278,6 +1286,10 @@ export type CreateServerRequest = {
1278
1286
  * The public_key value of this key is used to encrypt the admin password.
1279
1287
  */
1280
1288
  adminPasswordEncryptionSshKeyId?: string;
1289
+ /**
1290
+ * True to activate server protection option.
1291
+ */
1292
+ protected: boolean;
1281
1293
  };
1282
1294
  export interface CreateServerResponse {
1283
1295
  server?: Server;
@@ -2527,6 +2539,9 @@ export type UpdateServerRequest = {
2527
2539
  * @deprecated
2528
2540
  */
2529
2541
  enableIpv6?: boolean;
2542
+ /**
2543
+ * True to activate server protection option.
2544
+ */
2530
2545
  protected?: boolean;
2531
2546
  securityGroup?: SecurityGroupTemplate;
2532
2547
  /**
@@ -223,7 +223,7 @@ class API extends api.API {
223
223
  options
224
224
  );
225
225
  /**
226
- * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (faciliated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
226
+ * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
227
227
  *
228
228
  * @param request - The request {@link CreateLinkRequest}
229
229
  * @returns A Promise of Link
@@ -98,7 +98,7 @@ export declare class API extends ParentAPI {
98
98
  */
99
99
  waitForLink: (request: Readonly<GetLinkRequest>, options?: Readonly<WaitForOptions<Link>>) => Promise<Link>;
100
100
  /**
101
- * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (faciliated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
101
+ * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
102
102
  *
103
103
  * @param request - The request {@link CreateLinkRequest}
104
104
  * @returns A Promise of Link
@@ -221,7 +221,7 @@ class API extends API$1 {
221
221
  options
222
222
  );
223
223
  /**
224
- * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (faciliated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
224
+ * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection).
225
225
  *
226
226
  * @param request - The request {@link CreateLinkRequest}
227
227
  * @returns A Promise of Link
@@ -736,7 +736,7 @@ export type ListDevicesRequest = {
736
736
  */
737
737
  hubId?: string;
738
738
  /**
739
- * Defines wheter to filter the allow_insecure flag.
739
+ * Defines whether to filter the allow_insecure flag.
740
740
  */
741
741
  allowInsecure?: boolean;
742
742
  /**
@@ -305,7 +305,8 @@ const unmarshalAclMatch = (data) => {
305
305
  httpFilterOption: data.http_filter_option,
306
306
  httpFilterValue: data.http_filter_value,
307
307
  invert: data.invert,
308
- ipSubnet: data.ip_subnet
308
+ ipSubnet: data.ip_subnet,
309
+ ipsEdgeServices: data.ips_edge_services
309
310
  };
310
311
  };
311
312
  const unmarshalAcl = (data) => {
@@ -623,7 +624,8 @@ const marshalAclMatch = (request, defaults) => ({
623
624
  http_filter_option: request.httpFilterOption,
624
625
  http_filter_value: request.httpFilterValue,
625
626
  invert: request.invert,
626
- ip_subnet: request.ipSubnet
627
+ ip_subnet: request.ipSubnet,
628
+ ips_edge_services: request.ipsEdgeServices
627
629
  });
628
630
  const marshalCreateAclRequest = (request, defaults) => ({
629
631
  action: marshalAclAction(request.action),
@@ -303,7 +303,8 @@ const unmarshalAclMatch = (data) => {
303
303
  httpFilterOption: data.http_filter_option,
304
304
  httpFilterValue: data.http_filter_value,
305
305
  invert: data.invert,
306
- ipSubnet: data.ip_subnet
306
+ ipSubnet: data.ip_subnet,
307
+ ipsEdgeServices: data.ips_edge_services
307
308
  };
308
309
  };
309
310
  const unmarshalAcl = (data) => {
@@ -621,7 +622,8 @@ const marshalAclMatch = (request, defaults) => ({
621
622
  http_filter_option: request.httpFilterOption,
622
623
  http_filter_value: request.httpFilterValue,
623
624
  invert: request.invert,
624
- ip_subnet: request.ipSubnet
625
+ ip_subnet: request.ipSubnet,
626
+ ips_edge_services: request.ipsEdgeServices
625
627
  });
626
628
  const marshalCreateAclRequest = (request, defaults) => ({
627
629
  action: marshalAclAction(request.action),
@@ -526,6 +526,10 @@ export interface AclMatch {
526
526
  * List of IPs or CIDR v4/v6 addresses to filter for from the client side.
527
527
  */
528
528
  ipSubnet: string[];
529
+ /**
530
+ * Defines whether Edge Services IPs should be matched.
531
+ */
532
+ ipsEdgeServices: boolean;
529
533
  /**
530
534
  * Type of HTTP filter to match. Extracts the request's URL path, which starts at the first slash and ends before the question mark (without the host part). Defines where to filter for the http_filter_value. Only supported for HTTP backends.
531
535
  */
@@ -87,7 +87,7 @@ export interface NodeTypeVolumeType {
87
87
  */
88
88
  description: string;
89
89
  /**
90
- * Mimimum size required for the volume.
90
+ * Minimum size required for the volume.
91
91
  */
92
92
  minSize: number;
93
93
  /**
@@ -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.v2alpha1 = index_gen;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated from /scripts/generate.js
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as v2alpha1 from './v2alpha1/index.gen.js';
@@ -0,0 +1,4 @@
1
+ import * as index_gen from "./v2alpha1/index.gen.js";
2
+ export {
3
+ index_gen as v2alpha1
4
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../../../client/dist/internal/logger/index.cjs");
4
+ const api = require("../../../client/dist/scw/api.cjs");
5
+ const marshalling = require("../../../client/dist/helpers/marshalling.cjs");
6
+ require("../../../client/dist/vendor/base64/index.cjs");
7
+ const resourcePaginator = require("../../../client/dist/scw/fetch/resource-paginator.cjs");
8
+ const marshalling_gen = require("./marshalling.gen.cjs");
9
+ class PublicCatalogAPI extends api.API {
10
+ pageOfListPublicCatalogProducts = (request = {}) => this.client.fetch(
11
+ {
12
+ method: "GET",
13
+ path: `/product-catalog/v2alpha1/public-catalog/products`,
14
+ urlParams: marshalling.urlParams(
15
+ ["page", request.page],
16
+ [
17
+ "page_size",
18
+ request.pageSize ?? this.client.settings.defaultPageSize
19
+ ]
20
+ )
21
+ },
22
+ marshalling_gen.unmarshalListPublicCatalogProductsResponse
23
+ );
24
+ /**
25
+ * 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.
26
+ *
27
+ * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
28
+ * @returns A Promise of ListPublicCatalogProductsResponse
29
+ */
30
+ listPublicCatalogProducts = (request = {}) => resourcePaginator.enrichForPagination(
31
+ "products",
32
+ this.pageOfListPublicCatalogProducts,
33
+ request
34
+ );
35
+ }
36
+ 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,36 @@
1
+ import "../../../client/dist/internal/logger/index.js";
2
+ import { API as API$1 } from "../../../client/dist/scw/api.js";
3
+ import { urlParams } from "../../../client/dist/helpers/marshalling.js";
4
+ import "../../../client/dist/vendor/base64/index.js";
5
+ import { enrichForPagination } from "../../../client/dist/scw/fetch/resource-paginator.js";
6
+ import { unmarshalListPublicCatalogProductsResponse } from "./marshalling.gen.js";
7
+ class PublicCatalogAPI extends API$1 {
8
+ pageOfListPublicCatalogProducts = (request = {}) => this.client.fetch(
9
+ {
10
+ method: "GET",
11
+ path: `/product-catalog/v2alpha1/public-catalog/products`,
12
+ urlParams: urlParams(
13
+ ["page", request.page],
14
+ [
15
+ "page_size",
16
+ request.pageSize ?? this.client.settings.defaultPageSize
17
+ ]
18
+ )
19
+ },
20
+ unmarshalListPublicCatalogProductsResponse
21
+ );
22
+ /**
23
+ * 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.
24
+ *
25
+ * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest}
26
+ * @returns A Promise of ListPublicCatalogProductsResponse
27
+ */
28
+ listPublicCatalogProducts = (request = {}) => enrichForPagination(
29
+ "products",
30
+ this.pageOfListPublicCatalogProducts,
31
+ request
32
+ );
33
+ }
34
+ export {
35
+ PublicCatalogAPI
36
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const validationRules_gen = require("./validation-rules.gen.cjs");
5
+ exports.PublicCatalogAPI = api_gen.PublicCatalogAPI;
6
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,3 @@
1
+ export { PublicCatalogAPI } from './api.gen.js';
2
+ export type { ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, PublicCatalogProduct, PublicCatalogProductLocality, PublicCatalogProductPrice, PublicCatalogProductPriceUnitOfMeasure, PublicCatalogProductPriceUnitOfMeasureCountableUnit, PublicCatalogProductProperties, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesDedibox, PublicCatalogProductPropertiesElasticMetal, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesHardwareCPU, PublicCatalogProductPropertiesHardwareCPUArch, PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, PublicCatalogProductPropertiesHardwareGPU, PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, } from './types.gen';
3
+ export * as ValidationRules from './validation-rules.gen.js';
@@ -0,0 +1,6 @@
1
+ import { PublicCatalogAPI } from "./api.gen.js";
2
+ import * as validationRules_gen from "./validation-rules.gen.js";
3
+ export {
4
+ PublicCatalogAPI,
5
+ validationRules_gen as ValidationRules
6
+ };
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../../../client/dist/internal/logger/index.cjs");
4
+ const json = require("../../../client/dist/helpers/json.cjs");
5
+ const customMarshalling = require("../../../client/dist/scw/custom-marshalling.cjs");
6
+ const marshalling = require("../../../client/dist/helpers/marshalling.cjs");
7
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data) => {
8
+ if (!json.isJSONObject(data)) {
9
+ throw new TypeError(
10
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`
11
+ );
12
+ }
13
+ return {
14
+ benchmark: data.benchmark,
15
+ coresPerSocket: data.cores_per_socket,
16
+ frequency: data.frequency,
17
+ sockets: data.sockets,
18
+ threadsPerCore: data.threads_per_core
19
+ };
20
+ };
21
+ const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data) => {
22
+ if (!json.isJSONObject(data)) {
23
+ throw new TypeError(
24
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`
25
+ );
26
+ }
27
+ return {
28
+ count: data.count
29
+ };
30
+ };
31
+ const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data) => {
32
+ if (!json.isJSONObject(data)) {
33
+ throw new TypeError(
34
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`
35
+ );
36
+ }
37
+ return {
38
+ arch: data.arch,
39
+ description: data.description,
40
+ physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(
41
+ data.physical
42
+ ) : void 0,
43
+ threads: data.threads,
44
+ type: data.type,
45
+ virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : void 0
46
+ };
47
+ };
48
+ const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data) => {
49
+ if (!json.isJSONObject(data)) {
50
+ throw new TypeError(
51
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`
52
+ );
53
+ }
54
+ return {
55
+ count: data.count,
56
+ description: data.description,
57
+ type: data.type
58
+ };
59
+ };
60
+ const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data) => {
61
+ if (!json.isJSONObject(data)) {
62
+ throw new TypeError(
63
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`
64
+ );
65
+ }
66
+ return {
67
+ description: data.description,
68
+ internalBandwidth: data.internal_bandwidth,
69
+ maxPublicBandwidth: data.max_public_bandwidth,
70
+ publicBandwidth: data.public_bandwidth
71
+ };
72
+ };
73
+ const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data) => {
74
+ if (!json.isJSONObject(data)) {
75
+ throw new TypeError(
76
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`
77
+ );
78
+ }
79
+ return {
80
+ description: data.description,
81
+ size: data.size,
82
+ type: data.type
83
+ };
84
+ };
85
+ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data) => {
86
+ if (!json.isJSONObject(data)) {
87
+ throw new TypeError(
88
+ `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`
89
+ );
90
+ }
91
+ return {
92
+ description: data.description,
93
+ total: data.total
94
+ };
95
+ };
96
+ const unmarshalPublicCatalogProductPriceUnitOfMeasure = (data) => {
97
+ if (!json.isJSONObject(data)) {
98
+ throw new TypeError(
99
+ `Unmarshalling the type 'PublicCatalogProductPriceUnitOfMeasure' failed as data isn't a dictionary.`
100
+ );
101
+ }
102
+ return {
103
+ size: data.size,
104
+ unit: data.unit
105
+ };
106
+ };
107
+ const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data) => {
108
+ if (!json.isJSONObject(data)) {
109
+ throw new TypeError(
110
+ `Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`
111
+ );
112
+ }
113
+ return {
114
+ range: data.range
115
+ };
116
+ };
117
+ const unmarshalPublicCatalogProductPropertiesDedibox = (data) => {
118
+ if (!json.isJSONObject(data)) {
119
+ throw new TypeError(
120
+ `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`
121
+ );
122
+ }
123
+ return {
124
+ range: data.range
125
+ };
126
+ };
127
+ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
128
+ if (!json.isJSONObject(data)) {
129
+ throw new TypeError(
130
+ `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`
131
+ );
132
+ }
133
+ return {
134
+ range: data.range
135
+ };
136
+ };
137
+ const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
138
+ if (!json.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 (!json.isJSONObject(data)) {
153
+ throw new TypeError(
154
+ `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`
155
+ );
156
+ }
157
+ return {
158
+ range: data.range
159
+ };
160
+ };
161
+ const unmarshalPublicCatalogProductLocality = (data) => {
162
+ if (!json.isJSONObject(data)) {
163
+ throw new TypeError(
164
+ `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`
165
+ );
166
+ }
167
+ return {
168
+ datacenter: data.datacenter,
169
+ global: data.global,
170
+ region: data.region,
171
+ zone: data.zone
172
+ };
173
+ };
174
+ const unmarshalPublicCatalogProductPrice = (data) => {
175
+ if (!json.isJSONObject(data)) {
176
+ throw new TypeError(
177
+ `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`
178
+ );
179
+ }
180
+ return {
181
+ retailPrice: data.retail_price ? customMarshalling.unmarshalMoney(data.retail_price) : void 0,
182
+ unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductPriceUnitOfMeasure(data.unit_of_measure) : void 0
183
+ };
184
+ };
185
+ const unmarshalPublicCatalogProductProperties = (data) => {
186
+ if (!json.isJSONObject(data)) {
187
+ throw new TypeError(
188
+ `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`
189
+ );
190
+ }
191
+ return {
192
+ appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : void 0,
193
+ dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
194
+ elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
195
+ hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
196
+ instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0
197
+ };
198
+ };
199
+ const unmarshalPublicCatalogProduct = (data) => {
200
+ if (!json.isJSONObject(data)) {
201
+ throw new TypeError(
202
+ `Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`
203
+ );
204
+ }
205
+ return {
206
+ description: data.description,
207
+ locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
208
+ price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
209
+ product: data.product,
210
+ properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
211
+ serviceCategory: data.service_category,
212
+ sku: data.sku,
213
+ variant: data.variant
214
+ };
215
+ };
216
+ const unmarshalListPublicCatalogProductsResponse = (data) => {
217
+ if (!json.isJSONObject(data)) {
218
+ throw new TypeError(
219
+ `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`
220
+ );
221
+ }
222
+ return {
223
+ products: marshalling.unmarshalArrayOfObject(
224
+ data.products,
225
+ unmarshalPublicCatalogProduct
226
+ ),
227
+ totalCount: data.total_count
228
+ };
229
+ };
230
+ exports.unmarshalListPublicCatalogProductsResponse = unmarshalListPublicCatalogProductsResponse;
@@ -0,0 +1,2 @@
1
+ import type { ListPublicCatalogProductsResponse } from './types.gen';
2
+ export declare const unmarshalListPublicCatalogProductsResponse: (data: unknown) => ListPublicCatalogProductsResponse;