@scaleway/sdk-iot 2.7.0 → 2.9.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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as Iotv1 from './v1/index.gen.js';
@@ -0,0 +1,2 @@
1
+ import { index_gen_exports } from "./v1/index.gen.js";
2
+ export { index_gen_exports as Iotv1 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-iot";
7
+ readonly namespace: "iot";
8
+ readonly displayName: "Iot";
9
+ readonly versions: readonly ["v1"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-iot",
8
+ namespace: "iot",
9
+ displayName: "Iot",
10
+ versions: ["v1"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,296 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
3
+ import type { CreateDeviceRequest, CreateDeviceResponse, CreateHubRequest, CreateNetworkRequest, CreateNetworkResponse, CreateRouteRequest, DeleteDeviceRequest, DeleteHubRequest, DeleteNetworkRequest, DeleteRouteRequest, DeleteTwinDocumentRequest, DeleteTwinDocumentsRequest, Device, DisableDeviceRequest, DisableHubRequest, EnableDeviceRequest, EnableHubRequest, GetDeviceCertificateRequest, GetDeviceCertificateResponse, GetDeviceMetricsRequest, GetDeviceMetricsResponse, GetDeviceRequest, GetHubCARequest, GetHubCAResponse, GetHubMetricsRequest, GetHubMetricsResponse, GetHubRequest, GetNetworkRequest, GetRouteRequest, GetTwinDocumentRequest, Hub, ListDevicesRequest, ListDevicesResponse, ListHubsRequest, ListHubsResponse, ListNetworksRequest, ListNetworksResponse, ListRoutesRequest, ListRoutesResponse, ListTwinDocumentsRequest, ListTwinDocumentsResponse, Network, PatchTwinDocumentRequest, PutTwinDocumentRequest, RenewDeviceCertificateRequest, RenewDeviceCertificateResponse, Route, SetDeviceCertificateRequest, SetDeviceCertificateResponse, SetHubCARequest, TwinDocument, UpdateDeviceRequest, UpdateHubRequest, UpdateRouteRequest } from './types.gen.js';
4
+ /**
5
+ * IoT Hub API.
6
+
7
+ This API allows you to manage your IoT hubs and devices.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ protected pageOfListHubs: (request?: Readonly<ListHubsRequest>) => Promise<ListHubsResponse>;
16
+ /**
17
+ * 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.
18
+ *
19
+ * @param request - The request {@link ListHubsRequest}
20
+ * @returns A Promise of ListHubsResponse
21
+ */
22
+ listHubs: (request?: Readonly<ListHubsRequest>) => Promise<ListHubsResponse> & {
23
+ all: () => Promise<Hub[]>;
24
+ [Symbol.asyncIterator]: () => AsyncGenerator<Hub[], void, void>;
25
+ };
26
+ /**
27
+ * Create a hub. Create a new Hub in the targeted region, specifying its configuration including name and product plan.
28
+ *
29
+ * @param request - The request {@link CreateHubRequest}
30
+ * @returns A Promise of Hub
31
+ */
32
+ createHub: (request: Readonly<CreateHubRequest>) => Promise<Hub>;
33
+ /**
34
+ * 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.
35
+ *
36
+ * @param request - The request {@link GetHubRequest}
37
+ * @returns A Promise of Hub
38
+ */
39
+ getHub: (request: Readonly<GetHubRequest>) => Promise<Hub>;
40
+ /**
41
+ * Waits for {@link Hub} to be in a final state.
42
+ *
43
+ * @param request - The request {@link GetHubRequest}
44
+ * @param options - The waiting options
45
+ * @returns A Promise of Hub
46
+ */
47
+ waitForHub: (request: Readonly<GetHubRequest>, options?: Readonly<WaitForOptions<Hub>>) => Promise<Hub>;
48
+ /**
49
+ * Update a hub. Update the parameters of an existing IoT Hub, specified by its Hub ID.
50
+ *
51
+ * @param request - The request {@link UpdateHubRequest}
52
+ * @returns A Promise of Hub
53
+ */
54
+ updateHub: (request: Readonly<UpdateHubRequest>) => Promise<Hub>;
55
+ /**
56
+ * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID.
57
+ *
58
+ * @param request - The request {@link EnableHubRequest}
59
+ * @returns A Promise of Hub
60
+ */
61
+ enableHub: (request: Readonly<EnableHubRequest>) => Promise<Hub>;
62
+ /**
63
+ * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID.
64
+ *
65
+ * @param request - The request {@link DisableHubRequest}
66
+ * @returns A Promise of Hub
67
+ */
68
+ disableHub: (request: Readonly<DisableHubRequest>) => Promise<Hub>;
69
+ /**
70
+ * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting a Hub is permanent, and cannot be undone.
71
+ *
72
+ * @param request - The request {@link DeleteHubRequest}
73
+ */
74
+ deleteHub: (request: Readonly<DeleteHubRequest>) => Promise<void>;
75
+ /**
76
+ * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by its Hub ID.
77
+ *
78
+ * @deprecated
79
+ * @param request - The request {@link GetHubMetricsRequest}
80
+ * @returns A Promise of GetHubMetricsResponse
81
+ */
82
+ getHubMetrics: (request: Readonly<GetHubMetricsRequest>) => Promise<GetHubMetricsResponse>;
83
+ /**
84
+ * Set the certificate authority of a hub. Set a particular PEM-encoded certificate, specified by the Hub ID.
85
+ *
86
+ * @param request - The request {@link SetHubCARequest}
87
+ * @returns A Promise of Hub
88
+ */
89
+ setHubCA: (request: Readonly<SetHubCARequest>) => Promise<Hub>;
90
+ /**
91
+ * Get the certificate authority of a hub. Get information for a particular PEM-encoded certificate, specified by the Hub ID.
92
+ *
93
+ * @param request - The request {@link GetHubCARequest}
94
+ * @returns A Promise of GetHubCAResponse
95
+ */
96
+ getHubCA: (request: Readonly<GetHubCARequest>) => Promise<GetHubCAResponse>;
97
+ protected pageOfListDevices: (request?: Readonly<ListDevicesRequest>) => Promise<ListDevicesResponse>;
98
+ /**
99
+ * 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.
100
+ *
101
+ * @param request - The request {@link ListDevicesRequest}
102
+ * @returns A Promise of ListDevicesResponse
103
+ */
104
+ listDevices: (request?: Readonly<ListDevicesRequest>) => Promise<ListDevicesResponse> & {
105
+ all: () => Promise<Device[]>;
106
+ [Symbol.asyncIterator]: () => AsyncGenerator<Device[], void, void>;
107
+ };
108
+ /**
109
+ * Add a device. Attach a device to a given Hub.
110
+ *
111
+ * @param request - The request {@link CreateDeviceRequest}
112
+ * @returns A Promise of CreateDeviceResponse
113
+ */
114
+ createDevice: (request: Readonly<CreateDeviceRequest>) => Promise<CreateDeviceResponse>;
115
+ /**
116
+ * 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.
117
+ *
118
+ * @param request - The request {@link GetDeviceRequest}
119
+ * @returns A Promise of Device
120
+ */
121
+ getDevice: (request: Readonly<GetDeviceRequest>) => Promise<Device>;
122
+ /**
123
+ * Update a device. Update the parameters of an existing device, specified by its device ID.
124
+ *
125
+ * @param request - The request {@link UpdateDeviceRequest}
126
+ * @returns A Promise of Device
127
+ */
128
+ updateDevice: (request: Readonly<UpdateDeviceRequest>) => Promise<Device>;
129
+ /**
130
+ * Enable a device. Enable a specific device, specified by its device ID.
131
+ *
132
+ * @param request - The request {@link EnableDeviceRequest}
133
+ * @returns A Promise of Device
134
+ */
135
+ enableDevice: (request: Readonly<EnableDeviceRequest>) => Promise<Device>;
136
+ /**
137
+ * Disable a device. Disable an existing device, specified by its device ID.
138
+ *
139
+ * @param request - The request {@link DisableDeviceRequest}
140
+ * @returns A Promise of Device
141
+ */
142
+ disableDevice: (request: Readonly<DisableDeviceRequest>) => Promise<Device>;
143
+ /**
144
+ * Renew a device certificate. Renew the certificate of an existing device, specified by its device ID.
145
+ *
146
+ * @param request - The request {@link RenewDeviceCertificateRequest}
147
+ * @returns A Promise of RenewDeviceCertificateResponse
148
+ */
149
+ renewDeviceCertificate: (request: Readonly<RenewDeviceCertificateRequest>) => Promise<RenewDeviceCertificateResponse>;
150
+ /**
151
+ * Set a custom certificate on a device. Switch the existing certificate of a given device with an EM-encoded custom certificate.
152
+ *
153
+ * @param request - The request {@link SetDeviceCertificateRequest}
154
+ * @returns A Promise of SetDeviceCertificateResponse
155
+ */
156
+ setDeviceCertificate: (request: Readonly<SetDeviceCertificateRequest>) => Promise<SetDeviceCertificateResponse>;
157
+ /**
158
+ * 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.
159
+ *
160
+ * @param request - The request {@link GetDeviceCertificateRequest}
161
+ * @returns A Promise of GetDeviceCertificateResponse
162
+ */
163
+ getDeviceCertificate: (request: Readonly<GetDeviceCertificateRequest>) => Promise<GetDeviceCertificateResponse>;
164
+ /**
165
+ * Remove a device. Remove a specific device from the specific Hub it is attached to.
166
+ *
167
+ * @param request - The request {@link DeleteDeviceRequest}
168
+ */
169
+ deleteDevice: (request: Readonly<DeleteDeviceRequest>) => Promise<void>;
170
+ /**
171
+ * Get a device's metrics. Get the metrics of an existing device, specified by its device ID.
172
+ *
173
+ * @deprecated
174
+ * @param request - The request {@link GetDeviceMetricsRequest}
175
+ * @returns A Promise of GetDeviceMetricsResponse
176
+ */
177
+ getDeviceMetrics: (request: Readonly<GetDeviceMetricsRequest>) => Promise<GetDeviceMetricsResponse>;
178
+ protected pageOfListRoutes: (request?: Readonly<ListRoutesRequest>) => Promise<ListRoutesResponse>;
179
+ /**
180
+ * 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.
181
+ *
182
+ * @param request - The request {@link ListRoutesRequest}
183
+ * @returns A Promise of ListRoutesResponse
184
+ */
185
+ listRoutes: (request?: Readonly<ListRoutesRequest>) => Promise<ListRoutesResponse> & {
186
+ all: () => Promise<import("./types.gen.js").RouteSummary[]>;
187
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").RouteSummary[], void, void>;
188
+ };
189
+ /**
190
+ * Create a route. Multiple kinds of routes can be created, such as:
191
+ - Database Route
192
+ Create a route that will record subscribed MQTT messages into your database.
193
+ <b>You need to manage the database by yourself</b>.
194
+ - REST Route.
195
+ Create a route that will call a REST API on received subscribed MQTT messages.
196
+ - Amazon S3 Routes.
197
+ Create a route that will put subscribed MQTT messages into an Object Storage bucket.
198
+ You need to create the bucket yourself and grant write access.
199
+ Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).
200
+ *
201
+ * @param request - The request {@link CreateRouteRequest}
202
+ * @returns A Promise of Route
203
+ */
204
+ createRoute: (request: Readonly<CreateRouteRequest>) => Promise<Route>;
205
+ /**
206
+ * Update a route. Update the parameters of an existing route, specified by its route ID.
207
+ *
208
+ * @param request - The request {@link UpdateRouteRequest}
209
+ * @returns A Promise of Route
210
+ */
211
+ updateRoute: (request: Readonly<UpdateRouteRequest>) => Promise<Route>;
212
+ /**
213
+ * 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.
214
+ *
215
+ * @param request - The request {@link GetRouteRequest}
216
+ * @returns A Promise of Route
217
+ */
218
+ getRoute: (request: Readonly<GetRouteRequest>) => Promise<Route>;
219
+ /**
220
+ * Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone.
221
+ *
222
+ * @param request - The request {@link DeleteRouteRequest}
223
+ */
224
+ deleteRoute: (request: Readonly<DeleteRouteRequest>) => Promise<void>;
225
+ protected pageOfListNetworks: (request?: Readonly<ListNetworksRequest>) => Promise<ListNetworksResponse>;
226
+ /**
227
+ * List the networks.
228
+ *
229
+ * @param request - The request {@link ListNetworksRequest}
230
+ * @returns A Promise of ListNetworksResponse
231
+ */
232
+ listNetworks: (request?: Readonly<ListNetworksRequest>) => Promise<ListNetworksResponse> & {
233
+ all: () => Promise<Network[]>;
234
+ [Symbol.asyncIterator]: () => AsyncGenerator<Network[], void, void>;
235
+ };
236
+ /**
237
+ * 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.
238
+ *
239
+ * @param request - The request {@link CreateNetworkRequest}
240
+ * @returns A Promise of CreateNetworkResponse
241
+ */
242
+ createNetwork: (request: Readonly<CreateNetworkRequest>) => Promise<CreateNetworkResponse>;
243
+ /**
244
+ * 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.
245
+ *
246
+ * @param request - The request {@link GetNetworkRequest}
247
+ * @returns A Promise of Network
248
+ */
249
+ getNetwork: (request: Readonly<GetNetworkRequest>) => Promise<Network>;
250
+ /**
251
+ * Delete a Network. Delete an existing network, specified by its network ID. Deleting a network is permanent, and cannot be undone.
252
+ *
253
+ * @param request - The request {@link DeleteNetworkRequest}
254
+ */
255
+ deleteNetwork: (request: Readonly<DeleteNetworkRequest>) => Promise<void>;
256
+ /**
257
+ * BETA - Get a Cloud Twin Document.
258
+ *
259
+ * @param request - The request {@link GetTwinDocumentRequest}
260
+ * @returns A Promise of TwinDocument
261
+ */
262
+ getTwinDocument: (request: Readonly<GetTwinDocumentRequest>) => Promise<TwinDocument>;
263
+ /**
264
+ * BETA - Update a Cloud Twin Document.
265
+ *
266
+ * @param request - The request {@link PutTwinDocumentRequest}
267
+ * @returns A Promise of TwinDocument
268
+ */
269
+ putTwinDocument: (request: Readonly<PutTwinDocumentRequest>) => Promise<TwinDocument>;
270
+ /**
271
+ * BETA - Patch a Cloud Twin Document.
272
+ *
273
+ * @param request - The request {@link PatchTwinDocumentRequest}
274
+ * @returns A Promise of TwinDocument
275
+ */
276
+ patchTwinDocument: (request: Readonly<PatchTwinDocumentRequest>) => Promise<TwinDocument>;
277
+ /**
278
+ * BETA - Delete a Cloud Twin Document.
279
+ *
280
+ * @param request - The request {@link DeleteTwinDocumentRequest}
281
+ */
282
+ deleteTwinDocument: (request: Readonly<DeleteTwinDocumentRequest>) => Promise<void>;
283
+ /**
284
+ * BETA - List the documents of a Cloud Twin.
285
+ *
286
+ * @param request - The request {@link ListTwinDocumentsRequest}
287
+ * @returns A Promise of ListTwinDocumentsResponse
288
+ */
289
+ listTwinDocuments: (request: Readonly<ListTwinDocumentsRequest>) => Promise<ListTwinDocumentsResponse>;
290
+ /**
291
+ * BETA - Delete all the documents of a Cloud Twin.
292
+ *
293
+ * @param request - The request {@link DeleteTwinDocumentsRequest}
294
+ */
295
+ deleteTwinDocuments: (request: Readonly<DeleteTwinDocumentsRequest>) => Promise<void>;
296
+ }
@@ -0,0 +1,208 @@
1
+ import { HUB_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateDeviceRequest, marshalCreateHubRequest, marshalCreateNetworkRequest, marshalCreateRouteRequest, marshalPatchTwinDocumentRequest, marshalPutTwinDocumentRequest, marshalSetDeviceCertificateRequest, marshalSetHubCARequest, marshalUpdateDeviceRequest, marshalUpdateHubRequest, marshalUpdateRouteRequest, unmarshalCreateDeviceResponse, unmarshalCreateNetworkResponse, unmarshalDevice, unmarshalGetDeviceCertificateResponse, unmarshalGetDeviceMetricsResponse, unmarshalGetHubCAResponse, unmarshalGetHubMetricsResponse, unmarshalHub, unmarshalListDevicesResponse, unmarshalListHubsResponse, unmarshalListNetworksResponse, unmarshalListRoutesResponse, unmarshalListTwinDocumentsResponse, unmarshalNetwork, unmarshalRenewDeviceCertificateResponse, unmarshalRoute, unmarshalSetDeviceCertificateResponse, unmarshalTwinDocument } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1/api.gen.ts
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * IoT Hub API.
8
+
9
+ This API allows you to manage your IoT hubs and devices.
10
+ */
11
+ var API = class extends API$1 {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListHubs = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs`,
17
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
18
+ }, unmarshalListHubsResponse);
19
+ this.listHubs = (request = {}) => enrichForPagination("hubs", this.pageOfListHubs, request);
20
+ this.createHub = (request) => this.client.fetch({
21
+ body: JSON.stringify(marshalCreateHubRequest(request, this.client.settings)),
22
+ headers: jsonContentHeaders,
23
+ method: "POST",
24
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs`
25
+ }, unmarshalHub);
26
+ this.getHub = (request) => this.client.fetch({
27
+ method: "GET",
28
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}`
29
+ }, unmarshalHub);
30
+ this.waitForHub = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!HUB_TRANSIENT_STATUSES.includes(res.status))), this.getHub, request, options);
31
+ this.updateHub = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalUpdateHubRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "PATCH",
35
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}`
36
+ }, unmarshalHub);
37
+ this.enableHub = (request) => this.client.fetch({
38
+ body: "{}",
39
+ headers: jsonContentHeaders,
40
+ method: "POST",
41
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}/enable`
42
+ }, unmarshalHub);
43
+ this.disableHub = (request) => this.client.fetch({
44
+ body: "{}",
45
+ headers: jsonContentHeaders,
46
+ method: "POST",
47
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}/disable`
48
+ }, unmarshalHub);
49
+ this.deleteHub = (request) => this.client.fetch({
50
+ method: "DELETE",
51
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}`,
52
+ urlParams: urlParams(["delete_devices", request.deleteDevices])
53
+ });
54
+ this.getHubMetrics = (request) => this.client.fetch({
55
+ method: "GET",
56
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}/metrics`,
57
+ urlParams: urlParams(["start_date", request.startDate])
58
+ }, unmarshalGetHubMetricsResponse);
59
+ this.setHubCA = (request) => this.client.fetch({
60
+ body: JSON.stringify(marshalSetHubCARequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: "POST",
63
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}/ca`
64
+ }, unmarshalHub);
65
+ this.getHubCA = (request) => this.client.fetch({
66
+ method: "GET",
67
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam("hubId", request.hubId)}/ca`
68
+ }, unmarshalGetHubCAResponse);
69
+ this.pageOfListDevices = (request = {}) => this.client.fetch({
70
+ method: "GET",
71
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices`,
72
+ urlParams: urlParams(["allow_insecure", request.allowInsecure], ["hub_id", request.hubId], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["status", request.status])
73
+ }, unmarshalListDevicesResponse);
74
+ this.listDevices = (request = {}) => enrichForPagination("devices", this.pageOfListDevices, request);
75
+ this.createDevice = (request) => this.client.fetch({
76
+ body: JSON.stringify(marshalCreateDeviceRequest(request, this.client.settings)),
77
+ headers: jsonContentHeaders,
78
+ method: "POST",
79
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices`
80
+ }, unmarshalCreateDeviceResponse);
81
+ this.getDevice = (request) => this.client.fetch({
82
+ method: "GET",
83
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}`
84
+ }, unmarshalDevice);
85
+ this.updateDevice = (request) => this.client.fetch({
86
+ body: JSON.stringify(marshalUpdateDeviceRequest(request, this.client.settings)),
87
+ headers: jsonContentHeaders,
88
+ method: "PATCH",
89
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}`
90
+ }, unmarshalDevice);
91
+ this.enableDevice = (request) => this.client.fetch({
92
+ body: "{}",
93
+ headers: jsonContentHeaders,
94
+ method: "POST",
95
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/enable`
96
+ }, unmarshalDevice);
97
+ this.disableDevice = (request) => this.client.fetch({
98
+ body: "{}",
99
+ headers: jsonContentHeaders,
100
+ method: "POST",
101
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/disable`
102
+ }, unmarshalDevice);
103
+ this.renewDeviceCertificate = (request) => this.client.fetch({
104
+ body: "{}",
105
+ headers: jsonContentHeaders,
106
+ method: "POST",
107
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/renew-certificate`
108
+ }, unmarshalRenewDeviceCertificateResponse);
109
+ this.setDeviceCertificate = (request) => this.client.fetch({
110
+ body: JSON.stringify(marshalSetDeviceCertificateRequest(request, this.client.settings)),
111
+ headers: jsonContentHeaders,
112
+ method: "PUT",
113
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/certificate`
114
+ }, unmarshalSetDeviceCertificateResponse);
115
+ this.getDeviceCertificate = (request) => this.client.fetch({
116
+ method: "GET",
117
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/certificate`
118
+ }, unmarshalGetDeviceCertificateResponse);
119
+ this.deleteDevice = (request) => this.client.fetch({
120
+ method: "DELETE",
121
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}`
122
+ });
123
+ this.getDeviceMetrics = (request) => this.client.fetch({
124
+ method: "GET",
125
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam("deviceId", request.deviceId)}/metrics`,
126
+ urlParams: urlParams(["start_date", request.startDate])
127
+ }, unmarshalGetDeviceMetricsResponse);
128
+ this.pageOfListRoutes = (request = {}) => this.client.fetch({
129
+ method: "GET",
130
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`,
131
+ urlParams: urlParams(["hub_id", request.hubId], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
132
+ }, unmarshalListRoutesResponse);
133
+ this.listRoutes = (request = {}) => enrichForPagination("routes", this.pageOfListRoutes, request);
134
+ this.createRoute = (request) => this.client.fetch({
135
+ body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
136
+ headers: jsonContentHeaders,
137
+ method: "POST",
138
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
139
+ }, unmarshalRoute);
140
+ this.updateRoute = (request) => this.client.fetch({
141
+ body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
142
+ headers: jsonContentHeaders,
143
+ method: "PATCH",
144
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
145
+ }, unmarshalRoute);
146
+ this.getRoute = (request) => this.client.fetch({
147
+ method: "GET",
148
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
149
+ }, unmarshalRoute);
150
+ this.deleteRoute = (request) => this.client.fetch({
151
+ method: "DELETE",
152
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
153
+ });
154
+ this.pageOfListNetworks = (request = {}) => this.client.fetch({
155
+ method: "GET",
156
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks`,
157
+ urlParams: urlParams(["hub_id", request.hubId], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["topic_prefix", request.topicPrefix])
158
+ }, unmarshalListNetworksResponse);
159
+ this.listNetworks = (request = {}) => enrichForPagination("networks", this.pageOfListNetworks, request);
160
+ this.createNetwork = (request) => this.client.fetch({
161
+ body: JSON.stringify(marshalCreateNetworkRequest(request, this.client.settings)),
162
+ headers: jsonContentHeaders,
163
+ method: "POST",
164
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks`
165
+ }, unmarshalCreateNetworkResponse);
166
+ this.getNetwork = (request) => this.client.fetch({
167
+ method: "GET",
168
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam("networkId", request.networkId)}`
169
+ }, unmarshalNetwork);
170
+ this.deleteNetwork = (request) => this.client.fetch({
171
+ method: "DELETE",
172
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam("networkId", request.networkId)}`
173
+ });
174
+ this.getTwinDocument = (request) => this.client.fetch({
175
+ method: "GET",
176
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}/documents/${validatePathParam("documentName", request.documentName)}`
177
+ }, unmarshalTwinDocument);
178
+ this.putTwinDocument = (request) => this.client.fetch({
179
+ body: JSON.stringify(marshalPutTwinDocumentRequest(request, this.client.settings)),
180
+ headers: jsonContentHeaders,
181
+ method: "PUT",
182
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}/documents/${validatePathParam("documentName", request.documentName)}`
183
+ }, unmarshalTwinDocument);
184
+ this.patchTwinDocument = (request) => this.client.fetch({
185
+ body: JSON.stringify(marshalPatchTwinDocumentRequest(request, this.client.settings)),
186
+ headers: jsonContentHeaders,
187
+ method: "PATCH",
188
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}/documents/${validatePathParam("documentName", request.documentName)}`
189
+ }, unmarshalTwinDocument);
190
+ this.deleteTwinDocument = (request) => this.client.fetch({
191
+ method: "DELETE",
192
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}/documents/${validatePathParam("documentName", request.documentName)}`
193
+ });
194
+ this.listTwinDocuments = (request) => this.client.fetch({
195
+ method: "GET",
196
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}`
197
+ }, unmarshalListTwinDocumentsResponse);
198
+ this.deleteTwinDocuments = (request) => this.client.fetch({
199
+ method: "DELETE",
200
+ path: `/iot/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam("twinId", request.twinId)}`
201
+ });
202
+ }
203
+ static {
204
+ this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
205
+ }
206
+ };
207
+ //#endregion
208
+ export { API };
@@ -0,0 +1,3 @@
1
+ import type { HubStatus } from './types.gen.js';
2
+ /** Lists transient statutes of the enum {@link HubStatus}. */
3
+ export declare const HUB_TRANSIENT_STATUSES: HubStatus[];
@@ -0,0 +1,5 @@
1
+ //#region src/v1/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link HubStatus}. */
3
+ const HUB_TRANSIENT_STATUSES = ["enabling", "disabling"];
4
+ //#endregion
5
+ export { HUB_TRANSIENT_STATUSES };
@@ -0,0 +1,4 @@
1
+ export { API, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { Certificate, CreateDeviceRequest, CreateDeviceResponse, CreateHubRequest, CreateNetworkRequest, CreateNetworkResponse, CreateRouteRequest, CreateRouteRequestDatabaseConfig, CreateRouteRequestRestConfig, CreateRouteRequestS3Config, DeleteDeviceRequest, DeleteHubRequest, DeleteNetworkRequest, DeleteRouteRequest, DeleteTwinDocumentRequest, DeleteTwinDocumentsRequest, Device, DeviceMessageFilters, DeviceMessageFiltersRule, DeviceMessageFiltersRulePolicy, DeviceStatus, DisableDeviceRequest, DisableHubRequest, EnableDeviceRequest, EnableHubRequest, GetDeviceCertificateRequest, GetDeviceCertificateResponse, GetDeviceMetricsRequest, GetDeviceMetricsResponse, GetDeviceRequest, GetHubCARequest, GetHubCAResponse, GetHubMetricsRequest, GetHubMetricsResponse, GetHubRequest, GetNetworkRequest, GetRouteRequest, GetTwinDocumentRequest, Hub, HubProductPlan, HubStatus, HubTwinsGraphiteConfig, ListDevicesRequest, ListDevicesRequestOrderBy, ListDevicesResponse, ListHubsRequest, ListHubsRequestOrderBy, ListHubsResponse, ListNetworksRequest, ListNetworksRequestOrderBy, ListNetworksResponse, ListRoutesRequest, ListRoutesRequestOrderBy, ListRoutesResponse, ListTwinDocumentsRequest, ListTwinDocumentsResponse, ListTwinDocumentsResponseDocumentSummary, Network, NetworkNetworkType, PatchTwinDocumentRequest, PutTwinDocumentRequest, RenewDeviceCertificateRequest, RenewDeviceCertificateResponse, Route, RouteDatabaseConfig, RouteDatabaseConfigEngine, RouteRestConfig, RouteRestConfigHttpVerb, RouteRouteType, RouteS3Config, RouteS3ConfigS3Strategy, RouteSummary, SetDeviceCertificateRequest, SetDeviceCertificateResponse, SetHubCARequest, TwinDocument, UpdateDeviceRequest, UpdateHubRequest, UpdateRouteRequest, UpdateRouteRequestDatabaseConfig, UpdateRouteRequestRestConfig, UpdateRouteRequestS3Config, } from './types.gen.js';
@@ -0,0 +1,40 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { HUB_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { marshalCreateDeviceRequest, marshalCreateHubRequest, marshalCreateNetworkRequest, marshalCreateRouteRequest, marshalPatchTwinDocumentRequest, marshalPutTwinDocumentRequest, marshalSetDeviceCertificateRequest, marshalSetHubCARequest, marshalUpdateDeviceRequest, marshalUpdateHubRequest, marshalUpdateRouteRequest, unmarshalCreateDeviceResponse, unmarshalCreateNetworkResponse, unmarshalDevice, unmarshalGetDeviceCertificateResponse, unmarshalGetDeviceMetricsResponse, unmarshalGetHubCAResponse, unmarshalGetHubMetricsResponse, unmarshalHub, unmarshalListDevicesResponse, unmarshalListHubsResponse, unmarshalListNetworksResponse, unmarshalListRoutesResponse, unmarshalListTwinDocumentsResponse, unmarshalNetwork, unmarshalRenewDeviceCertificateResponse, unmarshalRoute, unmarshalSetDeviceCertificateResponse, unmarshalTwinDocument } from "./marshalling.gen.js";
4
+ import { API } from "./api.gen.js";
5
+ //#region src/v1/index.gen.ts
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ HUB_TRANSIENT_STATUSES: () => HUB_TRANSIENT_STATUSES,
9
+ marshalCreateDeviceRequest: () => marshalCreateDeviceRequest,
10
+ marshalCreateHubRequest: () => marshalCreateHubRequest,
11
+ marshalCreateNetworkRequest: () => marshalCreateNetworkRequest,
12
+ marshalCreateRouteRequest: () => marshalCreateRouteRequest,
13
+ marshalPatchTwinDocumentRequest: () => marshalPatchTwinDocumentRequest,
14
+ marshalPutTwinDocumentRequest: () => marshalPutTwinDocumentRequest,
15
+ marshalSetDeviceCertificateRequest: () => marshalSetDeviceCertificateRequest,
16
+ marshalSetHubCARequest: () => marshalSetHubCARequest,
17
+ marshalUpdateDeviceRequest: () => marshalUpdateDeviceRequest,
18
+ marshalUpdateHubRequest: () => marshalUpdateHubRequest,
19
+ marshalUpdateRouteRequest: () => marshalUpdateRouteRequest,
20
+ unmarshalCreateDeviceResponse: () => unmarshalCreateDeviceResponse,
21
+ unmarshalCreateNetworkResponse: () => unmarshalCreateNetworkResponse,
22
+ unmarshalDevice: () => unmarshalDevice,
23
+ unmarshalGetDeviceCertificateResponse: () => unmarshalGetDeviceCertificateResponse,
24
+ unmarshalGetDeviceMetricsResponse: () => unmarshalGetDeviceMetricsResponse,
25
+ unmarshalGetHubCAResponse: () => unmarshalGetHubCAResponse,
26
+ unmarshalGetHubMetricsResponse: () => unmarshalGetHubMetricsResponse,
27
+ unmarshalHub: () => unmarshalHub,
28
+ unmarshalListDevicesResponse: () => unmarshalListDevicesResponse,
29
+ unmarshalListHubsResponse: () => unmarshalListHubsResponse,
30
+ unmarshalListNetworksResponse: () => unmarshalListNetworksResponse,
31
+ unmarshalListRoutesResponse: () => unmarshalListRoutesResponse,
32
+ unmarshalListTwinDocumentsResponse: () => unmarshalListTwinDocumentsResponse,
33
+ unmarshalNetwork: () => unmarshalNetwork,
34
+ unmarshalRenewDeviceCertificateResponse: () => unmarshalRenewDeviceCertificateResponse,
35
+ unmarshalRoute: () => unmarshalRoute,
36
+ unmarshalSetDeviceCertificateResponse: () => unmarshalSetDeviceCertificateResponse,
37
+ unmarshalTwinDocument: () => unmarshalTwinDocument
38
+ });
39
+ //#endregion
40
+ export { API, HUB_TRANSIENT_STATUSES, index_gen_exports, marshalCreateDeviceRequest, marshalCreateHubRequest, marshalCreateNetworkRequest, marshalCreateRouteRequest, marshalPatchTwinDocumentRequest, marshalPutTwinDocumentRequest, marshalSetDeviceCertificateRequest, marshalSetHubCARequest, marshalUpdateDeviceRequest, marshalUpdateHubRequest, marshalUpdateRouteRequest, unmarshalCreateDeviceResponse, unmarshalCreateNetworkResponse, unmarshalDevice, unmarshalGetDeviceCertificateResponse, unmarshalGetDeviceMetricsResponse, unmarshalGetHubCAResponse, unmarshalGetHubMetricsResponse, unmarshalHub, unmarshalListDevicesResponse, unmarshalListHubsResponse, unmarshalListNetworksResponse, unmarshalListRoutesResponse, unmarshalListTwinDocumentsResponse, unmarshalNetwork, unmarshalRenewDeviceCertificateResponse, unmarshalRoute, unmarshalSetDeviceCertificateResponse, unmarshalTwinDocument };