@scaleway/sdk-iot 1.2.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +1 -1
- package/dist/v1/api.gen.js +52 -44
- package/dist/v1/content.gen.js +4 -1
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +1 -4
- package/dist/v1/types.gen.d.ts +1 -1
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -591
- package/dist/v1/content.gen.cjs +0 -4
- package/dist/v1/index.gen.cjs +0 -36
- package/dist/v1/marshalling.gen.cjs +0 -536
package/dist/v1/api.gen.cjs
DELETED
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
4
|
-
const content_gen = require("./content.gen.cjs");
|
|
5
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
-
const jsonContentHeaders = {
|
|
7
|
-
"Content-Type": "application/json; charset=utf-8"
|
|
8
|
-
};
|
|
9
|
-
class API extends sdkClient.API {
|
|
10
|
-
/**
|
|
11
|
-
* Locality of this API.
|
|
12
|
-
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
-
*/
|
|
14
|
-
static LOCALITY = sdkClient.toApiLocality({
|
|
15
|
-
regions: ["fr-par"]
|
|
16
|
-
});
|
|
17
|
-
pageOfListHubs = (request = {}) => this.client.fetch(
|
|
18
|
-
{
|
|
19
|
-
method: "GET",
|
|
20
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs`,
|
|
21
|
-
urlParams: sdkClient.urlParams(
|
|
22
|
-
["name", request.name],
|
|
23
|
-
["order_by", request.orderBy],
|
|
24
|
-
["organization_id", request.organizationId],
|
|
25
|
-
["page", request.page],
|
|
26
|
-
[
|
|
27
|
-
"page_size",
|
|
28
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
29
|
-
],
|
|
30
|
-
["project_id", request.projectId]
|
|
31
|
-
)
|
|
32
|
-
},
|
|
33
|
-
marshalling_gen.unmarshalListHubsResponse
|
|
34
|
-
);
|
|
35
|
-
/**
|
|
36
|
-
* List hubs. List all Hubs in the specified zone. By default, returned Hubs are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
37
|
-
*
|
|
38
|
-
* @param request - The request {@link ListHubsRequest}
|
|
39
|
-
* @returns A Promise of ListHubsResponse
|
|
40
|
-
*/
|
|
41
|
-
listHubs = (request = {}) => sdkClient.enrichForPagination("hubs", this.pageOfListHubs, request);
|
|
42
|
-
/**
|
|
43
|
-
* Create a hub. Create a new Hub in the targeted region, specifying its configuration including name and product plan.
|
|
44
|
-
*
|
|
45
|
-
* @param request - The request {@link CreateHubRequest}
|
|
46
|
-
* @returns A Promise of Hub
|
|
47
|
-
*/
|
|
48
|
-
createHub = (request) => this.client.fetch(
|
|
49
|
-
{
|
|
50
|
-
body: JSON.stringify(
|
|
51
|
-
marshalling_gen.marshalCreateHubRequest(request, this.client.settings)
|
|
52
|
-
),
|
|
53
|
-
headers: jsonContentHeaders,
|
|
54
|
-
method: "POST",
|
|
55
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs`
|
|
56
|
-
},
|
|
57
|
-
marshalling_gen.unmarshalHub
|
|
58
|
-
);
|
|
59
|
-
/**
|
|
60
|
-
* Get a hub. Retrieve information about an existing IoT Hub, specified by its Hub ID. Its full details, including name, status and endpoint, are returned in the response object.
|
|
61
|
-
*
|
|
62
|
-
* @param request - The request {@link GetHubRequest}
|
|
63
|
-
* @returns A Promise of Hub
|
|
64
|
-
*/
|
|
65
|
-
getHub = (request) => this.client.fetch(
|
|
66
|
-
{
|
|
67
|
-
method: "GET",
|
|
68
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}`
|
|
69
|
-
},
|
|
70
|
-
marshalling_gen.unmarshalHub
|
|
71
|
-
);
|
|
72
|
-
/**
|
|
73
|
-
* Waits for {@link Hub} to be in a final state.
|
|
74
|
-
*
|
|
75
|
-
* @param request - The request {@link GetHubRequest}
|
|
76
|
-
* @param options - The waiting options
|
|
77
|
-
* @returns A Promise of Hub
|
|
78
|
-
*/
|
|
79
|
-
waitForHub = (request, options) => sdkClient.waitForResource(
|
|
80
|
-
options?.stop ?? ((res) => Promise.resolve(!content_gen.HUB_TRANSIENT_STATUSES.includes(res.status))),
|
|
81
|
-
this.getHub,
|
|
82
|
-
request,
|
|
83
|
-
options
|
|
84
|
-
);
|
|
85
|
-
/**
|
|
86
|
-
* Update a hub. Update the parameters of an existing IoT Hub, specified by its Hub ID.
|
|
87
|
-
*
|
|
88
|
-
* @param request - The request {@link UpdateHubRequest}
|
|
89
|
-
* @returns A Promise of Hub
|
|
90
|
-
*/
|
|
91
|
-
updateHub = (request) => this.client.fetch(
|
|
92
|
-
{
|
|
93
|
-
body: JSON.stringify(
|
|
94
|
-
marshalling_gen.marshalUpdateHubRequest(request, this.client.settings)
|
|
95
|
-
),
|
|
96
|
-
headers: jsonContentHeaders,
|
|
97
|
-
method: "PATCH",
|
|
98
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}`
|
|
99
|
-
},
|
|
100
|
-
marshalling_gen.unmarshalHub
|
|
101
|
-
);
|
|
102
|
-
/**
|
|
103
|
-
* Enable a hub. Enable an existing IoT Hub, specified by its Hub ID.
|
|
104
|
-
*
|
|
105
|
-
* @param request - The request {@link EnableHubRequest}
|
|
106
|
-
* @returns A Promise of Hub
|
|
107
|
-
*/
|
|
108
|
-
enableHub = (request) => this.client.fetch(
|
|
109
|
-
{
|
|
110
|
-
body: "{}",
|
|
111
|
-
headers: jsonContentHeaders,
|
|
112
|
-
method: "POST",
|
|
113
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}/enable`
|
|
114
|
-
},
|
|
115
|
-
marshalling_gen.unmarshalHub
|
|
116
|
-
);
|
|
117
|
-
/**
|
|
118
|
-
* Disable a hub. Disable an existing IoT Hub, specified by its Hub ID.
|
|
119
|
-
*
|
|
120
|
-
* @param request - The request {@link DisableHubRequest}
|
|
121
|
-
* @returns A Promise of Hub
|
|
122
|
-
*/
|
|
123
|
-
disableHub = (request) => this.client.fetch(
|
|
124
|
-
{
|
|
125
|
-
body: "{}",
|
|
126
|
-
headers: jsonContentHeaders,
|
|
127
|
-
method: "POST",
|
|
128
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}/disable`
|
|
129
|
-
},
|
|
130
|
-
marshalling_gen.unmarshalHub
|
|
131
|
-
);
|
|
132
|
-
/**
|
|
133
|
-
* Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting a Hub is permanent, and cannot be undone.
|
|
134
|
-
*
|
|
135
|
-
* @param request - The request {@link DeleteHubRequest}
|
|
136
|
-
*/
|
|
137
|
-
deleteHub = (request) => this.client.fetch({
|
|
138
|
-
method: "DELETE",
|
|
139
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}`,
|
|
140
|
-
urlParams: sdkClient.urlParams(["delete_devices", request.deleteDevices])
|
|
141
|
-
});
|
|
142
|
-
/**
|
|
143
|
-
* Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by its Hub ID.
|
|
144
|
-
*
|
|
145
|
-
* @deprecated
|
|
146
|
-
* @param request - The request {@link GetHubMetricsRequest}
|
|
147
|
-
* @returns A Promise of GetHubMetricsResponse
|
|
148
|
-
*/
|
|
149
|
-
getHubMetrics = (request) => this.client.fetch(
|
|
150
|
-
{
|
|
151
|
-
method: "GET",
|
|
152
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}/metrics`,
|
|
153
|
-
urlParams: sdkClient.urlParams(["start_date", request.startDate])
|
|
154
|
-
},
|
|
155
|
-
marshalling_gen.unmarshalGetHubMetricsResponse
|
|
156
|
-
);
|
|
157
|
-
/**
|
|
158
|
-
* Set the certificate authority of a hub. Set a particular PEM-encoded certificate, specified by the Hub ID.
|
|
159
|
-
*
|
|
160
|
-
* @param request - The request {@link SetHubCARequest}
|
|
161
|
-
* @returns A Promise of Hub
|
|
162
|
-
*/
|
|
163
|
-
setHubCA = (request) => this.client.fetch(
|
|
164
|
-
{
|
|
165
|
-
body: JSON.stringify(
|
|
166
|
-
marshalling_gen.marshalSetHubCARequest(request, this.client.settings)
|
|
167
|
-
),
|
|
168
|
-
headers: jsonContentHeaders,
|
|
169
|
-
method: "POST",
|
|
170
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}/ca`
|
|
171
|
-
},
|
|
172
|
-
marshalling_gen.unmarshalHub
|
|
173
|
-
);
|
|
174
|
-
/**
|
|
175
|
-
* Get the certificate authority of a hub. Get information for a particular PEM-encoded certificate, specified by the Hub ID.
|
|
176
|
-
*
|
|
177
|
-
* @param request - The request {@link GetHubCARequest}
|
|
178
|
-
* @returns A Promise of GetHubCAResponse
|
|
179
|
-
*/
|
|
180
|
-
getHubCA = (request) => this.client.fetch(
|
|
181
|
-
{
|
|
182
|
-
method: "GET",
|
|
183
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${sdkClient.validatePathParam("hubId", request.hubId)}/ca`
|
|
184
|
-
},
|
|
185
|
-
marshalling_gen.unmarshalGetHubCAResponse
|
|
186
|
-
);
|
|
187
|
-
pageOfListDevices = (request = {}) => this.client.fetch(
|
|
188
|
-
{
|
|
189
|
-
method: "GET",
|
|
190
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices`,
|
|
191
|
-
urlParams: sdkClient.urlParams(
|
|
192
|
-
["allow_insecure", request.allowInsecure],
|
|
193
|
-
["hub_id", request.hubId],
|
|
194
|
-
["name", request.name],
|
|
195
|
-
["order_by", request.orderBy],
|
|
196
|
-
["page", request.page],
|
|
197
|
-
[
|
|
198
|
-
"page_size",
|
|
199
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
200
|
-
],
|
|
201
|
-
["status", request.status]
|
|
202
|
-
)
|
|
203
|
-
},
|
|
204
|
-
marshalling_gen.unmarshalListDevicesResponse
|
|
205
|
-
);
|
|
206
|
-
/**
|
|
207
|
-
* List devices. List all devices in the specified region. By default, returned devices are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
208
|
-
*
|
|
209
|
-
* @param request - The request {@link ListDevicesRequest}
|
|
210
|
-
* @returns A Promise of ListDevicesResponse
|
|
211
|
-
*/
|
|
212
|
-
listDevices = (request = {}) => sdkClient.enrichForPagination("devices", this.pageOfListDevices, request);
|
|
213
|
-
/**
|
|
214
|
-
* Add a device. Attach a device to a given Hub.
|
|
215
|
-
*
|
|
216
|
-
* @param request - The request {@link CreateDeviceRequest}
|
|
217
|
-
* @returns A Promise of CreateDeviceResponse
|
|
218
|
-
*/
|
|
219
|
-
createDevice = (request) => this.client.fetch(
|
|
220
|
-
{
|
|
221
|
-
body: JSON.stringify(
|
|
222
|
-
marshalling_gen.marshalCreateDeviceRequest(request, this.client.settings)
|
|
223
|
-
),
|
|
224
|
-
headers: jsonContentHeaders,
|
|
225
|
-
method: "POST",
|
|
226
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices`
|
|
227
|
-
},
|
|
228
|
-
marshalling_gen.unmarshalCreateDeviceResponse
|
|
229
|
-
);
|
|
230
|
-
/**
|
|
231
|
-
* Get a device. Retrieve information about an existing device, specified by its device ID. Its full details, including name, status and ID, are returned in the response object.
|
|
232
|
-
*
|
|
233
|
-
* @param request - The request {@link GetDeviceRequest}
|
|
234
|
-
* @returns A Promise of Device
|
|
235
|
-
*/
|
|
236
|
-
getDevice = (request) => this.client.fetch(
|
|
237
|
-
{
|
|
238
|
-
method: "GET",
|
|
239
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}`
|
|
240
|
-
},
|
|
241
|
-
marshalling_gen.unmarshalDevice
|
|
242
|
-
);
|
|
243
|
-
/**
|
|
244
|
-
* Update a device. Update the parameters of an existing device, specified by its device ID.
|
|
245
|
-
*
|
|
246
|
-
* @param request - The request {@link UpdateDeviceRequest}
|
|
247
|
-
* @returns A Promise of Device
|
|
248
|
-
*/
|
|
249
|
-
updateDevice = (request) => this.client.fetch(
|
|
250
|
-
{
|
|
251
|
-
body: JSON.stringify(
|
|
252
|
-
marshalling_gen.marshalUpdateDeviceRequest(request, this.client.settings)
|
|
253
|
-
),
|
|
254
|
-
headers: jsonContentHeaders,
|
|
255
|
-
method: "PATCH",
|
|
256
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}`
|
|
257
|
-
},
|
|
258
|
-
marshalling_gen.unmarshalDevice
|
|
259
|
-
);
|
|
260
|
-
/**
|
|
261
|
-
* Enable a device. Enable a specific device, specified by its device ID.
|
|
262
|
-
*
|
|
263
|
-
* @param request - The request {@link EnableDeviceRequest}
|
|
264
|
-
* @returns A Promise of Device
|
|
265
|
-
*/
|
|
266
|
-
enableDevice = (request) => this.client.fetch(
|
|
267
|
-
{
|
|
268
|
-
body: "{}",
|
|
269
|
-
headers: jsonContentHeaders,
|
|
270
|
-
method: "POST",
|
|
271
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/enable`
|
|
272
|
-
},
|
|
273
|
-
marshalling_gen.unmarshalDevice
|
|
274
|
-
);
|
|
275
|
-
/**
|
|
276
|
-
* Disable a device. Disable an existing device, specified by its device ID.
|
|
277
|
-
*
|
|
278
|
-
* @param request - The request {@link DisableDeviceRequest}
|
|
279
|
-
* @returns A Promise of Device
|
|
280
|
-
*/
|
|
281
|
-
disableDevice = (request) => this.client.fetch(
|
|
282
|
-
{
|
|
283
|
-
body: "{}",
|
|
284
|
-
headers: jsonContentHeaders,
|
|
285
|
-
method: "POST",
|
|
286
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/disable`
|
|
287
|
-
},
|
|
288
|
-
marshalling_gen.unmarshalDevice
|
|
289
|
-
);
|
|
290
|
-
/**
|
|
291
|
-
* Renew a device certificate. Renew the certificate of an existing device, specified by its device ID.
|
|
292
|
-
*
|
|
293
|
-
* @param request - The request {@link RenewDeviceCertificateRequest}
|
|
294
|
-
* @returns A Promise of RenewDeviceCertificateResponse
|
|
295
|
-
*/
|
|
296
|
-
renewDeviceCertificate = (request) => this.client.fetch(
|
|
297
|
-
{
|
|
298
|
-
body: "{}",
|
|
299
|
-
headers: jsonContentHeaders,
|
|
300
|
-
method: "POST",
|
|
301
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/renew-certificate`
|
|
302
|
-
},
|
|
303
|
-
marshalling_gen.unmarshalRenewDeviceCertificateResponse
|
|
304
|
-
);
|
|
305
|
-
/**
|
|
306
|
-
* Set a custom certificate on a device. Switch the existing certificate of a given device with an EM-encoded custom certificate.
|
|
307
|
-
*
|
|
308
|
-
* @param request - The request {@link SetDeviceCertificateRequest}
|
|
309
|
-
* @returns A Promise of SetDeviceCertificateResponse
|
|
310
|
-
*/
|
|
311
|
-
setDeviceCertificate = (request) => this.client.fetch(
|
|
312
|
-
{
|
|
313
|
-
body: JSON.stringify(
|
|
314
|
-
marshalling_gen.marshalSetDeviceCertificateRequest(request, this.client.settings)
|
|
315
|
-
),
|
|
316
|
-
headers: jsonContentHeaders,
|
|
317
|
-
method: "PUT",
|
|
318
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/certificate`
|
|
319
|
-
},
|
|
320
|
-
marshalling_gen.unmarshalSetDeviceCertificateResponse
|
|
321
|
-
);
|
|
322
|
-
/**
|
|
323
|
-
* Get a device's certificate. Get information for a particular PEM-encoded certificate, specified by the device ID. The response returns full details of the device, including its type of certificate.
|
|
324
|
-
*
|
|
325
|
-
* @param request - The request {@link GetDeviceCertificateRequest}
|
|
326
|
-
* @returns A Promise of GetDeviceCertificateResponse
|
|
327
|
-
*/
|
|
328
|
-
getDeviceCertificate = (request) => this.client.fetch(
|
|
329
|
-
{
|
|
330
|
-
method: "GET",
|
|
331
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/certificate`
|
|
332
|
-
},
|
|
333
|
-
marshalling_gen.unmarshalGetDeviceCertificateResponse
|
|
334
|
-
);
|
|
335
|
-
/**
|
|
336
|
-
* Remove a device. Remove a specific device from the specific Hub it is attached to.
|
|
337
|
-
*
|
|
338
|
-
* @param request - The request {@link DeleteDeviceRequest}
|
|
339
|
-
*/
|
|
340
|
-
deleteDevice = (request) => this.client.fetch({
|
|
341
|
-
method: "DELETE",
|
|
342
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}`
|
|
343
|
-
});
|
|
344
|
-
/**
|
|
345
|
-
* Get a device's metrics. Get the metrics of an existing device, specified by its device ID.
|
|
346
|
-
*
|
|
347
|
-
* @deprecated
|
|
348
|
-
* @param request - The request {@link GetDeviceMetricsRequest}
|
|
349
|
-
* @returns A Promise of GetDeviceMetricsResponse
|
|
350
|
-
*/
|
|
351
|
-
getDeviceMetrics = (request) => this.client.fetch(
|
|
352
|
-
{
|
|
353
|
-
method: "GET",
|
|
354
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${sdkClient.validatePathParam("deviceId", request.deviceId)}/metrics`,
|
|
355
|
-
urlParams: sdkClient.urlParams(["start_date", request.startDate])
|
|
356
|
-
},
|
|
357
|
-
marshalling_gen.unmarshalGetDeviceMetricsResponse
|
|
358
|
-
);
|
|
359
|
-
pageOfListRoutes = (request = {}) => this.client.fetch(
|
|
360
|
-
{
|
|
361
|
-
method: "GET",
|
|
362
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`,
|
|
363
|
-
urlParams: sdkClient.urlParams(
|
|
364
|
-
["hub_id", request.hubId],
|
|
365
|
-
["name", request.name],
|
|
366
|
-
["order_by", request.orderBy],
|
|
367
|
-
["page", request.page],
|
|
368
|
-
[
|
|
369
|
-
"page_size",
|
|
370
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
371
|
-
]
|
|
372
|
-
)
|
|
373
|
-
},
|
|
374
|
-
marshalling_gen.unmarshalListRoutesResponse
|
|
375
|
-
);
|
|
376
|
-
/**
|
|
377
|
-
* List routes. List all routes in the specified region. By default, returned routes are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
378
|
-
*
|
|
379
|
-
* @param request - The request {@link ListRoutesRequest}
|
|
380
|
-
* @returns A Promise of ListRoutesResponse
|
|
381
|
-
*/
|
|
382
|
-
listRoutes = (request = {}) => sdkClient.enrichForPagination("routes", this.pageOfListRoutes, request);
|
|
383
|
-
/**
|
|
384
|
-
* Create a route. Multiple kinds of routes can be created, such as:
|
|
385
|
-
- Database Route
|
|
386
|
-
Create a route that will record subscribed MQTT messages into your database.
|
|
387
|
-
<b>You need to manage the database by yourself</b>.
|
|
388
|
-
- REST Route.
|
|
389
|
-
Create a route that will call a REST API on received subscribed MQTT messages.
|
|
390
|
-
- Amazon S3 Routes.
|
|
391
|
-
Create a route that will put subscribed MQTT messages into an Object Storage bucket.
|
|
392
|
-
You need to create the bucket yourself and grant write access.
|
|
393
|
-
Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).
|
|
394
|
-
*
|
|
395
|
-
* @param request - The request {@link CreateRouteRequest}
|
|
396
|
-
* @returns A Promise of Route
|
|
397
|
-
*/
|
|
398
|
-
createRoute = (request) => this.client.fetch(
|
|
399
|
-
{
|
|
400
|
-
body: JSON.stringify(
|
|
401
|
-
marshalling_gen.marshalCreateRouteRequest(request, this.client.settings)
|
|
402
|
-
),
|
|
403
|
-
headers: jsonContentHeaders,
|
|
404
|
-
method: "POST",
|
|
405
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
|
|
406
|
-
},
|
|
407
|
-
marshalling_gen.unmarshalRoute
|
|
408
|
-
);
|
|
409
|
-
/**
|
|
410
|
-
* Update a route. Update the parameters of an existing route, specified by its route ID.
|
|
411
|
-
*
|
|
412
|
-
* @param request - The request {@link UpdateRouteRequest}
|
|
413
|
-
* @returns A Promise of Route
|
|
414
|
-
*/
|
|
415
|
-
updateRoute = (request) => this.client.fetch(
|
|
416
|
-
{
|
|
417
|
-
body: JSON.stringify(
|
|
418
|
-
marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings)
|
|
419
|
-
),
|
|
420
|
-
headers: jsonContentHeaders,
|
|
421
|
-
method: "PATCH",
|
|
422
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
|
|
423
|
-
},
|
|
424
|
-
marshalling_gen.unmarshalRoute
|
|
425
|
-
);
|
|
426
|
-
/**
|
|
427
|
-
* Get a route. Get information for a particular route, specified by the route ID. The response returns full details of the route, including its type, the topic it subscribes to and its configuration.
|
|
428
|
-
*
|
|
429
|
-
* @param request - The request {@link GetRouteRequest}
|
|
430
|
-
* @returns A Promise of Route
|
|
431
|
-
*/
|
|
432
|
-
getRoute = (request) => this.client.fetch(
|
|
433
|
-
{
|
|
434
|
-
method: "GET",
|
|
435
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
|
|
436
|
-
},
|
|
437
|
-
marshalling_gen.unmarshalRoute
|
|
438
|
-
);
|
|
439
|
-
/**
|
|
440
|
-
* Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone.
|
|
441
|
-
*
|
|
442
|
-
* @param request - The request {@link DeleteRouteRequest}
|
|
443
|
-
*/
|
|
444
|
-
deleteRoute = (request) => this.client.fetch({
|
|
445
|
-
method: "DELETE",
|
|
446
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${sdkClient.validatePathParam("routeId", request.routeId)}`
|
|
447
|
-
});
|
|
448
|
-
pageOfListNetworks = (request = {}) => this.client.fetch(
|
|
449
|
-
{
|
|
450
|
-
method: "GET",
|
|
451
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks`,
|
|
452
|
-
urlParams: sdkClient.urlParams(
|
|
453
|
-
["hub_id", request.hubId],
|
|
454
|
-
["name", request.name],
|
|
455
|
-
["order_by", request.orderBy],
|
|
456
|
-
["page", request.page],
|
|
457
|
-
[
|
|
458
|
-
"page_size",
|
|
459
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
460
|
-
],
|
|
461
|
-
["topic_prefix", request.topicPrefix]
|
|
462
|
-
)
|
|
463
|
-
},
|
|
464
|
-
marshalling_gen.unmarshalListNetworksResponse
|
|
465
|
-
);
|
|
466
|
-
/**
|
|
467
|
-
* List the networks.
|
|
468
|
-
*
|
|
469
|
-
* @param request - The request {@link ListNetworksRequest}
|
|
470
|
-
* @returns A Promise of ListNetworksResponse
|
|
471
|
-
*/
|
|
472
|
-
listNetworks = (request = {}) => sdkClient.enrichForPagination("networks", this.pageOfListNetworks, request);
|
|
473
|
-
/**
|
|
474
|
-
* Create a new network. Create a new network for an existing hub. Beside the default network, you can add networks for different data providers. Possible network types are Sigfox and REST.
|
|
475
|
-
*
|
|
476
|
-
* @param request - The request {@link CreateNetworkRequest}
|
|
477
|
-
* @returns A Promise of CreateNetworkResponse
|
|
478
|
-
*/
|
|
479
|
-
createNetwork = (request) => this.client.fetch(
|
|
480
|
-
{
|
|
481
|
-
body: JSON.stringify(
|
|
482
|
-
marshalling_gen.marshalCreateNetworkRequest(request, this.client.settings)
|
|
483
|
-
),
|
|
484
|
-
headers: jsonContentHeaders,
|
|
485
|
-
method: "POST",
|
|
486
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks`
|
|
487
|
-
},
|
|
488
|
-
marshalling_gen.unmarshalCreateNetworkResponse
|
|
489
|
-
);
|
|
490
|
-
/**
|
|
491
|
-
* Retrieve a specific network. Retrieve an existing network, specified by its network ID. The response returns full details of the network, including its type, the topic prefix and its endpoint.
|
|
492
|
-
*
|
|
493
|
-
* @param request - The request {@link GetNetworkRequest}
|
|
494
|
-
* @returns A Promise of Network
|
|
495
|
-
*/
|
|
496
|
-
getNetwork = (request) => this.client.fetch(
|
|
497
|
-
{
|
|
498
|
-
method: "GET",
|
|
499
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${sdkClient.validatePathParam("networkId", request.networkId)}`
|
|
500
|
-
},
|
|
501
|
-
marshalling_gen.unmarshalNetwork
|
|
502
|
-
);
|
|
503
|
-
/**
|
|
504
|
-
* Delete a Network. Delete an existing network, specified by its network ID. Deleting a network is permanent, and cannot be undone.
|
|
505
|
-
*
|
|
506
|
-
* @param request - The request {@link DeleteNetworkRequest}
|
|
507
|
-
*/
|
|
508
|
-
deleteNetwork = (request) => this.client.fetch({
|
|
509
|
-
method: "DELETE",
|
|
510
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${sdkClient.validatePathParam("networkId", request.networkId)}`
|
|
511
|
-
});
|
|
512
|
-
/**
|
|
513
|
-
* BETA - Get a Cloud Twin Document.
|
|
514
|
-
*
|
|
515
|
-
* @param request - The request {@link GetTwinDocumentRequest}
|
|
516
|
-
* @returns A Promise of TwinDocument
|
|
517
|
-
*/
|
|
518
|
-
getTwinDocument = (request) => this.client.fetch(
|
|
519
|
-
{
|
|
520
|
-
method: "GET",
|
|
521
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}/documents/${sdkClient.validatePathParam("documentName", request.documentName)}`
|
|
522
|
-
},
|
|
523
|
-
marshalling_gen.unmarshalTwinDocument
|
|
524
|
-
);
|
|
525
|
-
/**
|
|
526
|
-
* BETA - Update a Cloud Twin Document.
|
|
527
|
-
*
|
|
528
|
-
* @param request - The request {@link PutTwinDocumentRequest}
|
|
529
|
-
* @returns A Promise of TwinDocument
|
|
530
|
-
*/
|
|
531
|
-
putTwinDocument = (request) => this.client.fetch(
|
|
532
|
-
{
|
|
533
|
-
body: JSON.stringify(
|
|
534
|
-
marshalling_gen.marshalPutTwinDocumentRequest(request, this.client.settings)
|
|
535
|
-
),
|
|
536
|
-
headers: jsonContentHeaders,
|
|
537
|
-
method: "PUT",
|
|
538
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}/documents/${sdkClient.validatePathParam("documentName", request.documentName)}`
|
|
539
|
-
},
|
|
540
|
-
marshalling_gen.unmarshalTwinDocument
|
|
541
|
-
);
|
|
542
|
-
/**
|
|
543
|
-
* BETA - Patch a Cloud Twin Document.
|
|
544
|
-
*
|
|
545
|
-
* @param request - The request {@link PatchTwinDocumentRequest}
|
|
546
|
-
* @returns A Promise of TwinDocument
|
|
547
|
-
*/
|
|
548
|
-
patchTwinDocument = (request) => this.client.fetch(
|
|
549
|
-
{
|
|
550
|
-
body: JSON.stringify(
|
|
551
|
-
marshalling_gen.marshalPatchTwinDocumentRequest(request, this.client.settings)
|
|
552
|
-
),
|
|
553
|
-
headers: jsonContentHeaders,
|
|
554
|
-
method: "PATCH",
|
|
555
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}/documents/${sdkClient.validatePathParam("documentName", request.documentName)}`
|
|
556
|
-
},
|
|
557
|
-
marshalling_gen.unmarshalTwinDocument
|
|
558
|
-
);
|
|
559
|
-
/**
|
|
560
|
-
* BETA - Delete a Cloud Twin Document.
|
|
561
|
-
*
|
|
562
|
-
* @param request - The request {@link DeleteTwinDocumentRequest}
|
|
563
|
-
*/
|
|
564
|
-
deleteTwinDocument = (request) => this.client.fetch({
|
|
565
|
-
method: "DELETE",
|
|
566
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}/documents/${sdkClient.validatePathParam("documentName", request.documentName)}`
|
|
567
|
-
});
|
|
568
|
-
/**
|
|
569
|
-
* BETA - List the documents of a Cloud Twin.
|
|
570
|
-
*
|
|
571
|
-
* @param request - The request {@link ListTwinDocumentsRequest}
|
|
572
|
-
* @returns A Promise of ListTwinDocumentsResponse
|
|
573
|
-
*/
|
|
574
|
-
listTwinDocuments = (request) => this.client.fetch(
|
|
575
|
-
{
|
|
576
|
-
method: "GET",
|
|
577
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}`
|
|
578
|
-
},
|
|
579
|
-
marshalling_gen.unmarshalListTwinDocumentsResponse
|
|
580
|
-
);
|
|
581
|
-
/**
|
|
582
|
-
* BETA - Delete all the documents of a Cloud Twin.
|
|
583
|
-
*
|
|
584
|
-
* @param request - The request {@link DeleteTwinDocumentsRequest}
|
|
585
|
-
*/
|
|
586
|
-
deleteTwinDocuments = (request) => this.client.fetch({
|
|
587
|
-
method: "DELETE",
|
|
588
|
-
path: `/iot/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${sdkClient.validatePathParam("twinId", request.twinId)}`
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
exports.API = API;
|
package/dist/v1/content.gen.cjs
DELETED
package/dist/v1/index.gen.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const api_gen = require("./api.gen.cjs");
|
|
4
|
-
const content_gen = require("./content.gen.cjs");
|
|
5
|
-
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
|
-
exports.API = api_gen.API;
|
|
7
|
-
exports.HUB_TRANSIENT_STATUSES = content_gen.HUB_TRANSIENT_STATUSES;
|
|
8
|
-
exports.marshalCreateDeviceRequest = marshalling_gen.marshalCreateDeviceRequest;
|
|
9
|
-
exports.marshalCreateHubRequest = marshalling_gen.marshalCreateHubRequest;
|
|
10
|
-
exports.marshalCreateNetworkRequest = marshalling_gen.marshalCreateNetworkRequest;
|
|
11
|
-
exports.marshalCreateRouteRequest = marshalling_gen.marshalCreateRouteRequest;
|
|
12
|
-
exports.marshalPatchTwinDocumentRequest = marshalling_gen.marshalPatchTwinDocumentRequest;
|
|
13
|
-
exports.marshalPutTwinDocumentRequest = marshalling_gen.marshalPutTwinDocumentRequest;
|
|
14
|
-
exports.marshalSetDeviceCertificateRequest = marshalling_gen.marshalSetDeviceCertificateRequest;
|
|
15
|
-
exports.marshalSetHubCARequest = marshalling_gen.marshalSetHubCARequest;
|
|
16
|
-
exports.marshalUpdateDeviceRequest = marshalling_gen.marshalUpdateDeviceRequest;
|
|
17
|
-
exports.marshalUpdateHubRequest = marshalling_gen.marshalUpdateHubRequest;
|
|
18
|
-
exports.marshalUpdateRouteRequest = marshalling_gen.marshalUpdateRouteRequest;
|
|
19
|
-
exports.unmarshalCreateDeviceResponse = marshalling_gen.unmarshalCreateDeviceResponse;
|
|
20
|
-
exports.unmarshalCreateNetworkResponse = marshalling_gen.unmarshalCreateNetworkResponse;
|
|
21
|
-
exports.unmarshalDevice = marshalling_gen.unmarshalDevice;
|
|
22
|
-
exports.unmarshalGetDeviceCertificateResponse = marshalling_gen.unmarshalGetDeviceCertificateResponse;
|
|
23
|
-
exports.unmarshalGetDeviceMetricsResponse = marshalling_gen.unmarshalGetDeviceMetricsResponse;
|
|
24
|
-
exports.unmarshalGetHubCAResponse = marshalling_gen.unmarshalGetHubCAResponse;
|
|
25
|
-
exports.unmarshalGetHubMetricsResponse = marshalling_gen.unmarshalGetHubMetricsResponse;
|
|
26
|
-
exports.unmarshalHub = marshalling_gen.unmarshalHub;
|
|
27
|
-
exports.unmarshalListDevicesResponse = marshalling_gen.unmarshalListDevicesResponse;
|
|
28
|
-
exports.unmarshalListHubsResponse = marshalling_gen.unmarshalListHubsResponse;
|
|
29
|
-
exports.unmarshalListNetworksResponse = marshalling_gen.unmarshalListNetworksResponse;
|
|
30
|
-
exports.unmarshalListRoutesResponse = marshalling_gen.unmarshalListRoutesResponse;
|
|
31
|
-
exports.unmarshalListTwinDocumentsResponse = marshalling_gen.unmarshalListTwinDocumentsResponse;
|
|
32
|
-
exports.unmarshalNetwork = marshalling_gen.unmarshalNetwork;
|
|
33
|
-
exports.unmarshalRenewDeviceCertificateResponse = marshalling_gen.unmarshalRenewDeviceCertificateResponse;
|
|
34
|
-
exports.unmarshalRoute = marshalling_gen.unmarshalRoute;
|
|
35
|
-
exports.unmarshalSetDeviceCertificateResponse = marshalling_gen.unmarshalSetDeviceCertificateResponse;
|
|
36
|
-
exports.unmarshalTwinDocument = marshalling_gen.unmarshalTwinDocument;
|