@azure/arm-deviceprovisioningservices 6.0.0-alpha.20250718.1 → 6.0.0-alpha.20250721.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 (59) hide show
  1. package/dist/browser/iotDpsClient.js +16 -5
  2. package/dist/browser/iotDpsClient.js.map +1 -1
  3. package/dist/browser/lroImpl.js +7 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +13 -6
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/dpsCertificate.js +1 -0
  8. package/dist/browser/operations/dpsCertificate.js.map +1 -1
  9. package/dist/browser/operations/iotDpsResource.js +144 -187
  10. package/dist/browser/operations/iotDpsResource.js.map +1 -1
  11. package/dist/browser/operations/operations.js +23 -40
  12. package/dist/browser/operations/operations.js.map +1 -1
  13. package/dist/browser/pagingHelper.js +2 -4
  14. package/dist/browser/pagingHelper.js.map +1 -1
  15. package/dist/commonjs/iotDpsClient.js +16 -5
  16. package/dist/commonjs/iotDpsClient.js.map +1 -1
  17. package/dist/commonjs/lroImpl.js +7 -3
  18. package/dist/commonjs/lroImpl.js.map +1 -1
  19. package/dist/commonjs/models/mappers.js +13 -6
  20. package/dist/commonjs/models/mappers.js.map +1 -1
  21. package/dist/commonjs/operations/dpsCertificate.js +1 -0
  22. package/dist/commonjs/operations/dpsCertificate.js.map +1 -1
  23. package/dist/commonjs/operations/iotDpsResource.js +144 -186
  24. package/dist/commonjs/operations/iotDpsResource.js.map +1 -1
  25. package/dist/commonjs/operations/operations.js +23 -39
  26. package/dist/commonjs/operations/operations.js.map +1 -1
  27. package/dist/commonjs/pagingHelper.js +2 -4
  28. package/dist/commonjs/pagingHelper.js.map +1 -1
  29. package/dist/commonjs/tsdoc-metadata.json +11 -11
  30. package/dist/esm/iotDpsClient.js +16 -5
  31. package/dist/esm/iotDpsClient.js.map +1 -1
  32. package/dist/esm/lroImpl.js +7 -3
  33. package/dist/esm/lroImpl.js.map +1 -1
  34. package/dist/esm/models/mappers.js +13 -6
  35. package/dist/esm/models/mappers.js.map +1 -1
  36. package/dist/esm/operations/dpsCertificate.js +1 -0
  37. package/dist/esm/operations/dpsCertificate.js.map +1 -1
  38. package/dist/esm/operations/iotDpsResource.js +144 -187
  39. package/dist/esm/operations/iotDpsResource.js.map +1 -1
  40. package/dist/esm/operations/operations.js +23 -40
  41. package/dist/esm/operations/operations.js.map +1 -1
  42. package/dist/esm/pagingHelper.js +2 -4
  43. package/dist/esm/pagingHelper.js.map +1 -1
  44. package/dist/react-native/iotDpsClient.js +16 -5
  45. package/dist/react-native/iotDpsClient.js.map +1 -1
  46. package/dist/react-native/lroImpl.js +7 -3
  47. package/dist/react-native/lroImpl.js.map +1 -1
  48. package/dist/react-native/models/mappers.js +13 -6
  49. package/dist/react-native/models/mappers.js.map +1 -1
  50. package/dist/react-native/operations/dpsCertificate.js +1 -0
  51. package/dist/react-native/operations/dpsCertificate.js.map +1 -1
  52. package/dist/react-native/operations/iotDpsResource.js +144 -187
  53. package/dist/react-native/operations/iotDpsResource.js.map +1 -1
  54. package/dist/react-native/operations/operations.js +23 -40
  55. package/dist/react-native/operations/operations.js.map +1 -1
  56. package/dist/react-native/pagingHelper.js +2 -4
  57. package/dist/react-native/pagingHelper.js.map +1 -1
  58. package/package.json +2 -2
  59. package/review/arm-deviceprovisioningservices-node.api.md +724 -724
@@ -18,6 +18,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
18
18
  /// <reference lib="esnext.asynciterable" />
19
19
  /** Class containing IotDpsResource operations. */
20
20
  class IotDpsResourceImpl {
21
+ client;
21
22
  /**
22
23
  * Initialize a new instance of the class IotDpsResource class.
23
24
  * @param client Reference to the service client
@@ -39,52 +40,35 @@ class IotDpsResourceImpl {
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 a list of all provisioning services in the given resource group.
@@ -101,52 +85,35 @@ class IotDpsResourceImpl {
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
  * Gets the list of valid SKUs and tiers for a provisioning service.
@@ -164,52 +131,35 @@ class IotDpsResourceImpl {
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.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings);
171
138
  }
172
139
  };
173
140
  }
174
- listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
175
- return tslib_1.__asyncGenerator(this, arguments, function* listValidSkusPagingPage_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._listValidSkus(provisioningServiceName, resourceGroupName, 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._listValidSkusNext(provisioningServiceName, resourceGroupName, 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 *listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
142
+ let result;
143
+ let continuationToken = settings?.continuationToken;
144
+ if (!continuationToken) {
145
+ result = await this._listValidSkus(provisioningServiceName, resourceGroupName, 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._listValidSkusNext(provisioningServiceName, resourceGroupName, 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
- listValidSkusPagingAll(provisioningServiceName, resourceGroupName, options) {
195
- return tslib_1.__asyncGenerator(this, arguments, function* listValidSkusPagingAll_1() {
196
- var _a, e_3, _b, _c;
197
- try {
198
- for (var _d = true, _e = tslib_1.__asyncValues(this.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, 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 *listValidSkusPagingAll(provisioningServiceName, resourceGroupName, options) {
160
+ for await (const page of this.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options)) {
161
+ yield* page;
162
+ }
213
163
  }
214
164
  /**
215
165
  * List the primary and secondary keys for a provisioning service.
@@ -227,52 +177,35 @@ class IotDpsResourceImpl {
227
177
  return this;
228
178
  },
229
179
  byPage: (settings) => {
230
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
180
+ if (settings?.maxPageSize) {
231
181
  throw new Error("maxPageSize is not supported by this operation.");
232
182
  }
233
183
  return this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings);
234
184
  }
235
185
  };
236
186
  }
237
- listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
238
- return tslib_1.__asyncGenerator(this, arguments, function* listKeysPagingPage_1() {
239
- let result;
240
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
241
- if (!continuationToken) {
242
- result = yield tslib_1.__await(this._listKeys(provisioningServiceName, resourceGroupName, options));
243
- let page = result.value || [];
244
- continuationToken = result.nextLink;
245
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
246
- yield yield tslib_1.__await(page);
247
- }
248
- while (continuationToken) {
249
- result = yield tslib_1.__await(this._listKeysNext(provisioningServiceName, resourceGroupName, continuationToken, options));
250
- continuationToken = result.nextLink;
251
- let page = result.value || [];
252
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
253
- yield yield tslib_1.__await(page);
254
- }
255
- });
187
+ async *listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
188
+ let result;
189
+ let continuationToken = settings?.continuationToken;
190
+ if (!continuationToken) {
191
+ result = await this._listKeys(provisioningServiceName, resourceGroupName, options);
192
+ let page = result.value || [];
193
+ continuationToken = result.nextLink;
194
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
195
+ yield page;
196
+ }
197
+ while (continuationToken) {
198
+ result = await this._listKeysNext(provisioningServiceName, resourceGroupName, continuationToken, options);
199
+ continuationToken = result.nextLink;
200
+ let page = result.value || [];
201
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
202
+ yield page;
203
+ }
256
204
  }
257
- listKeysPagingAll(provisioningServiceName, resourceGroupName, options) {
258
- return tslib_1.__asyncGenerator(this, arguments, function* listKeysPagingAll_1() {
259
- var _a, e_4, _b, _c;
260
- try {
261
- for (var _d = true, _e = tslib_1.__asyncValues(this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
262
- _c = _f.value;
263
- _d = false;
264
- const page = _c;
265
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
266
- }
267
- }
268
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
269
- finally {
270
- try {
271
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
272
- }
273
- finally { if (e_4) throw e_4.error; }
274
- }
275
- });
205
+ async *listKeysPagingAll(provisioningServiceName, resourceGroupName, options) {
206
+ for await (const page of this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options)) {
207
+ yield* page;
208
+ }
276
209
  }
277
210
  /**
278
211
  * Get the metadata of the provisioning service without SAS keys.
@@ -297,14 +230,19 @@ class IotDpsResourceImpl {
297
230
  return this.client.sendOperationRequest(args, spec);
298
231
  };
299
232
  const sendOperationFn = async (args, spec) => {
300
- var _a;
301
233
  let currentRawResponse = undefined;
302
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
234
+ const providedCallback = args.options?.onResponse;
303
235
  const callback = (rawResponse, flatResponse) => {
304
236
  currentRawResponse = rawResponse;
305
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
237
+ providedCallback?.(rawResponse, flatResponse);
238
+ };
239
+ const updatedArgs = {
240
+ ...args,
241
+ options: {
242
+ ...args.options,
243
+ onResponse: callback
244
+ }
306
245
  };
307
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
308
246
  const flatResponse = await directSendOperation(updatedArgs, spec);
309
247
  return {
310
248
  flatResponse,
@@ -326,8 +264,8 @@ class IotDpsResourceImpl {
326
264
  spec: createOrUpdateOperationSpec
327
265
  });
328
266
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
329
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
330
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
267
+ restoreFrom: options?.resumeFrom,
268
+ intervalInMs: options?.updateIntervalInMs
331
269
  });
332
270
  await poller.poll();
333
271
  return poller;
@@ -358,14 +296,19 @@ class IotDpsResourceImpl {
358
296
  return this.client.sendOperationRequest(args, spec);
359
297
  };
360
298
  const sendOperationFn = async (args, spec) => {
361
- var _a;
362
299
  let currentRawResponse = undefined;
363
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
300
+ const providedCallback = args.options?.onResponse;
364
301
  const callback = (rawResponse, flatResponse) => {
365
302
  currentRawResponse = rawResponse;
366
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
303
+ providedCallback?.(rawResponse, flatResponse);
304
+ };
305
+ const updatedArgs = {
306
+ ...args,
307
+ options: {
308
+ ...args.options,
309
+ onResponse: callback
310
+ }
367
311
  };
368
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
369
312
  const flatResponse = await directSendOperation(updatedArgs, spec);
370
313
  return {
371
314
  flatResponse,
@@ -387,8 +330,8 @@ class IotDpsResourceImpl {
387
330
  spec: updateOperationSpec
388
331
  });
389
332
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
390
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
391
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
333
+ restoreFrom: options?.resumeFrom,
334
+ intervalInMs: options?.updateIntervalInMs
392
335
  });
393
336
  await poller.poll();
394
337
  return poller;
@@ -416,14 +359,19 @@ class IotDpsResourceImpl {
416
359
  return this.client.sendOperationRequest(args, spec);
417
360
  };
418
361
  const sendOperationFn = async (args, spec) => {
419
- var _a;
420
362
  let currentRawResponse = undefined;
421
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
363
+ const providedCallback = args.options?.onResponse;
422
364
  const callback = (rawResponse, flatResponse) => {
423
365
  currentRawResponse = rawResponse;
424
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
366
+ providedCallback?.(rawResponse, flatResponse);
367
+ };
368
+ const updatedArgs = {
369
+ ...args,
370
+ options: {
371
+ ...args.options,
372
+ onResponse: callback
373
+ }
425
374
  };
426
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
427
375
  const flatResponse = await directSendOperation(updatedArgs, spec);
428
376
  return {
429
377
  flatResponse,
@@ -440,8 +388,8 @@ class IotDpsResourceImpl {
440
388
  spec: deleteOperationSpec
441
389
  });
442
390
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
443
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
444
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
391
+ restoreFrom: options?.resumeFrom,
392
+ intervalInMs: options?.updateIntervalInMs
445
393
  });
446
394
  await poller.poll();
447
395
  return poller;
@@ -585,14 +533,19 @@ class IotDpsResourceImpl {
585
533
  return this.client.sendOperationRequest(args, spec);
586
534
  };
587
535
  const sendOperationFn = async (args, spec) => {
588
- var _a;
589
536
  let currentRawResponse = undefined;
590
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
537
+ const providedCallback = args.options?.onResponse;
591
538
  const callback = (rawResponse, flatResponse) => {
592
539
  currentRawResponse = rawResponse;
593
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
540
+ providedCallback?.(rawResponse, flatResponse);
541
+ };
542
+ const updatedArgs = {
543
+ ...args,
544
+ options: {
545
+ ...args.options,
546
+ onResponse: callback
547
+ }
594
548
  };
595
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
596
549
  const flatResponse = await directSendOperation(updatedArgs, spec);
597
550
  return {
598
551
  flatResponse,
@@ -615,8 +568,8 @@ class IotDpsResourceImpl {
615
568
  spec: createOrUpdatePrivateEndpointConnectionOperationSpec
616
569
  });
617
570
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
618
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
619
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
571
+ restoreFrom: options?.resumeFrom,
572
+ intervalInMs: options?.updateIntervalInMs
620
573
  });
621
574
  await poller.poll();
622
575
  return poller;
@@ -645,14 +598,19 @@ class IotDpsResourceImpl {
645
598
  return this.client.sendOperationRequest(args, spec);
646
599
  };
647
600
  const sendOperationFn = async (args, spec) => {
648
- var _a;
649
601
  let currentRawResponse = undefined;
650
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
602
+ const providedCallback = args.options?.onResponse;
651
603
  const callback = (rawResponse, flatResponse) => {
652
604
  currentRawResponse = rawResponse;
653
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
605
+ providedCallback?.(rawResponse, flatResponse);
606
+ };
607
+ const updatedArgs = {
608
+ ...args,
609
+ options: {
610
+ ...args.options,
611
+ onResponse: callback
612
+ }
654
613
  };
655
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
656
614
  const flatResponse = await directSendOperation(updatedArgs, spec);
657
615
  return {
658
616
  flatResponse,
@@ -674,8 +632,8 @@ class IotDpsResourceImpl {
674
632
  spec: deletePrivateEndpointConnectionOperationSpec
675
633
  });
676
634
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
677
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
678
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
635
+ restoreFrom: options?.resumeFrom,
636
+ intervalInMs: options?.updateIntervalInMs
679
637
  });
680
638
  await poller.poll();
681
639
  return poller;