@scaleway/sdk 0.1.0-beta.9 → 1.0.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/README.md +1 -1
- package/dist/api/account/index.js +2 -2
- package/dist/api/account/v2/api.gen.js +5 -18
- package/dist/api/account/v2/index.gen.js +3 -0
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +3 -13
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
- package/dist/api/applesilicon/index.js +2 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
- package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
- package/dist/api/baremetal/v1/api.gen.js +47 -49
- package/dist/api/baremetal/v1/api.utils.js +2 -10
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/v1beta1/api.gen.js +5 -51
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
- package/dist/api/domain/index.js +2 -2
- package/dist/api/domain/v2beta1/api.gen.js +55 -85
- package/dist/api/domain/v2beta1/content.gen.js +22 -1
- package/dist/api/domain/v2beta1/index.gen.js +4 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
- package/dist/api/flexibleip/index.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +54 -57
- package/dist/api/function/v1beta1/content.gen.js +8 -5
- package/dist/api/function/v1beta1/index.gen.js +4 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
- package/dist/api/iam/index.js +2 -2
- package/dist/api/iam/v1alpha1/api.gen.js +15 -62
- package/dist/api/iam/v1alpha1/index.gen.js +5 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
- package/dist/api/instance/v1/api.gen.js +38 -118
- package/dist/api/instance/v1/api.utils.js +59 -51
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +46 -168
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -2
- package/dist/api/iot/v1/api.gen.js +5 -56
- package/dist/api/iot/v1/index.gen.js +4 -0
- package/dist/api/iot/v1/marshalling.gen.js +2 -51
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +17 -43
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/index.gen.js +6 -0
- package/dist/api/k8s/v1/marshalling.gen.js +18 -36
- package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
- package/dist/api/lb/v1/api.gen.js +8 -163
- package/dist/api/lb/v1/api.utils.js +3 -9
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +74 -101
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v1/api.gen.js +3 -13
- package/dist/api/marketplace/v1/index.gen.js +3 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
- package/dist/api/marketplace/v2/api.gen.js +85 -0
- package/dist/api/marketplace/v2/index.gen.js +3 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
- package/dist/api/mnq/index.js +2 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
- package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
- package/dist/api/rdb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +15 -89
- package/dist/api/rdb/v1/content.gen.js +10 -4
- package/dist/api/rdb/v1/index.gen.js +4 -0
- package/dist/api/rdb/v1/marshalling.gen.js +25 -81
- package/dist/api/redis/index.js +2 -2
- package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
- package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
- package/dist/api/redis/v1/index.gen.js +4 -0
- package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
- package/dist/api/registry/index.js +2 -2
- package/dist/api/registry/v1/api.gen.js +5 -29
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/registry/v1/marshalling.gen.js +2 -8
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +135 -0
- package/dist/api/secret/v1alpha1/index.gen.js +3 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +109 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
- package/dist/api/test/index.js +2 -2
- package/dist/api/test/v1/api.gen.js +6 -20
- package/dist/api/test/v1/index.gen.js +4 -0
- package/dist/api/test/v1/marshalling.gen.js +2 -5
- package/dist/api/vpc/index.js +2 -2
- package/dist/api/vpc/v1/api.gen.js +6 -17
- package/dist/api/vpc/v1/index.gen.js +3 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -3
- package/dist/api/vpcgw/index.js +2 -2
- package/dist/api/vpcgw/v1/api.gen.js +5 -64
- package/dist/api/vpcgw/v1/content.gen.js +2 -2
- package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
- package/dist/helpers/json.js +1 -2
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3864 -2945
- package/dist/index.d.ts +7212 -4332
- package/dist/index.js +10 -6
- package/dist/internal/async/interval-retrier.js +10 -16
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +3 -5
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +3 -4
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +32 -15
- package/dist/scw/client-ini-profile.js +10 -4
- package/dist/scw/client-settings.js +32 -15
- package/dist/scw/client.js +5 -6
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +8 -14
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
- package/dist/scw/errors/scw-error.js +20 -20
- package/dist/scw/errors/standard/already-exists-error.js +3 -4
- package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
- package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
- package/dist/scw/errors/standard/resource-expired-error.js +3 -4
- package/dist/scw/errors/standard/resource-locked-error.js +3 -4
- package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +3 -4
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +9 -12
- package/dist/scw/fetch/resource-paginator.js +18 -16
- package/dist/scw/fetch/response-parser.js +17 -23
- package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
- package/node_modules/@scaleway/random-name/dist/index.js +5 -246
- package/node_modules/@scaleway/random-name/package.json +6 -5
- package/package.json +4 -5
- package/dist/api/account/v2/index.js +0 -1
- package/dist/api/applesilicon/v1alpha1/index.js +0 -2
- package/dist/api/domain/v2beta1/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/index.js +0 -2
- package/dist/api/function/v1beta1/index.js +0 -2
- package/dist/api/iam/v1alpha1/index.js +0 -1
- package/dist/api/iot/v1/index.js +0 -2
- package/dist/api/k8s/v1/index.js +0 -2
- package/dist/api/marketplace/v1/index.js +0 -1
- package/dist/api/mnq/v1alpha1/index.js +0 -1
- package/dist/api/rdb/v1/index.js +0 -2
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/test/v1/index.js +0 -1
- package/dist/api/vpc/v1/index.js +0 -1
- package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
- package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const marshalVolumeSummary = (request, defaults) => ({
|
|
2
|
+
id: request.id,
|
|
3
|
+
name: request.name,
|
|
4
|
+
size: request.size,
|
|
5
|
+
volume_type: request.volumeType
|
|
6
|
+
});
|
|
7
|
+
const marshalServerSummary = (request, defaults) => ({
|
|
8
|
+
id: request.id,
|
|
9
|
+
name: request.name
|
|
10
|
+
});
|
|
11
|
+
const marshalBootscript = (request, defaults) => ({
|
|
12
|
+
arch: request.arch,
|
|
13
|
+
bootcmdargs: request.bootcmdargs,
|
|
14
|
+
default: request.default,
|
|
15
|
+
dtb: request.dtb,
|
|
16
|
+
id: request.id,
|
|
17
|
+
initrd: request.initrd,
|
|
18
|
+
kernel: request.kernel,
|
|
19
|
+
organization: request.organization,
|
|
20
|
+
project: request.project,
|
|
21
|
+
public: request.public,
|
|
22
|
+
title: request.title,
|
|
23
|
+
zone: request.zone
|
|
24
|
+
});
|
|
25
|
+
const marshalVolume = (request, defaults) => ({
|
|
26
|
+
creation_date: request.creationDate,
|
|
27
|
+
export_uri: request.exportUri,
|
|
28
|
+
id: request.id,
|
|
29
|
+
modification_date: request.modificationDate,
|
|
30
|
+
name: request.name,
|
|
31
|
+
organization: request.organization,
|
|
32
|
+
project: request.project,
|
|
33
|
+
server: request.server ? marshalServerSummary(request.server) : undefined,
|
|
34
|
+
size: request.size,
|
|
35
|
+
state: request.state,
|
|
36
|
+
tags: request.tags,
|
|
37
|
+
volume_type: request.volumeType,
|
|
38
|
+
zone: request.zone
|
|
39
|
+
});
|
|
40
|
+
const marshalSetImageRequestWithID = (request, defaults) => ({
|
|
41
|
+
arch: request.arch,
|
|
42
|
+
creation_date: request.creationDate,
|
|
43
|
+
default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined,
|
|
44
|
+
extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, _ref) => {
|
|
45
|
+
let [key, value] = _ref;
|
|
46
|
+
return {
|
|
47
|
+
...acc,
|
|
48
|
+
[key]: marshalVolume(value)
|
|
49
|
+
};
|
|
50
|
+
}, {}) : undefined,
|
|
51
|
+
from_server: request.fromServer,
|
|
52
|
+
modification_date: request.modificationDate,
|
|
53
|
+
id: request.id,
|
|
54
|
+
name: request.name,
|
|
55
|
+
organization: request.organization,
|
|
56
|
+
project: request.project,
|
|
57
|
+
public: request.public,
|
|
58
|
+
root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined,
|
|
59
|
+
state: request.state,
|
|
60
|
+
tags: request.tags
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { marshalSetImageRequestWithID };
|
package/dist/api/iot/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1/index.gen.js';
|
|
2
|
+
export { index_gen as v1 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API } from '../../../scw/api.js';
|
|
2
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
3
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { HUB_TRANSIENT_STATUSES } from './content.gen.js';
|
|
@@ -9,298 +9,247 @@ import { unmarshalListHubsResponse, marshalCreateHubRequest, unmarshalHub, marsh
|
|
|
9
9
|
const jsonContentHeaders = {
|
|
10
10
|
'Content-Type': 'application/json; charset=utf-8'
|
|
11
11
|
};
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* IoT API.
|
|
14
15
|
*
|
|
15
16
|
* This API allows you to manage IoT hubs and devices.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
class IotV1GenAPI extends API {
|
|
18
|
+
class API extends API$1 {
|
|
19
19
|
constructor() {
|
|
20
20
|
var _this;
|
|
21
|
-
|
|
22
21
|
super(...arguments);
|
|
23
22
|
_this = this;
|
|
24
|
-
|
|
25
23
|
this.pageOfListHubs = function (request) {
|
|
26
24
|
if (request === void 0) {
|
|
27
25
|
request = {};
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
return _this.client.fetch({
|
|
31
28
|
method: 'GET',
|
|
32
29
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/hubs`,
|
|
33
30
|
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
|
|
34
31
|
}, unmarshalListHubsResponse);
|
|
35
32
|
};
|
|
36
|
-
|
|
37
33
|
this.listHubs = function (request) {
|
|
38
34
|
if (request === void 0) {
|
|
39
35
|
request = {};
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
return enrichForPagination('hubs', _this.pageOfListHubs, request);
|
|
43
38
|
};
|
|
44
|
-
|
|
45
39
|
this.createHub = request => this.client.fetch({
|
|
46
40
|
body: JSON.stringify(marshalCreateHubRequest(request, this.client.settings)),
|
|
47
41
|
headers: jsonContentHeaders,
|
|
48
42
|
method: 'POST',
|
|
49
43
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs`
|
|
50
44
|
}, unmarshalHub);
|
|
51
|
-
|
|
52
45
|
this.getHub = request => this.client.fetch({
|
|
53
46
|
method: 'GET',
|
|
54
47
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`
|
|
55
48
|
}, unmarshalHub);
|
|
56
|
-
|
|
57
49
|
this.waitForHub = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!HUB_TRANSIENT_STATUSES.includes(res.status))), this.getHub, request, options);
|
|
58
|
-
|
|
59
50
|
this.updateHub = request => this.client.fetch({
|
|
60
51
|
body: JSON.stringify(marshalUpdateHubRequest(request, this.client.settings)),
|
|
61
52
|
headers: jsonContentHeaders,
|
|
62
53
|
method: 'PATCH',
|
|
63
54
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`
|
|
64
55
|
}, unmarshalHub);
|
|
65
|
-
|
|
66
56
|
this.enableHub = request => this.client.fetch({
|
|
67
57
|
body: '{}',
|
|
68
58
|
headers: jsonContentHeaders,
|
|
69
59
|
method: 'POST',
|
|
70
60
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/enable`
|
|
71
61
|
}, unmarshalHub);
|
|
72
|
-
|
|
73
62
|
this.disableHub = request => this.client.fetch({
|
|
74
63
|
body: '{}',
|
|
75
64
|
headers: jsonContentHeaders,
|
|
76
65
|
method: 'POST',
|
|
77
66
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/disable`
|
|
78
67
|
}, unmarshalHub);
|
|
79
|
-
|
|
80
68
|
this.deleteHub = request => this.client.fetch({
|
|
81
69
|
method: 'DELETE',
|
|
82
70
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`,
|
|
83
71
|
urlParams: urlParams(['delete_devices', request.deleteDevices])
|
|
84
72
|
});
|
|
85
|
-
|
|
86
73
|
this.getHubMetrics = request => this.client.fetch({
|
|
87
74
|
method: 'GET',
|
|
88
75
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/metrics`,
|
|
89
76
|
urlParams: urlParams(['start_date', request.startDate])
|
|
90
77
|
}, unmarshalGetHubMetricsResponse);
|
|
91
|
-
|
|
92
78
|
this.setHubCA = request => this.client.fetch({
|
|
93
79
|
body: JSON.stringify(marshalSetHubCARequest(request, this.client.settings)),
|
|
94
80
|
headers: jsonContentHeaders,
|
|
95
81
|
method: 'POST',
|
|
96
82
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca`
|
|
97
83
|
}, unmarshalHub);
|
|
98
|
-
|
|
99
84
|
this.getHubCA = request => this.client.fetch({
|
|
100
85
|
method: 'GET',
|
|
101
86
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca`
|
|
102
87
|
}, unmarshalGetHubCAResponse);
|
|
103
|
-
|
|
104
88
|
this.pageOfListDevices = function (request) {
|
|
105
89
|
if (request === void 0) {
|
|
106
90
|
request = {};
|
|
107
91
|
}
|
|
108
|
-
|
|
109
92
|
return _this.client.fetch({
|
|
110
93
|
method: 'GET',
|
|
111
94
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/devices`,
|
|
112
95
|
urlParams: urlParams(['allow_insecure', request.allowInsecure], ['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown'])
|
|
113
96
|
}, unmarshalListDevicesResponse);
|
|
114
97
|
};
|
|
115
|
-
|
|
116
98
|
this.listDevices = function (request) {
|
|
117
99
|
if (request === void 0) {
|
|
118
100
|
request = {};
|
|
119
101
|
}
|
|
120
|
-
|
|
121
102
|
return enrichForPagination('devices', _this.pageOfListDevices, request);
|
|
122
103
|
};
|
|
123
|
-
|
|
124
104
|
this.createDevice = request => this.client.fetch({
|
|
125
105
|
body: JSON.stringify(marshalCreateDeviceRequest(request, this.client.settings)),
|
|
126
106
|
headers: jsonContentHeaders,
|
|
127
107
|
method: 'POST',
|
|
128
108
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices`
|
|
129
109
|
}, unmarshalCreateDeviceResponse);
|
|
130
|
-
|
|
131
110
|
this.getDevice = request => this.client.fetch({
|
|
132
111
|
method: 'GET',
|
|
133
112
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`
|
|
134
113
|
}, unmarshalDevice);
|
|
135
|
-
|
|
136
114
|
this.updateDevice = request => this.client.fetch({
|
|
137
115
|
body: JSON.stringify(marshalUpdateDeviceRequest(request, this.client.settings)),
|
|
138
116
|
headers: jsonContentHeaders,
|
|
139
117
|
method: 'PATCH',
|
|
140
118
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`
|
|
141
119
|
}, unmarshalDevice);
|
|
142
|
-
|
|
143
120
|
this.enableDevice = request => this.client.fetch({
|
|
144
121
|
body: '{}',
|
|
145
122
|
headers: jsonContentHeaders,
|
|
146
123
|
method: 'POST',
|
|
147
124
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/enable`
|
|
148
125
|
}, unmarshalDevice);
|
|
149
|
-
|
|
150
126
|
this.disableDevice = request => this.client.fetch({
|
|
151
127
|
body: '{}',
|
|
152
128
|
headers: jsonContentHeaders,
|
|
153
129
|
method: 'POST',
|
|
154
130
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/disable`
|
|
155
131
|
}, unmarshalDevice);
|
|
156
|
-
|
|
157
132
|
this.renewDeviceCertificate = request => this.client.fetch({
|
|
158
133
|
body: '{}',
|
|
159
134
|
headers: jsonContentHeaders,
|
|
160
135
|
method: 'POST',
|
|
161
136
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/renew-certificate`
|
|
162
137
|
}, unmarshalRenewDeviceCertificateResponse);
|
|
163
|
-
|
|
164
138
|
this.setDeviceCertificate = request => this.client.fetch({
|
|
165
139
|
body: JSON.stringify(marshalSetDeviceCertificateRequest(request, this.client.settings)),
|
|
166
140
|
headers: jsonContentHeaders,
|
|
167
141
|
method: 'PUT',
|
|
168
142
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate`
|
|
169
143
|
}, unmarshalSetDeviceCertificateResponse);
|
|
170
|
-
|
|
171
144
|
this.getDeviceCertificate = request => this.client.fetch({
|
|
172
145
|
method: 'GET',
|
|
173
146
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate`
|
|
174
147
|
}, unmarshalGetDeviceCertificateResponse);
|
|
175
|
-
|
|
176
148
|
this.deleteDevice = request => this.client.fetch({
|
|
177
149
|
method: 'DELETE',
|
|
178
150
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`
|
|
179
151
|
});
|
|
180
|
-
|
|
181
152
|
this.getDeviceMetrics = request => this.client.fetch({
|
|
182
153
|
method: 'GET',
|
|
183
154
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/metrics`,
|
|
184
155
|
urlParams: urlParams(['start_date', request.startDate])
|
|
185
156
|
}, unmarshalGetDeviceMetricsResponse);
|
|
186
|
-
|
|
187
157
|
this.pageOfListRoutes = function (request) {
|
|
188
158
|
if (request === void 0) {
|
|
189
159
|
request = {};
|
|
190
160
|
}
|
|
191
|
-
|
|
192
161
|
return _this.client.fetch({
|
|
193
162
|
method: 'GET',
|
|
194
163
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/routes`,
|
|
195
164
|
urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
196
165
|
}, unmarshalListRoutesResponse);
|
|
197
166
|
};
|
|
198
|
-
|
|
199
167
|
this.listRoutes = function (request) {
|
|
200
168
|
if (request === void 0) {
|
|
201
169
|
request = {};
|
|
202
170
|
}
|
|
203
|
-
|
|
204
171
|
return enrichForPagination('routes', _this.pageOfListRoutes, request);
|
|
205
172
|
};
|
|
206
|
-
|
|
207
173
|
this.createRoute = request => this.client.fetch({
|
|
208
174
|
body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
|
|
209
175
|
headers: jsonContentHeaders,
|
|
210
176
|
method: 'POST',
|
|
211
177
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`
|
|
212
178
|
}, unmarshalRoute);
|
|
213
|
-
|
|
214
179
|
this.updateRoute = request => this.client.fetch({
|
|
215
180
|
body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
|
|
216
181
|
headers: jsonContentHeaders,
|
|
217
182
|
method: 'PATCH',
|
|
218
183
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
|
|
219
184
|
}, unmarshalRoute);
|
|
220
|
-
|
|
221
185
|
this.getRoute = request => this.client.fetch({
|
|
222
186
|
method: 'GET',
|
|
223
187
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
|
|
224
188
|
}, unmarshalRoute);
|
|
225
|
-
|
|
226
189
|
this.deleteRoute = request => this.client.fetch({
|
|
227
190
|
method: 'DELETE',
|
|
228
191
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`
|
|
229
192
|
});
|
|
230
|
-
|
|
231
193
|
this.pageOfListNetworks = function (request) {
|
|
232
194
|
if (request === void 0) {
|
|
233
195
|
request = {};
|
|
234
196
|
}
|
|
235
|
-
|
|
236
197
|
return _this.client.fetch({
|
|
237
198
|
method: 'GET',
|
|
238
199
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/networks`,
|
|
239
200
|
urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['topic_prefix', request.topicPrefix])
|
|
240
201
|
}, unmarshalListNetworksResponse);
|
|
241
202
|
};
|
|
242
|
-
|
|
243
203
|
this.listNetworks = function (request) {
|
|
244
204
|
if (request === void 0) {
|
|
245
205
|
request = {};
|
|
246
206
|
}
|
|
247
|
-
|
|
248
207
|
return enrichForPagination('networks', _this.pageOfListNetworks, request);
|
|
249
208
|
};
|
|
250
|
-
|
|
251
209
|
this.createNetwork = request => this.client.fetch({
|
|
252
210
|
body: JSON.stringify(marshalCreateNetworkRequest(request, this.client.settings)),
|
|
253
211
|
headers: jsonContentHeaders,
|
|
254
212
|
method: 'POST',
|
|
255
213
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks`
|
|
256
214
|
}, unmarshalCreateNetworkResponse);
|
|
257
|
-
|
|
258
215
|
this.getNetwork = request => this.client.fetch({
|
|
259
216
|
method: 'GET',
|
|
260
217
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`
|
|
261
218
|
}, unmarshalNetwork);
|
|
262
|
-
|
|
263
219
|
this.deleteNetwork = request => this.client.fetch({
|
|
264
220
|
method: 'DELETE',
|
|
265
221
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`
|
|
266
222
|
});
|
|
267
|
-
|
|
268
223
|
this.getTwinDocument = request => this.client.fetch({
|
|
269
224
|
method: 'GET',
|
|
270
225
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`
|
|
271
226
|
}, unmarshalTwinDocument);
|
|
272
|
-
|
|
273
227
|
this.putTwinDocument = request => this.client.fetch({
|
|
274
228
|
body: JSON.stringify(marshalPutTwinDocumentRequest(request, this.client.settings)),
|
|
275
229
|
headers: jsonContentHeaders,
|
|
276
230
|
method: 'PUT',
|
|
277
231
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`
|
|
278
232
|
}, unmarshalTwinDocument);
|
|
279
|
-
|
|
280
233
|
this.patchTwinDocument = request => this.client.fetch({
|
|
281
234
|
body: JSON.stringify(marshalPatchTwinDocumentRequest(request, this.client.settings)),
|
|
282
235
|
headers: jsonContentHeaders,
|
|
283
236
|
method: 'PATCH',
|
|
284
237
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`
|
|
285
238
|
}, unmarshalTwinDocument);
|
|
286
|
-
|
|
287
239
|
this.deleteTwinDocument = request => this.client.fetch({
|
|
288
240
|
method: 'DELETE',
|
|
289
241
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`
|
|
290
242
|
});
|
|
291
|
-
|
|
292
243
|
this.listTwinDocuments = request => this.client.fetch({
|
|
293
244
|
method: 'GET',
|
|
294
245
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`
|
|
295
246
|
}, unmarshalListTwinDocumentsResponse);
|
|
296
|
-
|
|
297
247
|
this.deleteTwinDocuments = request => this.client.fetch({
|
|
298
248
|
method: 'DELETE',
|
|
299
249
|
path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`
|
|
300
250
|
});
|
|
301
251
|
}
|
|
302
|
-
|
|
303
252
|
}
|
|
304
|
-
|
|
253
|
+
API.LOCALITIES = ['fr-par'];
|
|
305
254
|
|
|
306
|
-
export {
|
|
255
|
+
export { API };
|