@scaleway/sdk 2.72.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.
- package/dist/api/account/v3/api.gen.cjs +13 -32
- package/dist/api/account/v3/api.gen.d.ts +17 -36
- package/dist/api/account/v3/api.gen.js +13 -32
- package/dist/api/account/v3/index.gen.d.ts +1 -1
- package/dist/api/account/v3/marshalling.gen.cjs +94 -65
- package/dist/api/account/v3/marshalling.gen.js +94 -65
- package/dist/api/account/v3/types.gen.d.ts +224 -104
- package/dist/api/applesilicon/v1alpha1/api.gen.cjs +19 -46
- package/dist/api/applesilicon/v1alpha1/api.gen.d.ts +24 -49
- package/dist/api/applesilicon/v1alpha1/api.gen.js +19 -46
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +310 -135
- package/dist/api/audit_trail/v1alpha1/api.gen.cjs +2 -5
- package/dist/api/audit_trail/v1alpha1/api.gen.d.ts +4 -8
- package/dist/api/audit_trail/v1alpha1/api.gen.js +2 -5
- package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +110 -82
- package/dist/api/baremetal/v1/api.gen.cjs +28 -61
- package/dist/api/baremetal/v1/api.gen.d.ts +29 -60
- package/dist/api/baremetal/v1/api.gen.js +28 -61
- package/dist/api/baremetal/v1/types.gen.d.ts +802 -315
- package/dist/api/baremetal/v3/api.gen.cjs +7 -14
- package/dist/api/baremetal/v3/api.gen.d.ts +10 -15
- package/dist/api/baremetal/v3/api.gen.js +7 -14
- package/dist/api/baremetal/v3/types.gen.d.ts +82 -32
- package/dist/api/billing/v2beta1/api.gen.cjs +11 -20
- package/dist/api/billing/v2beta1/api.gen.d.ts +9 -19
- package/dist/api/billing/v2beta1/api.gen.js +11 -20
- package/dist/api/billing/v2beta1/types.gen.d.ts +231 -102
- package/dist/api/block/v1/api.gen.cjs +37 -55
- package/dist/api/block/v1/api.gen.d.ts +19 -37
- package/dist/api/block/v1/api.gen.js +37 -55
- package/dist/api/block/v1/types.gen.d.ts +306 -125
- package/dist/api/block/v1alpha1/api.gen.cjs +45 -64
- package/dist/api/block/v1alpha1/api.gen.d.ts +22 -41
- package/dist/api/block/v1alpha1/api.gen.js +45 -64
- package/dist/api/block/v1alpha1/types.gen.d.ts +327 -132
- package/dist/api/cockpit/v1/api.gen.cjs +132 -156
- package/dist/api/cockpit/v1/api.gen.d.ts +66 -113
- package/dist/api/cockpit/v1/api.gen.js +133 -157
- package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
- package/dist/api/cockpit/v1/marshalling.gen.cjs +23 -0
- package/dist/api/cockpit/v1/marshalling.gen.d.ts +3 -1
- package/dist/api/cockpit/v1/marshalling.gen.js +23 -0
- package/dist/api/cockpit/v1/types.gen.d.ts +628 -246
- package/dist/api/container/v1beta1/api.gen.cjs +7 -14
- package/dist/api/container/v1beta1/api.gen.d.ts +9 -16
- package/dist/api/container/v1beta1/api.gen.js +7 -14
- package/dist/api/container/v1beta1/types.gen.d.ts +648 -322
- package/dist/api/dedibox/v1/api.gen.cjs +45 -69
- package/dist/api/dedibox/v1/api.gen.d.ts +52 -62
- package/dist/api/dedibox/v1/api.gen.js +45 -69
- package/dist/api/dedibox/v1/types.gen.d.ts +1765 -645
- package/dist/api/domain/v2beta1/api.gen.cjs +119 -178
- package/dist/api/domain/v2beta1/api.gen.d.ts +71 -130
- package/dist/api/domain/v2beta1/api.gen.js +119 -178
- package/dist/api/domain/v2beta1/content.gen.d.ts +1 -4
- package/dist/api/domain/v2beta1/types.gen.d.ts +411 -199
- package/dist/api/edge_services/v1beta1/api.gen.cjs +41 -22
- package/dist/api/edge_services/v1beta1/api.gen.d.ts +3 -2
- package/dist/api/edge_services/v1beta1/api.gen.js +41 -22
- package/dist/api/edge_services/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/edge_services/v1beta1/types.gen.d.ts +7 -0
- package/dist/api/file/index.gen.cjs +4 -0
- package/dist/api/file/index.gen.d.ts +5 -0
- package/dist/api/file/index.gen.js +4 -0
- package/dist/api/file/v1alpha1/api.gen.cjs +142 -0
- package/dist/api/file/v1alpha1/api.gen.d.ts +73 -0
- package/dist/api/file/v1alpha1/api.gen.js +142 -0
- package/dist/api/file/v1alpha1/content.gen.cjs +7 -0
- package/dist/api/file/v1alpha1/content.gen.d.ts +3 -0
- package/dist/api/file/v1alpha1/content.gen.js +7 -0
- package/dist/api/file/v1alpha1/index.gen.cjs +8 -0
- package/dist/api/file/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/file/v1alpha1/index.gen.js +8 -0
- package/dist/api/file/v1alpha1/marshalling.gen.cjs +77 -0
- package/dist/api/file/v1alpha1/marshalling.gen.d.ts +7 -0
- package/dist/api/file/v1alpha1/marshalling.gen.js +77 -0
- package/dist/api/file/v1alpha1/types.gen.d.ts +239 -0
- package/dist/api/file/v1alpha1/validation-rules.gen.cjs +40 -0
- package/dist/api/file/v1alpha1/validation-rules.gen.d.ts +34 -0
- package/dist/api/file/v1alpha1/validation-rules.gen.js +40 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.cjs +10 -25
- package/dist/api/flexibleip/v1alpha1/api.gen.d.ts +12 -28
- package/dist/api/flexibleip/v1alpha1/api.gen.js +10 -25
- package/dist/api/flexibleip/v1alpha1/types.gen.d.ts +186 -78
- package/dist/api/function/v1beta1/types.gen.d.ts +6 -6
- package/dist/api/iam/v1alpha1/api.gen.cjs +4 -4
- package/dist/api/iam/v1alpha1/api.gen.d.ts +4 -4
- package/dist/api/iam/v1alpha1/api.gen.js +4 -4
- package/dist/api/iam/v1alpha1/types.gen.d.ts +1 -1
- package/dist/api/index.gen.d.ts +3 -1
- package/dist/api/inference/v1/api.gen.cjs +8 -11
- package/dist/api/inference/v1/api.gen.d.ts +6 -9
- package/dist/api/inference/v1/api.gen.js +8 -11
- package/dist/api/inference/v1/types.gen.d.ts +330 -150
- package/dist/api/inference/v1beta1/api.gen.cjs +9 -12
- package/dist/api/inference/v1beta1/api.gen.d.ts +7 -10
- package/dist/api/inference/v1beta1/api.gen.js +9 -12
- package/dist/api/inference/v1beta1/types.gen.d.ts +341 -154
- package/dist/api/instance/v1/api.gen.cjs +64 -113
- package/dist/api/instance/v1/api.gen.d.ts +54 -103
- package/dist/api/instance/v1/api.gen.js +64 -113
- package/dist/api/instance/v1/marshalling.gen.cjs +4 -1
- package/dist/api/instance/v1/marshalling.gen.js +4 -1
- package/dist/api/instance/v1/types.gen.d.ts +1368 -600
- package/dist/api/instance/v1/types.private.gen.d.ts +131 -59
- package/dist/api/interlink/v1beta1/api.gen.cjs +21 -67
- package/dist/api/interlink/v1beta1/api.gen.d.ts +23 -70
- package/dist/api/interlink/v1beta1/api.gen.js +21 -67
- package/dist/api/interlink/v1beta1/marshalling.gen.cjs +2 -0
- package/dist/api/interlink/v1beta1/marshalling.gen.js +2 -0
- package/dist/api/interlink/v1beta1/types.gen.d.ts +464 -216
- package/dist/api/interlink/v1beta1/validation-rules.gen.cjs +8 -0
- package/dist/api/interlink/v1beta1/validation-rules.gen.d.ts +8 -0
- package/dist/api/interlink/v1beta1/validation-rules.gen.js +8 -0
- package/dist/api/iot/v1/api.gen.cjs +37 -70
- package/dist/api/iot/v1/api.gen.d.ts +34 -67
- package/dist/api/iot/v1/api.gen.js +37 -70
- package/dist/api/iot/v1/types.gen.d.ts +566 -321
- package/dist/api/ipam/v1/api.gen.cjs +6 -26
- package/dist/api/ipam/v1/api.gen.d.ts +8 -29
- package/dist/api/ipam/v1/api.gen.js +6 -26
- package/dist/api/ipam/v1/types.gen.d.ts +146 -105
- package/dist/api/jobs/v1alpha1/api.gen.cjs +2 -4
- package/dist/api/jobs/v1alpha1/api.gen.d.ts +4 -6
- package/dist/api/jobs/v1alpha1/api.gen.js +2 -4
- package/dist/api/jobs/v1alpha1/types.gen.d.ts +165 -91
- package/dist/api/k8s/v1/api.gen.cjs +33 -78
- package/dist/api/k8s/v1/api.gen.d.ts +27 -72
- package/dist/api/k8s/v1/api.gen.js +33 -78
- package/dist/api/k8s/v1/types.gen.d.ts +743 -506
- package/dist/api/key_manager/v1alpha1/api.gen.cjs +21 -57
- package/dist/api/key_manager/v1alpha1/api.gen.d.ts +19 -56
- package/dist/api/key_manager/v1alpha1/api.gen.js +21 -57
- package/dist/api/key_manager/v1alpha1/types.gen.d.ts +196 -114
- package/dist/api/lb/v1/marshalling.gen.cjs +4 -2
- package/dist/api/lb/v1/marshalling.gen.js +4 -2
- package/dist/api/lb/v1/types.gen.d.ts +4 -0
- package/dist/api/marketplace/v2/api.gen.cjs +8 -21
- package/dist/api/marketplace/v2/api.gen.d.ts +10 -24
- package/dist/api/marketplace/v2/api.gen.js +8 -21
- package/dist/api/marketplace/v2/types.gen.d.ts +94 -41
- package/dist/api/mnq/v1beta1/api.gen.cjs +24 -76
- package/dist/api/mnq/v1beta1/api.gen.d.ts +30 -82
- package/dist/api/mnq/v1beta1/api.gen.js +24 -76
- package/dist/api/mnq/v1beta1/types.gen.d.ts +342 -169
- package/dist/api/mongodb/v1alpha1/api.gen.cjs +19 -62
- package/dist/api/mongodb/v1alpha1/api.gen.d.ts +21 -64
- package/dist/api/mongodb/v1alpha1/api.gen.js +19 -62
- package/dist/api/mongodb/v1alpha1/types.gen.d.ts +443 -189
- package/dist/api/product_catalog/index.gen.cjs +4 -0
- package/dist/api/product_catalog/index.gen.d.ts +5 -0
- package/dist/api/product_catalog/index.gen.js +4 -0
- package/dist/api/product_catalog/v2alpha1/api.gen.cjs +36 -0
- package/dist/api/product_catalog/v2alpha1/api.gen.d.ts +18 -0
- package/dist/api/product_catalog/v2alpha1/api.gen.js +36 -0
- package/dist/api/product_catalog/v2alpha1/index.gen.cjs +6 -0
- package/dist/api/product_catalog/v2alpha1/index.gen.d.ts +3 -0
- package/dist/api/product_catalog/v2alpha1/index.gen.js +6 -0
- package/dist/api/product_catalog/v2alpha1/marshalling.gen.cjs +230 -0
- package/dist/api/product_catalog/v2alpha1/marshalling.gen.d.ts +2 -0
- package/dist/api/product_catalog/v2alpha1/marshalling.gen.js +230 -0
- package/dist/api/product_catalog/v2alpha1/types.gen.d.ts +293 -0
- package/dist/api/product_catalog/v2alpha1/validation-rules.gen.cjs +11 -0
- package/dist/api/product_catalog/v2alpha1/validation-rules.gen.d.ts +8 -0
- package/dist/api/product_catalog/v2alpha1/validation-rules.gen.js +11 -0
- package/dist/api/qaas/v1alpha1/api.gen.cjs +17 -34
- package/dist/api/qaas/v1alpha1/api.gen.d.ts +19 -36
- package/dist/api/qaas/v1alpha1/api.gen.js +17 -34
- package/dist/api/qaas/v1alpha1/types.gen.d.ts +502 -174
- package/dist/api/rdb/v1/api.gen.cjs +62 -202
- package/dist/api/rdb/v1/api.gen.d.ts +60 -201
- package/dist/api/rdb/v1/api.gen.js +62 -202
- package/dist/api/rdb/v1/types.gen.d.ts +1005 -524
- package/dist/api/redis/v1/api.gen.cjs +23 -83
- package/dist/api/redis/v1/api.gen.d.ts +25 -85
- package/dist/api/redis/v1/api.gen.js +23 -83
- package/dist/api/redis/v1/types.gen.d.ts +447 -170
- package/dist/api/registry/v1/api.gen.cjs +12 -40
- package/dist/api/registry/v1/api.gen.d.ts +14 -42
- package/dist/api/registry/v1/api.gen.js +12 -40
- package/dist/api/registry/v1/types.gen.d.ts +200 -116
- package/dist/api/secret/v1beta1/api.gen.cjs +19 -47
- package/dist/api/secret/v1beta1/api.gen.d.ts +21 -51
- package/dist/api/secret/v1beta1/api.gen.js +19 -47
- package/dist/api/secret/v1beta1/types.gen.d.ts +359 -224
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +9 -27
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.d.ts +11 -29
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +9 -27
- package/dist/api/serverless_sqldb/v1alpha1/types.gen.d.ts +168 -76
- package/dist/api/tem/v1alpha1/api.gen.cjs +22 -58
- package/dist/api/tem/v1alpha1/api.gen.d.ts +24 -60
- package/dist/api/tem/v1alpha1/api.gen.js +22 -58
- package/dist/api/tem/v1alpha1/types.gen.d.ts +761 -338
- package/dist/api/test/v1/api.gen.cjs +8 -11
- package/dist/api/test/v1/api.gen.d.ts +6 -9
- package/dist/api/test/v1/api.gen.js +8 -11
- package/dist/api/test/v1/types.gen.d.ts +21 -10
- package/dist/api/vpcgw/v1/api.gen.cjs +37 -0
- package/dist/api/vpcgw/v1/api.gen.d.ts +37 -0
- package/dist/api/vpcgw/v1/api.gen.js +37 -0
- package/dist/client/dist/package.json.cjs +1 -1
- package/dist/client/dist/package.json.js +1 -1
- package/dist/index.cjs +36 -32
- package/dist/index.js +36 -32
- package/node_modules/@scaleway/sdk-client/dist/package.json.cjs +1 -1
- package/node_modules/@scaleway/sdk-client/dist/package.json.js +1 -1
- package/node_modules/@scaleway/sdk-client/package.json +1 -2
- package/package.json +2 -2
- package/node_modules/@scaleway/sdk-client/LICENSE +0 -191
|
@@ -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,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,230 @@
|
|
|
1
|
+
import "../../../client/dist/internal/logger/index.js";
|
|
2
|
+
import { isJSONObject } from "../../../client/dist/helpers/json.js";
|
|
3
|
+
import { unmarshalMoney } from "../../../client/dist/scw/custom-marshalling.js";
|
|
4
|
+
import { unmarshalArrayOfObject } from "../../../client/dist/helpers/marshalling.js";
|
|
5
|
+
const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data) => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
benchmark: data.benchmark,
|
|
13
|
+
coresPerSocket: data.cores_per_socket,
|
|
14
|
+
frequency: data.frequency,
|
|
15
|
+
sockets: data.sockets,
|
|
16
|
+
threadsPerCore: data.threads_per_core
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data) => {
|
|
20
|
+
if (!isJSONObject(data)) {
|
|
21
|
+
throw new TypeError(
|
|
22
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
count: data.count
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data) => {
|
|
30
|
+
if (!isJSONObject(data)) {
|
|
31
|
+
throw new TypeError(
|
|
32
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
arch: data.arch,
|
|
37
|
+
description: data.description,
|
|
38
|
+
physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(
|
|
39
|
+
data.physical
|
|
40
|
+
) : void 0,
|
|
41
|
+
threads: data.threads,
|
|
42
|
+
type: data.type,
|
|
43
|
+
virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : void 0
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data) => {
|
|
47
|
+
if (!isJSONObject(data)) {
|
|
48
|
+
throw new TypeError(
|
|
49
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
count: data.count,
|
|
54
|
+
description: data.description,
|
|
55
|
+
type: data.type
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data) => {
|
|
59
|
+
if (!isJSONObject(data)) {
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
description: data.description,
|
|
66
|
+
internalBandwidth: data.internal_bandwidth,
|
|
67
|
+
maxPublicBandwidth: data.max_public_bandwidth,
|
|
68
|
+
publicBandwidth: data.public_bandwidth
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data) => {
|
|
72
|
+
if (!isJSONObject(data)) {
|
|
73
|
+
throw new TypeError(
|
|
74
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
description: data.description,
|
|
79
|
+
size: data.size,
|
|
80
|
+
type: data.type
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data) => {
|
|
84
|
+
if (!isJSONObject(data)) {
|
|
85
|
+
throw new TypeError(
|
|
86
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
description: data.description,
|
|
91
|
+
total: data.total
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const unmarshalPublicCatalogProductPriceUnitOfMeasure = (data) => {
|
|
95
|
+
if (!isJSONObject(data)) {
|
|
96
|
+
throw new TypeError(
|
|
97
|
+
`Unmarshalling the type 'PublicCatalogProductPriceUnitOfMeasure' failed as data isn't a dictionary.`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
size: data.size,
|
|
102
|
+
unit: data.unit
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data) => {
|
|
106
|
+
if (!isJSONObject(data)) {
|
|
107
|
+
throw new TypeError(
|
|
108
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
range: data.range
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const unmarshalPublicCatalogProductPropertiesDedibox = (data) => {
|
|
116
|
+
if (!isJSONObject(data)) {
|
|
117
|
+
throw new TypeError(
|
|
118
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
range: data.range
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
const unmarshalPublicCatalogProductPropertiesElasticMetal = (data) => {
|
|
126
|
+
if (!isJSONObject(data)) {
|
|
127
|
+
throw new TypeError(
|
|
128
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
range: data.range
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const unmarshalPublicCatalogProductPropertiesHardware = (data) => {
|
|
136
|
+
if (!isJSONObject(data)) {
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
cpu: data.cpu ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) : void 0,
|
|
143
|
+
gpu: data.gpu ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) : void 0,
|
|
144
|
+
network: data.network ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) : void 0,
|
|
145
|
+
ram: data.ram ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) : void 0,
|
|
146
|
+
storage: data.storage ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) : void 0
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
const unmarshalPublicCatalogProductPropertiesInstance = (data) => {
|
|
150
|
+
if (!isJSONObject(data)) {
|
|
151
|
+
throw new TypeError(
|
|
152
|
+
`Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
range: data.range
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
const unmarshalPublicCatalogProductLocality = (data) => {
|
|
160
|
+
if (!isJSONObject(data)) {
|
|
161
|
+
throw new TypeError(
|
|
162
|
+
`Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
datacenter: data.datacenter,
|
|
167
|
+
global: data.global,
|
|
168
|
+
region: data.region,
|
|
169
|
+
zone: data.zone
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
const unmarshalPublicCatalogProductPrice = (data) => {
|
|
173
|
+
if (!isJSONObject(data)) {
|
|
174
|
+
throw new TypeError(
|
|
175
|
+
`Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
retailPrice: data.retail_price ? unmarshalMoney(data.retail_price) : void 0,
|
|
180
|
+
unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductPriceUnitOfMeasure(data.unit_of_measure) : void 0
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
const unmarshalPublicCatalogProductProperties = (data) => {
|
|
184
|
+
if (!isJSONObject(data)) {
|
|
185
|
+
throw new TypeError(
|
|
186
|
+
`Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : void 0,
|
|
191
|
+
dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : void 0,
|
|
192
|
+
elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : void 0,
|
|
193
|
+
hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : void 0,
|
|
194
|
+
instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : void 0
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
const unmarshalPublicCatalogProduct = (data) => {
|
|
198
|
+
if (!isJSONObject(data)) {
|
|
199
|
+
throw new TypeError(
|
|
200
|
+
`Unmarshalling the type 'PublicCatalogProduct' failed as data isn't a dictionary.`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
description: data.description,
|
|
205
|
+
locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : void 0,
|
|
206
|
+
price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : void 0,
|
|
207
|
+
product: data.product,
|
|
208
|
+
properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : void 0,
|
|
209
|
+
serviceCategory: data.service_category,
|
|
210
|
+
sku: data.sku,
|
|
211
|
+
variant: data.variant
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
const unmarshalListPublicCatalogProductsResponse = (data) => {
|
|
215
|
+
if (!isJSONObject(data)) {
|
|
216
|
+
throw new TypeError(
|
|
217
|
+
`Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
products: unmarshalArrayOfObject(
|
|
222
|
+
data.products,
|
|
223
|
+
unmarshalPublicCatalogProduct
|
|
224
|
+
),
|
|
225
|
+
totalCount: data.total_count
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
export {
|
|
229
|
+
unmarshalListPublicCatalogProductsResponse
|
|
230
|
+
};
|