@azure/arm-scvmm 1.0.1-alpha.20250718.1 → 1.0.1-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 (115) hide show
  1. package/dist/browser/lroImpl.js +7 -3
  2. package/dist/browser/lroImpl.js.map +1 -1
  3. package/dist/browser/models/mappers.js +105 -45
  4. package/dist/browser/models/mappers.js.map +1 -1
  5. package/dist/browser/operations/availabilitySets.js +78 -97
  6. package/dist/browser/operations/availabilitySets.js.map +1 -1
  7. package/dist/browser/operations/clouds.js +78 -97
  8. package/dist/browser/operations/clouds.js.map +1 -1
  9. package/dist/browser/operations/guestAgents.js +34 -46
  10. package/dist/browser/operations/guestAgents.js.map +1 -1
  11. package/dist/browser/operations/inventoryItems.js +23 -40
  12. package/dist/browser/operations/inventoryItems.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/virtualMachineInstances.js +122 -94
  16. package/dist/browser/operations/virtualMachineInstances.js.map +1 -1
  17. package/dist/browser/operations/virtualMachineTemplates.js +78 -97
  18. package/dist/browser/operations/virtualMachineTemplates.js.map +1 -1
  19. package/dist/browser/operations/virtualNetworks.js +78 -97
  20. package/dist/browser/operations/virtualNetworks.js.map +1 -1
  21. package/dist/browser/operations/vmInstanceHybridIdentityMetadatas.js +23 -40
  22. package/dist/browser/operations/vmInstanceHybridIdentityMetadatas.js.map +1 -1
  23. package/dist/browser/operations/vmmServers.js +78 -97
  24. package/dist/browser/operations/vmmServers.js.map +1 -1
  25. package/dist/browser/pagingHelper.js +2 -4
  26. package/dist/browser/pagingHelper.js.map +1 -1
  27. package/dist/browser/scVmm.js +23 -5
  28. package/dist/browser/scVmm.js.map +1 -1
  29. package/dist/commonjs/lroImpl.js +7 -3
  30. package/dist/commonjs/lroImpl.js.map +1 -1
  31. package/dist/commonjs/models/mappers.js +105 -45
  32. package/dist/commonjs/models/mappers.js.map +1 -1
  33. package/dist/commonjs/operations/availabilitySets.js +78 -96
  34. package/dist/commonjs/operations/availabilitySets.js.map +1 -1
  35. package/dist/commonjs/operations/clouds.js +78 -96
  36. package/dist/commonjs/operations/clouds.js.map +1 -1
  37. package/dist/commonjs/operations/guestAgents.js +34 -45
  38. package/dist/commonjs/operations/guestAgents.js.map +1 -1
  39. package/dist/commonjs/operations/inventoryItems.js +23 -39
  40. package/dist/commonjs/operations/inventoryItems.js.map +1 -1
  41. package/dist/commonjs/operations/operations.js +23 -39
  42. package/dist/commonjs/operations/operations.js.map +1 -1
  43. package/dist/commonjs/operations/virtualMachineInstances.js +122 -93
  44. package/dist/commonjs/operations/virtualMachineInstances.js.map +1 -1
  45. package/dist/commonjs/operations/virtualMachineTemplates.js +78 -96
  46. package/dist/commonjs/operations/virtualMachineTemplates.js.map +1 -1
  47. package/dist/commonjs/operations/virtualNetworks.js +78 -96
  48. package/dist/commonjs/operations/virtualNetworks.js.map +1 -1
  49. package/dist/commonjs/operations/vmInstanceHybridIdentityMetadatas.js +23 -39
  50. package/dist/commonjs/operations/vmInstanceHybridIdentityMetadatas.js.map +1 -1
  51. package/dist/commonjs/operations/vmmServers.js +78 -96
  52. package/dist/commonjs/operations/vmmServers.js.map +1 -1
  53. package/dist/commonjs/pagingHelper.js +2 -4
  54. package/dist/commonjs/pagingHelper.js.map +1 -1
  55. package/dist/commonjs/scVmm.js +23 -5
  56. package/dist/commonjs/scVmm.js.map +1 -1
  57. package/dist/commonjs/tsdoc-metadata.json +11 -11
  58. package/dist/esm/lroImpl.js +7 -3
  59. package/dist/esm/lroImpl.js.map +1 -1
  60. package/dist/esm/models/mappers.js +105 -45
  61. package/dist/esm/models/mappers.js.map +1 -1
  62. package/dist/esm/operations/availabilitySets.js +78 -97
  63. package/dist/esm/operations/availabilitySets.js.map +1 -1
  64. package/dist/esm/operations/clouds.js +78 -97
  65. package/dist/esm/operations/clouds.js.map +1 -1
  66. package/dist/esm/operations/guestAgents.js +34 -46
  67. package/dist/esm/operations/guestAgents.js.map +1 -1
  68. package/dist/esm/operations/inventoryItems.js +23 -40
  69. package/dist/esm/operations/inventoryItems.js.map +1 -1
  70. package/dist/esm/operations/operations.js +23 -40
  71. package/dist/esm/operations/operations.js.map +1 -1
  72. package/dist/esm/operations/virtualMachineInstances.js +122 -94
  73. package/dist/esm/operations/virtualMachineInstances.js.map +1 -1
  74. package/dist/esm/operations/virtualMachineTemplates.js +78 -97
  75. package/dist/esm/operations/virtualMachineTemplates.js.map +1 -1
  76. package/dist/esm/operations/virtualNetworks.js +78 -97
  77. package/dist/esm/operations/virtualNetworks.js.map +1 -1
  78. package/dist/esm/operations/vmInstanceHybridIdentityMetadatas.js +23 -40
  79. package/dist/esm/operations/vmInstanceHybridIdentityMetadatas.js.map +1 -1
  80. package/dist/esm/operations/vmmServers.js +78 -97
  81. package/dist/esm/operations/vmmServers.js.map +1 -1
  82. package/dist/esm/pagingHelper.js +2 -4
  83. package/dist/esm/pagingHelper.js.map +1 -1
  84. package/dist/esm/scVmm.js +23 -5
  85. package/dist/esm/scVmm.js.map +1 -1
  86. package/dist/react-native/lroImpl.js +7 -3
  87. package/dist/react-native/lroImpl.js.map +1 -1
  88. package/dist/react-native/models/mappers.js +105 -45
  89. package/dist/react-native/models/mappers.js.map +1 -1
  90. package/dist/react-native/operations/availabilitySets.js +78 -97
  91. package/dist/react-native/operations/availabilitySets.js.map +1 -1
  92. package/dist/react-native/operations/clouds.js +78 -97
  93. package/dist/react-native/operations/clouds.js.map +1 -1
  94. package/dist/react-native/operations/guestAgents.js +34 -46
  95. package/dist/react-native/operations/guestAgents.js.map +1 -1
  96. package/dist/react-native/operations/inventoryItems.js +23 -40
  97. package/dist/react-native/operations/inventoryItems.js.map +1 -1
  98. package/dist/react-native/operations/operations.js +23 -40
  99. package/dist/react-native/operations/operations.js.map +1 -1
  100. package/dist/react-native/operations/virtualMachineInstances.js +122 -94
  101. package/dist/react-native/operations/virtualMachineInstances.js.map +1 -1
  102. package/dist/react-native/operations/virtualMachineTemplates.js +78 -97
  103. package/dist/react-native/operations/virtualMachineTemplates.js.map +1 -1
  104. package/dist/react-native/operations/virtualNetworks.js +78 -97
  105. package/dist/react-native/operations/virtualNetworks.js.map +1 -1
  106. package/dist/react-native/operations/vmInstanceHybridIdentityMetadatas.js +23 -40
  107. package/dist/react-native/operations/vmInstanceHybridIdentityMetadatas.js.map +1 -1
  108. package/dist/react-native/operations/vmmServers.js +78 -97
  109. package/dist/react-native/operations/vmmServers.js.map +1 -1
  110. package/dist/react-native/pagingHelper.js +2 -4
  111. package/dist/react-native/pagingHelper.js.map +1 -1
  112. package/dist/react-native/scVmm.js +23 -5
  113. package/dist/react-native/scVmm.js.map +1 -1
  114. package/package.json +2 -2
  115. package/review/arm-scvmm-node.api.md +1571 -1571
@@ -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 VirtualMachineInstances operations. */
17
16
  export class VirtualMachineInstancesImpl {
17
+ client;
18
18
  /**
19
19
  * Initialize a new instance of the class VirtualMachineInstances class.
20
20
  * @param client Reference to the service client
@@ -37,52 +37,35 @@ export class VirtualMachineInstancesImpl {
37
37
  return this;
38
38
  },
39
39
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
40
+ if (settings?.maxPageSize) {
41
41
  throw new Error("maxPageSize is not supported by this operation.");
42
42
  }
43
43
  return this.listPagingPage(resourceUri, options, settings);
44
44
  },
45
45
  };
46
46
  }
47
- listPagingPage(resourceUri, options, settings) {
48
- return __asyncGenerator(this, arguments, function* listPagingPage_1() {
49
- let result;
50
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
51
- if (!continuationToken) {
52
- result = yield __await(this._list(resourceUri, options));
53
- let page = result.value || [];
54
- continuationToken = result.nextLink;
55
- setContinuationToken(page, continuationToken);
56
- yield yield __await(page);
57
- }
58
- while (continuationToken) {
59
- result = yield __await(this._listNext(resourceUri, continuationToken, options));
60
- continuationToken = result.nextLink;
61
- let page = result.value || [];
62
- setContinuationToken(page, continuationToken);
63
- yield yield __await(page);
64
- }
65
- });
47
+ async *listPagingPage(resourceUri, options, settings) {
48
+ let result;
49
+ let continuationToken = settings?.continuationToken;
50
+ if (!continuationToken) {
51
+ result = await this._list(resourceUri, options);
52
+ let page = result.value || [];
53
+ continuationToken = result.nextLink;
54
+ setContinuationToken(page, continuationToken);
55
+ yield page;
56
+ }
57
+ while (continuationToken) {
58
+ result = await this._listNext(resourceUri, continuationToken, options);
59
+ continuationToken = result.nextLink;
60
+ let page = result.value || [];
61
+ setContinuationToken(page, continuationToken);
62
+ yield page;
63
+ }
66
64
  }
67
- listPagingAll(resourceUri, options) {
68
- return __asyncGenerator(this, arguments, function* listPagingAll_1() {
69
- var _a, e_1, _b, _c;
70
- try {
71
- for (var _d = true, _e = __asyncValues(this.listPagingPage(resourceUri, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
72
- _c = _f.value;
73
- _d = false;
74
- const page = _c;
75
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- });
65
+ async *listPagingAll(resourceUri, options) {
66
+ for await (const page of this.listPagingPage(resourceUri, options)) {
67
+ yield* page;
68
+ }
86
69
  }
87
70
  /**
88
71
  * Lists all of the virtual machine instances within the specified parent resource.
@@ -112,14 +95,19 @@ export class VirtualMachineInstancesImpl {
112
95
  return this.client.sendOperationRequest(args, spec);
113
96
  };
114
97
  const sendOperationFn = async (args, spec) => {
115
- var _a;
116
98
  let currentRawResponse = undefined;
117
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
99
+ const providedCallback = args.options?.onResponse;
118
100
  const callback = (rawResponse, flatResponse) => {
119
101
  currentRawResponse = rawResponse;
120
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
102
+ providedCallback?.(rawResponse, flatResponse);
103
+ };
104
+ const updatedArgs = {
105
+ ...args,
106
+ options: {
107
+ ...args.options,
108
+ onResponse: callback,
109
+ },
121
110
  };
122
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
123
111
  const flatResponse = await directSendOperation(updatedArgs, spec);
124
112
  return {
125
113
  flatResponse,
@@ -136,8 +124,8 @@ export class VirtualMachineInstancesImpl {
136
124
  spec: createOrUpdateOperationSpec,
137
125
  });
138
126
  const poller = await createHttpPoller(lro, {
139
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
140
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
127
+ restoreFrom: options?.resumeFrom,
128
+ intervalInMs: options?.updateIntervalInMs,
141
129
  resourceLocationConfig: "azure-async-operation",
142
130
  });
143
131
  await poller.poll();
@@ -165,14 +153,19 @@ export class VirtualMachineInstancesImpl {
165
153
  return this.client.sendOperationRequest(args, spec);
166
154
  };
167
155
  const sendOperationFn = async (args, spec) => {
168
- var _a;
169
156
  let currentRawResponse = undefined;
170
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
157
+ const providedCallback = args.options?.onResponse;
171
158
  const callback = (rawResponse, flatResponse) => {
172
159
  currentRawResponse = rawResponse;
173
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
160
+ providedCallback?.(rawResponse, flatResponse);
161
+ };
162
+ const updatedArgs = {
163
+ ...args,
164
+ options: {
165
+ ...args.options,
166
+ onResponse: callback,
167
+ },
174
168
  };
175
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
176
169
  const flatResponse = await directSendOperation(updatedArgs, spec);
177
170
  return {
178
171
  flatResponse,
@@ -189,8 +182,8 @@ export class VirtualMachineInstancesImpl {
189
182
  spec: updateOperationSpec,
190
183
  });
191
184
  const poller = await createHttpPoller(lro, {
192
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
193
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
185
+ restoreFrom: options?.resumeFrom,
186
+ intervalInMs: options?.updateIntervalInMs,
194
187
  resourceLocationConfig: "azure-async-operation",
195
188
  });
196
189
  await poller.poll();
@@ -216,14 +209,19 @@ export class VirtualMachineInstancesImpl {
216
209
  return this.client.sendOperationRequest(args, spec);
217
210
  };
218
211
  const sendOperationFn = async (args, spec) => {
219
- var _a;
220
212
  let currentRawResponse = undefined;
221
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
213
+ const providedCallback = args.options?.onResponse;
222
214
  const callback = (rawResponse, flatResponse) => {
223
215
  currentRawResponse = rawResponse;
224
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
216
+ providedCallback?.(rawResponse, flatResponse);
217
+ };
218
+ const updatedArgs = {
219
+ ...args,
220
+ options: {
221
+ ...args.options,
222
+ onResponse: callback,
223
+ },
225
224
  };
226
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
227
225
  const flatResponse = await directSendOperation(updatedArgs, spec);
228
226
  return {
229
227
  flatResponse,
@@ -240,8 +238,8 @@ export class VirtualMachineInstancesImpl {
240
238
  spec: deleteOperationSpec,
241
239
  });
242
240
  const poller = await createHttpPoller(lro, {
243
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
244
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
241
+ restoreFrom: options?.resumeFrom,
242
+ intervalInMs: options?.updateIntervalInMs,
245
243
  resourceLocationConfig: "azure-async-operation",
246
244
  });
247
245
  await poller.poll();
@@ -267,14 +265,19 @@ export class VirtualMachineInstancesImpl {
267
265
  return this.client.sendOperationRequest(args, spec);
268
266
  };
269
267
  const sendOperationFn = async (args, spec) => {
270
- var _a;
271
268
  let currentRawResponse = undefined;
272
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
269
+ const providedCallback = args.options?.onResponse;
273
270
  const callback = (rawResponse, flatResponse) => {
274
271
  currentRawResponse = rawResponse;
275
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
272
+ providedCallback?.(rawResponse, flatResponse);
273
+ };
274
+ const updatedArgs = {
275
+ ...args,
276
+ options: {
277
+ ...args.options,
278
+ onResponse: callback,
279
+ },
276
280
  };
277
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
278
281
  const flatResponse = await directSendOperation(updatedArgs, spec);
279
282
  return {
280
283
  flatResponse,
@@ -291,8 +294,8 @@ export class VirtualMachineInstancesImpl {
291
294
  spec: createCheckpointOperationSpec,
292
295
  });
293
296
  const poller = await createHttpPoller(lro, {
294
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
295
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
297
+ restoreFrom: options?.resumeFrom,
298
+ intervalInMs: options?.updateIntervalInMs,
296
299
  resourceLocationConfig: "location",
297
300
  });
298
301
  await poller.poll();
@@ -319,14 +322,19 @@ export class VirtualMachineInstancesImpl {
319
322
  return this.client.sendOperationRequest(args, spec);
320
323
  };
321
324
  const sendOperationFn = async (args, spec) => {
322
- var _a;
323
325
  let currentRawResponse = undefined;
324
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
326
+ const providedCallback = args.options?.onResponse;
325
327
  const callback = (rawResponse, flatResponse) => {
326
328
  currentRawResponse = rawResponse;
327
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
329
+ providedCallback?.(rawResponse, flatResponse);
330
+ };
331
+ const updatedArgs = {
332
+ ...args,
333
+ options: {
334
+ ...args.options,
335
+ onResponse: callback,
336
+ },
328
337
  };
329
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
330
338
  const flatResponse = await directSendOperation(updatedArgs, spec);
331
339
  return {
332
340
  flatResponse,
@@ -343,8 +351,8 @@ export class VirtualMachineInstancesImpl {
343
351
  spec: deleteCheckpointOperationSpec,
344
352
  });
345
353
  const poller = await createHttpPoller(lro, {
346
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
347
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
354
+ restoreFrom: options?.resumeFrom,
355
+ intervalInMs: options?.updateIntervalInMs,
348
356
  resourceLocationConfig: "location",
349
357
  });
350
358
  await poller.poll();
@@ -370,14 +378,19 @@ export class VirtualMachineInstancesImpl {
370
378
  return this.client.sendOperationRequest(args, spec);
371
379
  };
372
380
  const sendOperationFn = async (args, spec) => {
373
- var _a;
374
381
  let currentRawResponse = undefined;
375
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
382
+ const providedCallback = args.options?.onResponse;
376
383
  const callback = (rawResponse, flatResponse) => {
377
384
  currentRawResponse = rawResponse;
378
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
385
+ providedCallback?.(rawResponse, flatResponse);
386
+ };
387
+ const updatedArgs = {
388
+ ...args,
389
+ options: {
390
+ ...args.options,
391
+ onResponse: callback,
392
+ },
379
393
  };
380
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
381
394
  const flatResponse = await directSendOperation(updatedArgs, spec);
382
395
  return {
383
396
  flatResponse,
@@ -394,8 +407,8 @@ export class VirtualMachineInstancesImpl {
394
407
  spec: restartOperationSpec,
395
408
  });
396
409
  const poller = await createHttpPoller(lro, {
397
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
398
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
410
+ restoreFrom: options?.resumeFrom,
411
+ intervalInMs: options?.updateIntervalInMs,
399
412
  resourceLocationConfig: "location",
400
413
  });
401
414
  await poller.poll();
@@ -421,14 +434,19 @@ export class VirtualMachineInstancesImpl {
421
434
  return this.client.sendOperationRequest(args, spec);
422
435
  };
423
436
  const sendOperationFn = async (args, spec) => {
424
- var _a;
425
437
  let currentRawResponse = undefined;
426
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
438
+ const providedCallback = args.options?.onResponse;
427
439
  const callback = (rawResponse, flatResponse) => {
428
440
  currentRawResponse = rawResponse;
429
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
441
+ providedCallback?.(rawResponse, flatResponse);
442
+ };
443
+ const updatedArgs = {
444
+ ...args,
445
+ options: {
446
+ ...args.options,
447
+ onResponse: callback,
448
+ },
430
449
  };
431
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
432
450
  const flatResponse = await directSendOperation(updatedArgs, spec);
433
451
  return {
434
452
  flatResponse,
@@ -445,8 +463,8 @@ export class VirtualMachineInstancesImpl {
445
463
  spec: restoreCheckpointOperationSpec,
446
464
  });
447
465
  const poller = await createHttpPoller(lro, {
448
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
449
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
466
+ restoreFrom: options?.resumeFrom,
467
+ intervalInMs: options?.updateIntervalInMs,
450
468
  resourceLocationConfig: "location",
451
469
  });
452
470
  await poller.poll();
@@ -472,14 +490,19 @@ export class VirtualMachineInstancesImpl {
472
490
  return this.client.sendOperationRequest(args, spec);
473
491
  };
474
492
  const sendOperationFn = async (args, spec) => {
475
- var _a;
476
493
  let currentRawResponse = undefined;
477
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
494
+ const providedCallback = args.options?.onResponse;
478
495
  const callback = (rawResponse, flatResponse) => {
479
496
  currentRawResponse = rawResponse;
480
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
497
+ providedCallback?.(rawResponse, flatResponse);
498
+ };
499
+ const updatedArgs = {
500
+ ...args,
501
+ options: {
502
+ ...args.options,
503
+ onResponse: callback,
504
+ },
481
505
  };
482
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
483
506
  const flatResponse = await directSendOperation(updatedArgs, spec);
484
507
  return {
485
508
  flatResponse,
@@ -496,8 +519,8 @@ export class VirtualMachineInstancesImpl {
496
519
  spec: startOperationSpec,
497
520
  });
498
521
  const poller = await createHttpPoller(lro, {
499
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
500
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
522
+ restoreFrom: options?.resumeFrom,
523
+ intervalInMs: options?.updateIntervalInMs,
501
524
  resourceLocationConfig: "location",
502
525
  });
503
526
  await poller.poll();
@@ -523,14 +546,19 @@ export class VirtualMachineInstancesImpl {
523
546
  return this.client.sendOperationRequest(args, spec);
524
547
  };
525
548
  const sendOperationFn = async (args, spec) => {
526
- var _a;
527
549
  let currentRawResponse = undefined;
528
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
550
+ const providedCallback = args.options?.onResponse;
529
551
  const callback = (rawResponse, flatResponse) => {
530
552
  currentRawResponse = rawResponse;
531
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
553
+ providedCallback?.(rawResponse, flatResponse);
554
+ };
555
+ const updatedArgs = {
556
+ ...args,
557
+ options: {
558
+ ...args.options,
559
+ onResponse: callback,
560
+ },
532
561
  };
533
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
534
562
  const flatResponse = await directSendOperation(updatedArgs, spec);
535
563
  return {
536
564
  flatResponse,
@@ -547,8 +575,8 @@ export class VirtualMachineInstancesImpl {
547
575
  spec: stopOperationSpec,
548
576
  });
549
577
  const poller = await createHttpPoller(lro, {
550
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
551
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
578
+ restoreFrom: options?.resumeFrom,
579
+ intervalInMs: options?.updateIntervalInMs,
552
580
  resourceLocationConfig: "location",
553
581
  });
554
582
  await poller.poll();