@scaleway/sdk 1.14.0 → 1.16.0

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