@azure/arm-iothub-profile-2020-09-01-hybrid 2.1.1-alpha.20250619.1 → 2.1.1-alpha.20250718.2

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 (75) hide show
  1. package/dist/browser/iotHubClient.js +18 -5
  2. package/dist/browser/iotHubClient.js.map +1 -1
  3. package/dist/browser/lroImpl.js +11 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +9 -4
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/certificates.js +1 -0
  8. package/dist/browser/operations/certificates.js.map +1 -1
  9. package/dist/browser/operations/iotHub.js +12 -6
  10. package/dist/browser/operations/iotHub.js.map +1 -1
  11. package/dist/browser/operations/iotHubResource.js +210 -331
  12. package/dist/browser/operations/iotHubResource.js.map +1 -1
  13. package/dist/browser/operations/operations.js +23 -40
  14. package/dist/browser/operations/operations.js.map +1 -1
  15. package/dist/browser/operations/resourceProviderCommon.js +1 -0
  16. package/dist/browser/operations/resourceProviderCommon.js.map +1 -1
  17. package/dist/browser/pagingHelper.js +2 -4
  18. package/dist/browser/pagingHelper.js.map +1 -1
  19. package/dist/commonjs/iotHubClient.js +18 -5
  20. package/dist/commonjs/iotHubClient.js.map +1 -1
  21. package/dist/commonjs/lroImpl.js +11 -3
  22. package/dist/commonjs/lroImpl.js.map +1 -1
  23. package/dist/commonjs/models/mappers.js +9 -4
  24. package/dist/commonjs/models/mappers.js.map +1 -1
  25. package/dist/commonjs/operations/certificates.js +1 -0
  26. package/dist/commonjs/operations/certificates.js.map +1 -1
  27. package/dist/commonjs/operations/iotHub.js +12 -6
  28. package/dist/commonjs/operations/iotHub.js.map +1 -1
  29. package/dist/commonjs/operations/iotHubResource.js +210 -330
  30. package/dist/commonjs/operations/iotHubResource.js.map +1 -1
  31. package/dist/commonjs/operations/operations.js +23 -39
  32. package/dist/commonjs/operations/operations.js.map +1 -1
  33. package/dist/commonjs/operations/resourceProviderCommon.js +1 -0
  34. package/dist/commonjs/operations/resourceProviderCommon.js.map +1 -1
  35. package/dist/commonjs/pagingHelper.js +2 -4
  36. package/dist/commonjs/pagingHelper.js.map +1 -1
  37. package/dist/commonjs/tsdoc-metadata.json +11 -11
  38. package/dist/esm/iotHubClient.js +18 -5
  39. package/dist/esm/iotHubClient.js.map +1 -1
  40. package/dist/esm/lroImpl.js +11 -3
  41. package/dist/esm/lroImpl.js.map +1 -1
  42. package/dist/esm/models/mappers.js +9 -4
  43. package/dist/esm/models/mappers.js.map +1 -1
  44. package/dist/esm/operations/certificates.js +1 -0
  45. package/dist/esm/operations/certificates.js.map +1 -1
  46. package/dist/esm/operations/iotHub.js +12 -6
  47. package/dist/esm/operations/iotHub.js.map +1 -1
  48. package/dist/esm/operations/iotHubResource.js +210 -331
  49. package/dist/esm/operations/iotHubResource.js.map +1 -1
  50. package/dist/esm/operations/operations.js +23 -40
  51. package/dist/esm/operations/operations.js.map +1 -1
  52. package/dist/esm/operations/resourceProviderCommon.js +1 -0
  53. package/dist/esm/operations/resourceProviderCommon.js.map +1 -1
  54. package/dist/esm/pagingHelper.js +2 -4
  55. package/dist/esm/pagingHelper.js.map +1 -1
  56. package/dist/react-native/iotHubClient.js +18 -5
  57. package/dist/react-native/iotHubClient.js.map +1 -1
  58. package/dist/react-native/lroImpl.js +11 -3
  59. package/dist/react-native/lroImpl.js.map +1 -1
  60. package/dist/react-native/models/mappers.js +9 -4
  61. package/dist/react-native/models/mappers.js.map +1 -1
  62. package/dist/react-native/operations/certificates.js +1 -0
  63. package/dist/react-native/operations/certificates.js.map +1 -1
  64. package/dist/react-native/operations/iotHub.js +12 -6
  65. package/dist/react-native/operations/iotHub.js.map +1 -1
  66. package/dist/react-native/operations/iotHubResource.js +210 -331
  67. package/dist/react-native/operations/iotHubResource.js.map +1 -1
  68. package/dist/react-native/operations/operations.js +23 -40
  69. package/dist/react-native/operations/operations.js.map +1 -1
  70. package/dist/react-native/operations/resourceProviderCommon.js +1 -0
  71. package/dist/react-native/operations/resourceProviderCommon.js.map +1 -1
  72. package/dist/react-native/pagingHelper.js +2 -4
  73. package/dist/react-native/pagingHelper.js.map +1 -1
  74. package/package.json +2 -2
  75. /package/review/{arm-iothub-profile-2020-09-01-hybrid.api.md → arm-iothub-profile-2020-09-01-hybrid-node.api.md} +0 -0
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { setContinuationToken } from "../pagingHelper.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -15,6 +14,7 @@ import { LroImpl } from "../lroImpl.js";
15
14
  /// <reference lib="esnext.asynciterable" />
16
15
  /** Class containing IotHubResource operations. */
17
16
  export class IotHubResourceImpl {
17
+ client;
18
18
  /**
19
19
  * Initialize a new instance of the class IotHubResource class.
20
20
  * @param client Reference to the service client
@@ -36,52 +36,35 @@ export class IotHubResourceImpl {
36
36
  return this;
37
37
  },
38
38
  byPage: (settings) => {
39
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
39
+ if (settings?.maxPageSize) {
40
40
  throw new Error("maxPageSize is not supported by this operation.");
41
41
  }
42
42
  return this.listBySubscriptionPagingPage(options, settings);
43
43
  }
44
44
  };
45
45
  }
46
- listBySubscriptionPagingPage(options, settings) {
47
- return __asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
48
- let result;
49
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
50
- if (!continuationToken) {
51
- result = yield __await(this._listBySubscription(options));
52
- let page = result.value || [];
53
- continuationToken = result.nextLink;
54
- setContinuationToken(page, continuationToken);
55
- yield yield __await(page);
56
- }
57
- while (continuationToken) {
58
- result = yield __await(this._listBySubscriptionNext(continuationToken, options));
59
- continuationToken = result.nextLink;
60
- let page = result.value || [];
61
- setContinuationToken(page, continuationToken);
62
- yield yield __await(page);
63
- }
64
- });
46
+ async *listBySubscriptionPagingPage(options, settings) {
47
+ let result;
48
+ let continuationToken = settings?.continuationToken;
49
+ if (!continuationToken) {
50
+ result = await this._listBySubscription(options);
51
+ let page = result.value || [];
52
+ continuationToken = result.nextLink;
53
+ setContinuationToken(page, continuationToken);
54
+ yield page;
55
+ }
56
+ while (continuationToken) {
57
+ result = await this._listBySubscriptionNext(continuationToken, options);
58
+ continuationToken = result.nextLink;
59
+ let page = result.value || [];
60
+ setContinuationToken(page, continuationToken);
61
+ yield page;
62
+ }
65
63
  }
66
- listBySubscriptionPagingAll(options) {
67
- return __asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
68
- var _a, e_1, _b, _c;
69
- try {
70
- for (var _d = true, _e = __asyncValues(this.listBySubscriptionPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
71
- _c = _f.value;
72
- _d = false;
73
- const page = _c;
74
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
75
- }
76
- }
77
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
78
- finally {
79
- try {
80
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
81
- }
82
- finally { if (e_1) throw e_1.error; }
83
- }
84
- });
64
+ async *listBySubscriptionPagingAll(options) {
65
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
66
+ yield* page;
67
+ }
85
68
  }
86
69
  /**
87
70
  * Get all the IoT hubs in a resource group.
@@ -98,52 +81,35 @@ export class IotHubResourceImpl {
98
81
  return this;
99
82
  },
100
83
  byPage: (settings) => {
101
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
84
+ if (settings?.maxPageSize) {
102
85
  throw new Error("maxPageSize is not supported by this operation.");
103
86
  }
104
87
  return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
105
88
  }
106
89
  };
107
90
  }
108
- listByResourceGroupPagingPage(resourceGroupName, options, settings) {
109
- return __asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
110
- let result;
111
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
112
- if (!continuationToken) {
113
- result = yield __await(this._listByResourceGroup(resourceGroupName, options));
114
- let page = result.value || [];
115
- continuationToken = result.nextLink;
116
- setContinuationToken(page, continuationToken);
117
- yield yield __await(page);
118
- }
119
- while (continuationToken) {
120
- result = yield __await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
121
- continuationToken = result.nextLink;
122
- let page = result.value || [];
123
- setContinuationToken(page, continuationToken);
124
- yield yield __await(page);
125
- }
126
- });
91
+ async *listByResourceGroupPagingPage(resourceGroupName, options, settings) {
92
+ let result;
93
+ let continuationToken = settings?.continuationToken;
94
+ if (!continuationToken) {
95
+ result = await this._listByResourceGroup(resourceGroupName, options);
96
+ let page = result.value || [];
97
+ continuationToken = result.nextLink;
98
+ setContinuationToken(page, continuationToken);
99
+ yield page;
100
+ }
101
+ while (continuationToken) {
102
+ result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options);
103
+ continuationToken = result.nextLink;
104
+ let page = result.value || [];
105
+ setContinuationToken(page, continuationToken);
106
+ yield page;
107
+ }
127
108
  }
128
- listByResourceGroupPagingAll(resourceGroupName, options) {
129
- return __asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
130
- var _a, e_2, _b, _c;
131
- try {
132
- for (var _d = true, _e = __asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
133
- _c = _f.value;
134
- _d = false;
135
- const page = _c;
136
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
137
- }
138
- }
139
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
140
- finally {
141
- try {
142
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
143
- }
144
- finally { if (e_2) throw e_2.error; }
145
- }
146
- });
109
+ async *listByResourceGroupPagingAll(resourceGroupName, options) {
110
+ for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
111
+ yield* page;
112
+ }
147
113
  }
148
114
  /**
149
115
  * Get the list of valid SKUs for an IoT hub.
@@ -161,52 +127,35 @@ export class IotHubResourceImpl {
161
127
  return this;
162
128
  },
163
129
  byPage: (settings) => {
164
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
130
+ if (settings?.maxPageSize) {
165
131
  throw new Error("maxPageSize is not supported by this operation.");
166
132
  }
167
133
  return this.getValidSkusPagingPage(resourceGroupName, resourceName, options, settings);
168
134
  }
169
135
  };
170
136
  }
171
- getValidSkusPagingPage(resourceGroupName, resourceName, options, settings) {
172
- return __asyncGenerator(this, arguments, function* getValidSkusPagingPage_1() {
173
- let result;
174
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
175
- if (!continuationToken) {
176
- result = yield __await(this._getValidSkus(resourceGroupName, resourceName, options));
177
- let page = result.value || [];
178
- continuationToken = result.nextLink;
179
- setContinuationToken(page, continuationToken);
180
- yield yield __await(page);
181
- }
182
- while (continuationToken) {
183
- result = yield __await(this._getValidSkusNext(resourceGroupName, resourceName, continuationToken, options));
184
- continuationToken = result.nextLink;
185
- let page = result.value || [];
186
- setContinuationToken(page, continuationToken);
187
- yield yield __await(page);
188
- }
189
- });
137
+ async *getValidSkusPagingPage(resourceGroupName, resourceName, options, settings) {
138
+ let result;
139
+ let continuationToken = settings?.continuationToken;
140
+ if (!continuationToken) {
141
+ result = await this._getValidSkus(resourceGroupName, resourceName, options);
142
+ let page = result.value || [];
143
+ continuationToken = result.nextLink;
144
+ setContinuationToken(page, continuationToken);
145
+ yield page;
146
+ }
147
+ while (continuationToken) {
148
+ result = await this._getValidSkusNext(resourceGroupName, resourceName, continuationToken, options);
149
+ continuationToken = result.nextLink;
150
+ let page = result.value || [];
151
+ setContinuationToken(page, continuationToken);
152
+ yield page;
153
+ }
190
154
  }
191
- getValidSkusPagingAll(resourceGroupName, resourceName, options) {
192
- return __asyncGenerator(this, arguments, function* getValidSkusPagingAll_1() {
193
- var _a, e_3, _b, _c;
194
- try {
195
- for (var _d = true, _e = __asyncValues(this.getValidSkusPagingPage(resourceGroupName, resourceName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
196
- _c = _f.value;
197
- _d = false;
198
- const page = _c;
199
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
200
- }
201
- }
202
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
203
- finally {
204
- try {
205
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
206
- }
207
- finally { if (e_3) throw e_3.error; }
208
- }
209
- });
155
+ async *getValidSkusPagingAll(resourceGroupName, resourceName, options) {
156
+ for await (const page of this.getValidSkusPagingPage(resourceGroupName, resourceName, options)) {
157
+ yield* page;
158
+ }
210
159
  }
211
160
  /**
212
161
  * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT
@@ -226,52 +175,35 @@ export class IotHubResourceImpl {
226
175
  return this;
227
176
  },
228
177
  byPage: (settings) => {
229
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
178
+ if (settings?.maxPageSize) {
230
179
  throw new Error("maxPageSize is not supported by this operation.");
231
180
  }
232
181
  return this.listEventHubConsumerGroupsPagingPage(resourceGroupName, resourceName, eventHubEndpointName, options, settings);
233
182
  }
234
183
  };
235
184
  }
236
- listEventHubConsumerGroupsPagingPage(resourceGroupName, resourceName, eventHubEndpointName, options, settings) {
237
- return __asyncGenerator(this, arguments, function* listEventHubConsumerGroupsPagingPage_1() {
238
- let result;
239
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
240
- if (!continuationToken) {
241
- result = yield __await(this._listEventHubConsumerGroups(resourceGroupName, resourceName, eventHubEndpointName, options));
242
- let page = result.value || [];
243
- continuationToken = result.nextLink;
244
- setContinuationToken(page, continuationToken);
245
- yield yield __await(page);
246
- }
247
- while (continuationToken) {
248
- result = yield __await(this._listEventHubConsumerGroupsNext(resourceGroupName, resourceName, eventHubEndpointName, continuationToken, options));
249
- continuationToken = result.nextLink;
250
- let page = result.value || [];
251
- setContinuationToken(page, continuationToken);
252
- yield yield __await(page);
253
- }
254
- });
185
+ async *listEventHubConsumerGroupsPagingPage(resourceGroupName, resourceName, eventHubEndpointName, options, settings) {
186
+ let result;
187
+ let continuationToken = settings?.continuationToken;
188
+ if (!continuationToken) {
189
+ result = await this._listEventHubConsumerGroups(resourceGroupName, resourceName, eventHubEndpointName, options);
190
+ let page = result.value || [];
191
+ continuationToken = result.nextLink;
192
+ setContinuationToken(page, continuationToken);
193
+ yield page;
194
+ }
195
+ while (continuationToken) {
196
+ result = await this._listEventHubConsumerGroupsNext(resourceGroupName, resourceName, eventHubEndpointName, continuationToken, options);
197
+ continuationToken = result.nextLink;
198
+ let page = result.value || [];
199
+ setContinuationToken(page, continuationToken);
200
+ yield page;
201
+ }
255
202
  }
256
- listEventHubConsumerGroupsPagingAll(resourceGroupName, resourceName, eventHubEndpointName, options) {
257
- return __asyncGenerator(this, arguments, function* listEventHubConsumerGroupsPagingAll_1() {
258
- var _a, e_4, _b, _c;
259
- try {
260
- for (var _d = true, _e = __asyncValues(this.listEventHubConsumerGroupsPagingPage(resourceGroupName, resourceName, eventHubEndpointName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
261
- _c = _f.value;
262
- _d = false;
263
- const page = _c;
264
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
265
- }
266
- }
267
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
268
- finally {
269
- try {
270
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
271
- }
272
- finally { if (e_4) throw e_4.error; }
273
- }
274
- });
203
+ async *listEventHubConsumerGroupsPagingAll(resourceGroupName, resourceName, eventHubEndpointName, options) {
204
+ for await (const page of this.listEventHubConsumerGroupsPagingPage(resourceGroupName, resourceName, eventHubEndpointName, options)) {
205
+ yield* page;
206
+ }
275
207
  }
276
208
  /**
277
209
  * Get a list of all the jobs in an IoT hub. For more information, see:
@@ -290,52 +222,35 @@ export class IotHubResourceImpl {
290
222
  return this;
291
223
  },
292
224
  byPage: (settings) => {
293
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
225
+ if (settings?.maxPageSize) {
294
226
  throw new Error("maxPageSize is not supported by this operation.");
295
227
  }
296
228
  return this.listJobsPagingPage(resourceGroupName, resourceName, options, settings);
297
229
  }
298
230
  };
299
231
  }
300
- listJobsPagingPage(resourceGroupName, resourceName, options, settings) {
301
- return __asyncGenerator(this, arguments, function* listJobsPagingPage_1() {
302
- let result;
303
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
304
- if (!continuationToken) {
305
- result = yield __await(this._listJobs(resourceGroupName, resourceName, options));
306
- let page = result.value || [];
307
- continuationToken = result.nextLink;
308
- setContinuationToken(page, continuationToken);
309
- yield yield __await(page);
310
- }
311
- while (continuationToken) {
312
- result = yield __await(this._listJobsNext(resourceGroupName, resourceName, continuationToken, options));
313
- continuationToken = result.nextLink;
314
- let page = result.value || [];
315
- setContinuationToken(page, continuationToken);
316
- yield yield __await(page);
317
- }
318
- });
232
+ async *listJobsPagingPage(resourceGroupName, resourceName, options, settings) {
233
+ let result;
234
+ let continuationToken = settings?.continuationToken;
235
+ if (!continuationToken) {
236
+ result = await this._listJobs(resourceGroupName, resourceName, options);
237
+ let page = result.value || [];
238
+ continuationToken = result.nextLink;
239
+ setContinuationToken(page, continuationToken);
240
+ yield page;
241
+ }
242
+ while (continuationToken) {
243
+ result = await this._listJobsNext(resourceGroupName, resourceName, continuationToken, options);
244
+ continuationToken = result.nextLink;
245
+ let page = result.value || [];
246
+ setContinuationToken(page, continuationToken);
247
+ yield page;
248
+ }
319
249
  }
320
- listJobsPagingAll(resourceGroupName, resourceName, options) {
321
- return __asyncGenerator(this, arguments, function* listJobsPagingAll_1() {
322
- var _a, e_5, _b, _c;
323
- try {
324
- for (var _d = true, _e = __asyncValues(this.listJobsPagingPage(resourceGroupName, resourceName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
325
- _c = _f.value;
326
- _d = false;
327
- const page = _c;
328
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
329
- }
330
- }
331
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
332
- finally {
333
- try {
334
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
335
- }
336
- finally { if (e_5) throw e_5.error; }
337
- }
338
- });
250
+ async *listJobsPagingAll(resourceGroupName, resourceName, options) {
251
+ for await (const page of this.listJobsPagingPage(resourceGroupName, resourceName, options)) {
252
+ yield* page;
253
+ }
339
254
  }
340
255
  /**
341
256
  * Get the quota metrics for an IoT hub.
@@ -353,52 +268,35 @@ export class IotHubResourceImpl {
353
268
  return this;
354
269
  },
355
270
  byPage: (settings) => {
356
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
271
+ if (settings?.maxPageSize) {
357
272
  throw new Error("maxPageSize is not supported by this operation.");
358
273
  }
359
274
  return this.getQuotaMetricsPagingPage(resourceGroupName, resourceName, options, settings);
360
275
  }
361
276
  };
362
277
  }
363
- getQuotaMetricsPagingPage(resourceGroupName, resourceName, options, settings) {
364
- return __asyncGenerator(this, arguments, function* getQuotaMetricsPagingPage_1() {
365
- let result;
366
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
367
- if (!continuationToken) {
368
- result = yield __await(this._getQuotaMetrics(resourceGroupName, resourceName, options));
369
- let page = result.value || [];
370
- continuationToken = result.nextLink;
371
- setContinuationToken(page, continuationToken);
372
- yield yield __await(page);
373
- }
374
- while (continuationToken) {
375
- result = yield __await(this._getQuotaMetricsNext(resourceGroupName, resourceName, continuationToken, options));
376
- continuationToken = result.nextLink;
377
- let page = result.value || [];
378
- setContinuationToken(page, continuationToken);
379
- yield yield __await(page);
380
- }
381
- });
278
+ async *getQuotaMetricsPagingPage(resourceGroupName, resourceName, options, settings) {
279
+ let result;
280
+ let continuationToken = settings?.continuationToken;
281
+ if (!continuationToken) {
282
+ result = await this._getQuotaMetrics(resourceGroupName, resourceName, options);
283
+ let page = result.value || [];
284
+ continuationToken = result.nextLink;
285
+ setContinuationToken(page, continuationToken);
286
+ yield page;
287
+ }
288
+ while (continuationToken) {
289
+ result = await this._getQuotaMetricsNext(resourceGroupName, resourceName, continuationToken, options);
290
+ continuationToken = result.nextLink;
291
+ let page = result.value || [];
292
+ setContinuationToken(page, continuationToken);
293
+ yield page;
294
+ }
382
295
  }
383
- getQuotaMetricsPagingAll(resourceGroupName, resourceName, options) {
384
- return __asyncGenerator(this, arguments, function* getQuotaMetricsPagingAll_1() {
385
- var _a, e_6, _b, _c;
386
- try {
387
- for (var _d = true, _e = __asyncValues(this.getQuotaMetricsPagingPage(resourceGroupName, resourceName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
388
- _c = _f.value;
389
- _d = false;
390
- const page = _c;
391
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
392
- }
393
- }
394
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
395
- finally {
396
- try {
397
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
398
- }
399
- finally { if (e_6) throw e_6.error; }
400
- }
401
- });
296
+ async *getQuotaMetricsPagingAll(resourceGroupName, resourceName, options) {
297
+ for await (const page of this.getQuotaMetricsPagingPage(resourceGroupName, resourceName, options)) {
298
+ yield* page;
299
+ }
402
300
  }
403
301
  /**
404
302
  * Get the health for routing endpoints.
@@ -416,52 +314,35 @@ export class IotHubResourceImpl {
416
314
  return this;
417
315
  },
418
316
  byPage: (settings) => {
419
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
317
+ if (settings?.maxPageSize) {
420
318
  throw new Error("maxPageSize is not supported by this operation.");
421
319
  }
422
320
  return this.getEndpointHealthPagingPage(resourceGroupName, iotHubName, options, settings);
423
321
  }
424
322
  };
425
323
  }
426
- getEndpointHealthPagingPage(resourceGroupName, iotHubName, options, settings) {
427
- return __asyncGenerator(this, arguments, function* getEndpointHealthPagingPage_1() {
428
- let result;
429
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
430
- if (!continuationToken) {
431
- result = yield __await(this._getEndpointHealth(resourceGroupName, iotHubName, options));
432
- let page = result.value || [];
433
- continuationToken = result.nextLink;
434
- setContinuationToken(page, continuationToken);
435
- yield yield __await(page);
436
- }
437
- while (continuationToken) {
438
- result = yield __await(this._getEndpointHealthNext(resourceGroupName, iotHubName, continuationToken, options));
439
- continuationToken = result.nextLink;
440
- let page = result.value || [];
441
- setContinuationToken(page, continuationToken);
442
- yield yield __await(page);
443
- }
444
- });
324
+ async *getEndpointHealthPagingPage(resourceGroupName, iotHubName, options, settings) {
325
+ let result;
326
+ let continuationToken = settings?.continuationToken;
327
+ if (!continuationToken) {
328
+ result = await this._getEndpointHealth(resourceGroupName, iotHubName, options);
329
+ let page = result.value || [];
330
+ continuationToken = result.nextLink;
331
+ setContinuationToken(page, continuationToken);
332
+ yield page;
333
+ }
334
+ while (continuationToken) {
335
+ result = await this._getEndpointHealthNext(resourceGroupName, iotHubName, continuationToken, options);
336
+ continuationToken = result.nextLink;
337
+ let page = result.value || [];
338
+ setContinuationToken(page, continuationToken);
339
+ yield page;
340
+ }
445
341
  }
446
- getEndpointHealthPagingAll(resourceGroupName, iotHubName, options) {
447
- return __asyncGenerator(this, arguments, function* getEndpointHealthPagingAll_1() {
448
- var _a, e_7, _b, _c;
449
- try {
450
- for (var _d = true, _e = __asyncValues(this.getEndpointHealthPagingPage(resourceGroupName, iotHubName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
451
- _c = _f.value;
452
- _d = false;
453
- const page = _c;
454
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
455
- }
456
- }
457
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
458
- finally {
459
- try {
460
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
461
- }
462
- finally { if (e_7) throw e_7.error; }
463
- }
464
- });
342
+ async *getEndpointHealthPagingAll(resourceGroupName, iotHubName, options) {
343
+ for await (const page of this.getEndpointHealthPagingPage(resourceGroupName, iotHubName, options)) {
344
+ yield* page;
345
+ }
465
346
  }
466
347
  /**
467
348
  * Get the security metadata for an IoT hub. For more information, see:
@@ -480,52 +361,35 @@ export class IotHubResourceImpl {
480
361
  return this;
481
362
  },
482
363
  byPage: (settings) => {
483
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
364
+ if (settings?.maxPageSize) {
484
365
  throw new Error("maxPageSize is not supported by this operation.");
485
366
  }
486
367
  return this.listKeysPagingPage(resourceGroupName, resourceName, options, settings);
487
368
  }
488
369
  };
489
370
  }
490
- listKeysPagingPage(resourceGroupName, resourceName, options, settings) {
491
- return __asyncGenerator(this, arguments, function* listKeysPagingPage_1() {
492
- let result;
493
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
494
- if (!continuationToken) {
495
- result = yield __await(this._listKeys(resourceGroupName, resourceName, options));
496
- let page = result.value || [];
497
- continuationToken = result.nextLink;
498
- setContinuationToken(page, continuationToken);
499
- yield yield __await(page);
500
- }
501
- while (continuationToken) {
502
- result = yield __await(this._listKeysNext(resourceGroupName, resourceName, continuationToken, options));
503
- continuationToken = result.nextLink;
504
- let page = result.value || [];
505
- setContinuationToken(page, continuationToken);
506
- yield yield __await(page);
507
- }
508
- });
371
+ async *listKeysPagingPage(resourceGroupName, resourceName, options, settings) {
372
+ let result;
373
+ let continuationToken = settings?.continuationToken;
374
+ if (!continuationToken) {
375
+ result = await this._listKeys(resourceGroupName, resourceName, options);
376
+ let page = result.value || [];
377
+ continuationToken = result.nextLink;
378
+ setContinuationToken(page, continuationToken);
379
+ yield page;
380
+ }
381
+ while (continuationToken) {
382
+ result = await this._listKeysNext(resourceGroupName, resourceName, continuationToken, options);
383
+ continuationToken = result.nextLink;
384
+ let page = result.value || [];
385
+ setContinuationToken(page, continuationToken);
386
+ yield page;
387
+ }
509
388
  }
510
- listKeysPagingAll(resourceGroupName, resourceName, options) {
511
- return __asyncGenerator(this, arguments, function* listKeysPagingAll_1() {
512
- var _a, e_8, _b, _c;
513
- try {
514
- for (var _d = true, _e = __asyncValues(this.listKeysPagingPage(resourceGroupName, resourceName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
515
- _c = _f.value;
516
- _d = false;
517
- const page = _c;
518
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
519
- }
520
- }
521
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
522
- finally {
523
- try {
524
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
525
- }
526
- finally { if (e_8) throw e_8.error; }
527
- }
528
- });
389
+ async *listKeysPagingAll(resourceGroupName, resourceName, options) {
390
+ for await (const page of this.listKeysPagingPage(resourceGroupName, resourceName, options)) {
391
+ yield* page;
392
+ }
529
393
  }
530
394
  /**
531
395
  * Get the non-security related metadata of an IoT hub.
@@ -551,14 +415,19 @@ export class IotHubResourceImpl {
551
415
  return this.client.sendOperationRequest(args, spec);
552
416
  };
553
417
  const sendOperation = async (args, spec) => {
554
- var _a;
555
418
  let currentRawResponse = undefined;
556
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
419
+ const providedCallback = args.options?.onResponse;
557
420
  const callback = (rawResponse, flatResponse) => {
558
421
  currentRawResponse = rawResponse;
559
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
422
+ providedCallback?.(rawResponse, flatResponse);
423
+ };
424
+ const updatedArgs = {
425
+ ...args,
426
+ options: {
427
+ ...args.options,
428
+ onResponse: callback
429
+ }
560
430
  };
561
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
562
431
  const flatResponse = await directSendOperation(updatedArgs, spec);
563
432
  return {
564
433
  flatResponse,
@@ -571,8 +440,8 @@ export class IotHubResourceImpl {
571
440
  };
572
441
  const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, iotHubDescription, options }, createOrUpdateOperationSpec);
573
442
  const poller = new LroEngine(lro, {
574
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
575
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
443
+ resumeFrom: options?.resumeFrom,
444
+ intervalInMs: options?.updateIntervalInMs
576
445
  });
577
446
  await poller.poll();
578
447
  return poller;
@@ -603,14 +472,19 @@ export class IotHubResourceImpl {
603
472
  return this.client.sendOperationRequest(args, spec);
604
473
  };
605
474
  const sendOperation = async (args, spec) => {
606
- var _a;
607
475
  let currentRawResponse = undefined;
608
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
476
+ const providedCallback = args.options?.onResponse;
609
477
  const callback = (rawResponse, flatResponse) => {
610
478
  currentRawResponse = rawResponse;
611
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
479
+ providedCallback?.(rawResponse, flatResponse);
480
+ };
481
+ const updatedArgs = {
482
+ ...args,
483
+ options: {
484
+ ...args.options,
485
+ onResponse: callback
486
+ }
612
487
  };
613
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
614
488
  const flatResponse = await directSendOperation(updatedArgs, spec);
615
489
  return {
616
490
  flatResponse,
@@ -623,8 +497,8 @@ export class IotHubResourceImpl {
623
497
  };
624
498
  const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, iotHubTags, options }, updateOperationSpec);
625
499
  const poller = new LroEngine(lro, {
626
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
627
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
500
+ resumeFrom: options?.resumeFrom,
501
+ intervalInMs: options?.updateIntervalInMs
628
502
  });
629
503
  await poller.poll();
630
504
  return poller;
@@ -651,14 +525,19 @@ export class IotHubResourceImpl {
651
525
  return this.client.sendOperationRequest(args, spec);
652
526
  };
653
527
  const sendOperation = async (args, spec) => {
654
- var _a;
655
528
  let currentRawResponse = undefined;
656
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
529
+ const providedCallback = args.options?.onResponse;
657
530
  const callback = (rawResponse, flatResponse) => {
658
531
  currentRawResponse = rawResponse;
659
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
532
+ providedCallback?.(rawResponse, flatResponse);
533
+ };
534
+ const updatedArgs = {
535
+ ...args,
536
+ options: {
537
+ ...args.options,
538
+ onResponse: callback
539
+ }
660
540
  };
661
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
662
541
  const flatResponse = await directSendOperation(updatedArgs, spec);
663
542
  return {
664
543
  flatResponse,
@@ -671,8 +550,8 @@ export class IotHubResourceImpl {
671
550
  };
672
551
  const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec);
673
552
  const poller = new LroEngine(lro, {
674
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
675
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
553
+ resumeFrom: options?.resumeFrom,
554
+ intervalInMs: options?.updateIntervalInMs
676
555
  });
677
556
  await poller.poll();
678
557
  return poller;