@azure/arm-deviceprovisioningservices 6.0.0-alpha.20250620.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.api.md → arm-deviceprovisioningservices-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 { createLroSpec } from "../lroImpl.js";
15
14
  /// <reference lib="esnext.asynciterable" />
16
15
  /** Class containing IotDpsResource operations. */
17
16
  export class IotDpsResourceImpl {
17
+ client;
18
18
  /**
19
19
  * Initialize a new instance of the class IotDpsResource class.
20
20
  * @param client Reference to the service client
@@ -36,52 +36,35 @@ export class IotDpsResourceImpl {
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 a list of all provisioning services in the given resource group.
@@ -98,52 +81,35 @@ export class IotDpsResourceImpl {
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
  * Gets the list of valid SKUs and tiers for a provisioning service.
@@ -161,52 +127,35 @@ export class IotDpsResourceImpl {
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.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings);
168
134
  }
169
135
  };
170
136
  }
171
- listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
172
- return __asyncGenerator(this, arguments, function* listValidSkusPagingPage_1() {
173
- let result;
174
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
175
- if (!continuationToken) {
176
- result = yield __await(this._listValidSkus(provisioningServiceName, resourceGroupName, 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._listValidSkusNext(provisioningServiceName, resourceGroupName, continuationToken, options));
184
- continuationToken = result.nextLink;
185
- let page = result.value || [];
186
- setContinuationToken(page, continuationToken);
187
- yield yield __await(page);
188
- }
189
- });
137
+ async *listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
138
+ let result;
139
+ let continuationToken = settings?.continuationToken;
140
+ if (!continuationToken) {
141
+ result = await this._listValidSkus(provisioningServiceName, resourceGroupName, 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._listValidSkusNext(provisioningServiceName, resourceGroupName, continuationToken, options);
149
+ continuationToken = result.nextLink;
150
+ let page = result.value || [];
151
+ setContinuationToken(page, continuationToken);
152
+ yield page;
153
+ }
190
154
  }
191
- listValidSkusPagingAll(provisioningServiceName, resourceGroupName, options) {
192
- return __asyncGenerator(this, arguments, function* listValidSkusPagingAll_1() {
193
- var _a, e_3, _b, _c;
194
- try {
195
- for (var _d = true, _e = __asyncValues(this.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, 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 *listValidSkusPagingAll(provisioningServiceName, resourceGroupName, options) {
156
+ for await (const page of this.listValidSkusPagingPage(provisioningServiceName, resourceGroupName, options)) {
157
+ yield* page;
158
+ }
210
159
  }
211
160
  /**
212
161
  * List the primary and secondary keys for a provisioning service.
@@ -224,52 +173,35 @@ export class IotDpsResourceImpl {
224
173
  return this;
225
174
  },
226
175
  byPage: (settings) => {
227
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
176
+ if (settings?.maxPageSize) {
228
177
  throw new Error("maxPageSize is not supported by this operation.");
229
178
  }
230
179
  return this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings);
231
180
  }
232
181
  };
233
182
  }
234
- listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
235
- return __asyncGenerator(this, arguments, function* listKeysPagingPage_1() {
236
- let result;
237
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
238
- if (!continuationToken) {
239
- result = yield __await(this._listKeys(provisioningServiceName, resourceGroupName, options));
240
- let page = result.value || [];
241
- continuationToken = result.nextLink;
242
- setContinuationToken(page, continuationToken);
243
- yield yield __await(page);
244
- }
245
- while (continuationToken) {
246
- result = yield __await(this._listKeysNext(provisioningServiceName, resourceGroupName, continuationToken, options));
247
- continuationToken = result.nextLink;
248
- let page = result.value || [];
249
- setContinuationToken(page, continuationToken);
250
- yield yield __await(page);
251
- }
252
- });
183
+ async *listKeysPagingPage(provisioningServiceName, resourceGroupName, options, settings) {
184
+ let result;
185
+ let continuationToken = settings?.continuationToken;
186
+ if (!continuationToken) {
187
+ result = await this._listKeys(provisioningServiceName, resourceGroupName, options);
188
+ let page = result.value || [];
189
+ continuationToken = result.nextLink;
190
+ setContinuationToken(page, continuationToken);
191
+ yield page;
192
+ }
193
+ while (continuationToken) {
194
+ result = await this._listKeysNext(provisioningServiceName, resourceGroupName, continuationToken, options);
195
+ continuationToken = result.nextLink;
196
+ let page = result.value || [];
197
+ setContinuationToken(page, continuationToken);
198
+ yield page;
199
+ }
253
200
  }
254
- listKeysPagingAll(provisioningServiceName, resourceGroupName, options) {
255
- return __asyncGenerator(this, arguments, function* listKeysPagingAll_1() {
256
- var _a, e_4, _b, _c;
257
- try {
258
- for (var _d = true, _e = __asyncValues(this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
259
- _c = _f.value;
260
- _d = false;
261
- const page = _c;
262
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
263
- }
264
- }
265
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
266
- finally {
267
- try {
268
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
269
- }
270
- finally { if (e_4) throw e_4.error; }
271
- }
272
- });
201
+ async *listKeysPagingAll(provisioningServiceName, resourceGroupName, options) {
202
+ for await (const page of this.listKeysPagingPage(provisioningServiceName, resourceGroupName, options)) {
203
+ yield* page;
204
+ }
273
205
  }
274
206
  /**
275
207
  * Get the metadata of the provisioning service without SAS keys.
@@ -294,14 +226,19 @@ export class IotDpsResourceImpl {
294
226
  return this.client.sendOperationRequest(args, spec);
295
227
  };
296
228
  const sendOperationFn = async (args, spec) => {
297
- var _a;
298
229
  let currentRawResponse = undefined;
299
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
230
+ const providedCallback = args.options?.onResponse;
300
231
  const callback = (rawResponse, flatResponse) => {
301
232
  currentRawResponse = rawResponse;
302
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
233
+ providedCallback?.(rawResponse, flatResponse);
234
+ };
235
+ const updatedArgs = {
236
+ ...args,
237
+ options: {
238
+ ...args.options,
239
+ onResponse: callback
240
+ }
303
241
  };
304
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
305
242
  const flatResponse = await directSendOperation(updatedArgs, spec);
306
243
  return {
307
244
  flatResponse,
@@ -323,8 +260,8 @@ export class IotDpsResourceImpl {
323
260
  spec: createOrUpdateOperationSpec
324
261
  });
325
262
  const poller = await createHttpPoller(lro, {
326
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
327
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
263
+ restoreFrom: options?.resumeFrom,
264
+ intervalInMs: options?.updateIntervalInMs
328
265
  });
329
266
  await poller.poll();
330
267
  return poller;
@@ -355,14 +292,19 @@ export class IotDpsResourceImpl {
355
292
  return this.client.sendOperationRequest(args, spec);
356
293
  };
357
294
  const sendOperationFn = async (args, spec) => {
358
- var _a;
359
295
  let currentRawResponse = undefined;
360
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
296
+ const providedCallback = args.options?.onResponse;
361
297
  const callback = (rawResponse, flatResponse) => {
362
298
  currentRawResponse = rawResponse;
363
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
299
+ providedCallback?.(rawResponse, flatResponse);
300
+ };
301
+ const updatedArgs = {
302
+ ...args,
303
+ options: {
304
+ ...args.options,
305
+ onResponse: callback
306
+ }
364
307
  };
365
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
366
308
  const flatResponse = await directSendOperation(updatedArgs, spec);
367
309
  return {
368
310
  flatResponse,
@@ -384,8 +326,8 @@ export class IotDpsResourceImpl {
384
326
  spec: updateOperationSpec
385
327
  });
386
328
  const poller = await createHttpPoller(lro, {
387
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
388
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
329
+ restoreFrom: options?.resumeFrom,
330
+ intervalInMs: options?.updateIntervalInMs
389
331
  });
390
332
  await poller.poll();
391
333
  return poller;
@@ -413,14 +355,19 @@ export class IotDpsResourceImpl {
413
355
  return this.client.sendOperationRequest(args, spec);
414
356
  };
415
357
  const sendOperationFn = async (args, spec) => {
416
- var _a;
417
358
  let currentRawResponse = undefined;
418
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
359
+ const providedCallback = args.options?.onResponse;
419
360
  const callback = (rawResponse, flatResponse) => {
420
361
  currentRawResponse = rawResponse;
421
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
362
+ providedCallback?.(rawResponse, flatResponse);
363
+ };
364
+ const updatedArgs = {
365
+ ...args,
366
+ options: {
367
+ ...args.options,
368
+ onResponse: callback
369
+ }
422
370
  };
423
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
424
371
  const flatResponse = await directSendOperation(updatedArgs, spec);
425
372
  return {
426
373
  flatResponse,
@@ -437,8 +384,8 @@ export class IotDpsResourceImpl {
437
384
  spec: deleteOperationSpec
438
385
  });
439
386
  const poller = await createHttpPoller(lro, {
440
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
441
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
387
+ restoreFrom: options?.resumeFrom,
388
+ intervalInMs: options?.updateIntervalInMs
442
389
  });
443
390
  await poller.poll();
444
391
  return poller;
@@ -582,14 +529,19 @@ export class IotDpsResourceImpl {
582
529
  return this.client.sendOperationRequest(args, spec);
583
530
  };
584
531
  const sendOperationFn = async (args, spec) => {
585
- var _a;
586
532
  let currentRawResponse = undefined;
587
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
533
+ const providedCallback = args.options?.onResponse;
588
534
  const callback = (rawResponse, flatResponse) => {
589
535
  currentRawResponse = rawResponse;
590
- 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
+ }
591
544
  };
592
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
593
545
  const flatResponse = await directSendOperation(updatedArgs, spec);
594
546
  return {
595
547
  flatResponse,
@@ -612,8 +564,8 @@ export class IotDpsResourceImpl {
612
564
  spec: createOrUpdatePrivateEndpointConnectionOperationSpec
613
565
  });
614
566
  const poller = await createHttpPoller(lro, {
615
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
616
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
567
+ restoreFrom: options?.resumeFrom,
568
+ intervalInMs: options?.updateIntervalInMs
617
569
  });
618
570
  await poller.poll();
619
571
  return poller;
@@ -642,14 +594,19 @@ export class IotDpsResourceImpl {
642
594
  return this.client.sendOperationRequest(args, spec);
643
595
  };
644
596
  const sendOperationFn = async (args, spec) => {
645
- var _a;
646
597
  let currentRawResponse = undefined;
647
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
598
+ const providedCallback = args.options?.onResponse;
648
599
  const callback = (rawResponse, flatResponse) => {
649
600
  currentRawResponse = rawResponse;
650
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
601
+ providedCallback?.(rawResponse, flatResponse);
602
+ };
603
+ const updatedArgs = {
604
+ ...args,
605
+ options: {
606
+ ...args.options,
607
+ onResponse: callback
608
+ }
651
609
  };
652
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
653
610
  const flatResponse = await directSendOperation(updatedArgs, spec);
654
611
  return {
655
612
  flatResponse,
@@ -671,8 +628,8 @@ export class IotDpsResourceImpl {
671
628
  spec: deletePrivateEndpointConnectionOperationSpec
672
629
  });
673
630
  const poller = await createHttpPoller(lro, {
674
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
675
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
631
+ restoreFrom: options?.resumeFrom,
632
+ intervalInMs: options?.updateIntervalInMs
676
633
  });
677
634
  await poller.poll();
678
635
  return poller;