@azure/arm-iothub-profile-2020-09-01-hybrid 2.1.1-alpha.20250717.1 → 2.1.1-alpha.20250730.1

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