@azure/arm-networkcloud 1.2.0-alpha.20250718.1 → 1.2.0-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 (195) 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 +648 -314
  4. package/dist/browser/models/mappers.js.map +1 -1
  5. package/dist/browser/networkCloud.js +33 -5
  6. package/dist/browser/networkCloud.js.map +1 -1
  7. package/dist/browser/operations/agentPools.js +56 -58
  8. package/dist/browser/operations/agentPools.js.map +1 -1
  9. package/dist/browser/operations/bareMetalMachineKeySets.js +56 -58
  10. package/dist/browser/operations/bareMetalMachineKeySets.js.map +1 -1
  11. package/dist/browser/operations/bareMetalMachines.js +188 -157
  12. package/dist/browser/operations/bareMetalMachines.js.map +1 -1
  13. package/dist/browser/operations/bmcKeySets.js +56 -58
  14. package/dist/browser/operations/bmcKeySets.js.map +1 -1
  15. package/dist/browser/operations/cloudServicesNetworks.js +78 -97
  16. package/dist/browser/operations/cloudServicesNetworks.js.map +1 -1
  17. package/dist/browser/operations/clusterManagers.js +67 -91
  18. package/dist/browser/operations/clusterManagers.js.map +1 -1
  19. package/dist/browser/operations/clusters.js +122 -121
  20. package/dist/browser/operations/clusters.js.map +1 -1
  21. package/dist/browser/operations/consoles.js +56 -58
  22. package/dist/browser/operations/consoles.js.map +1 -1
  23. package/dist/browser/operations/kubernetesClusterFeatures.js +56 -58
  24. package/dist/browser/operations/kubernetesClusterFeatures.js.map +1 -1
  25. package/dist/browser/operations/kubernetesClusters.js +89 -103
  26. package/dist/browser/operations/kubernetesClusters.js.map +1 -1
  27. package/dist/browser/operations/l2Networks.js +67 -91
  28. package/dist/browser/operations/l2Networks.js.map +1 -1
  29. package/dist/browser/operations/l3Networks.js +67 -91
  30. package/dist/browser/operations/l3Networks.js.map +1 -1
  31. package/dist/browser/operations/metricsConfigurations.js +56 -58
  32. package/dist/browser/operations/metricsConfigurations.js.map +1 -1
  33. package/dist/browser/operations/operations.js +23 -40
  34. package/dist/browser/operations/operations.js.map +1 -1
  35. package/dist/browser/operations/rackSkus.js +23 -40
  36. package/dist/browser/operations/rackSkus.js.map +1 -1
  37. package/dist/browser/operations/racks.js +78 -97
  38. package/dist/browser/operations/racks.js.map +1 -1
  39. package/dist/browser/operations/storageAppliances.js +100 -109
  40. package/dist/browser/operations/storageAppliances.js.map +1 -1
  41. package/dist/browser/operations/trunkedNetworks.js +67 -91
  42. package/dist/browser/operations/trunkedNetworks.js.map +1 -1
  43. package/dist/browser/operations/virtualMachines.js +122 -121
  44. package/dist/browser/operations/virtualMachines.js.map +1 -1
  45. package/dist/browser/operations/volumes.js +67 -91
  46. package/dist/browser/operations/volumes.js.map +1 -1
  47. package/dist/browser/pagingHelper.js +2 -4
  48. package/dist/browser/pagingHelper.js.map +1 -1
  49. package/dist/commonjs/lroImpl.js +7 -3
  50. package/dist/commonjs/lroImpl.js.map +1 -1
  51. package/dist/commonjs/models/mappers.js +648 -314
  52. package/dist/commonjs/models/mappers.js.map +1 -1
  53. package/dist/commonjs/networkCloud.js +33 -5
  54. package/dist/commonjs/networkCloud.js.map +1 -1
  55. package/dist/commonjs/operations/agentPools.js +56 -57
  56. package/dist/commonjs/operations/agentPools.js.map +1 -1
  57. package/dist/commonjs/operations/bareMetalMachineKeySets.js +56 -57
  58. package/dist/commonjs/operations/bareMetalMachineKeySets.js.map +1 -1
  59. package/dist/commonjs/operations/bareMetalMachines.js +188 -156
  60. package/dist/commonjs/operations/bareMetalMachines.js.map +1 -1
  61. package/dist/commonjs/operations/bmcKeySets.js +56 -57
  62. package/dist/commonjs/operations/bmcKeySets.js.map +1 -1
  63. package/dist/commonjs/operations/cloudServicesNetworks.js +78 -96
  64. package/dist/commonjs/operations/cloudServicesNetworks.js.map +1 -1
  65. package/dist/commonjs/operations/clusterManagers.js +67 -90
  66. package/dist/commonjs/operations/clusterManagers.js.map +1 -1
  67. package/dist/commonjs/operations/clusters.js +122 -120
  68. package/dist/commonjs/operations/clusters.js.map +1 -1
  69. package/dist/commonjs/operations/consoles.js +56 -57
  70. package/dist/commonjs/operations/consoles.js.map +1 -1
  71. package/dist/commonjs/operations/kubernetesClusterFeatures.js +56 -57
  72. package/dist/commonjs/operations/kubernetesClusterFeatures.js.map +1 -1
  73. package/dist/commonjs/operations/kubernetesClusters.js +89 -102
  74. package/dist/commonjs/operations/kubernetesClusters.js.map +1 -1
  75. package/dist/commonjs/operations/l2Networks.js +67 -90
  76. package/dist/commonjs/operations/l2Networks.js.map +1 -1
  77. package/dist/commonjs/operations/l3Networks.js +67 -90
  78. package/dist/commonjs/operations/l3Networks.js.map +1 -1
  79. package/dist/commonjs/operations/metricsConfigurations.js +56 -57
  80. package/dist/commonjs/operations/metricsConfigurations.js.map +1 -1
  81. package/dist/commonjs/operations/operations.js +23 -39
  82. package/dist/commonjs/operations/operations.js.map +1 -1
  83. package/dist/commonjs/operations/rackSkus.js +23 -39
  84. package/dist/commonjs/operations/rackSkus.js.map +1 -1
  85. package/dist/commonjs/operations/racks.js +78 -96
  86. package/dist/commonjs/operations/racks.js.map +1 -1
  87. package/dist/commonjs/operations/storageAppliances.js +100 -108
  88. package/dist/commonjs/operations/storageAppliances.js.map +1 -1
  89. package/dist/commonjs/operations/trunkedNetworks.js +67 -90
  90. package/dist/commonjs/operations/trunkedNetworks.js.map +1 -1
  91. package/dist/commonjs/operations/virtualMachines.js +122 -120
  92. package/dist/commonjs/operations/virtualMachines.js.map +1 -1
  93. package/dist/commonjs/operations/volumes.js +67 -90
  94. package/dist/commonjs/operations/volumes.js.map +1 -1
  95. package/dist/commonjs/pagingHelper.js +2 -4
  96. package/dist/commonjs/pagingHelper.js.map +1 -1
  97. package/dist/commonjs/tsdoc-metadata.json +11 -11
  98. package/dist/esm/lroImpl.js +7 -3
  99. package/dist/esm/lroImpl.js.map +1 -1
  100. package/dist/esm/models/mappers.js +648 -314
  101. package/dist/esm/models/mappers.js.map +1 -1
  102. package/dist/esm/networkCloud.js +33 -5
  103. package/dist/esm/networkCloud.js.map +1 -1
  104. package/dist/esm/operations/agentPools.js +56 -58
  105. package/dist/esm/operations/agentPools.js.map +1 -1
  106. package/dist/esm/operations/bareMetalMachineKeySets.js +56 -58
  107. package/dist/esm/operations/bareMetalMachineKeySets.js.map +1 -1
  108. package/dist/esm/operations/bareMetalMachines.js +188 -157
  109. package/dist/esm/operations/bareMetalMachines.js.map +1 -1
  110. package/dist/esm/operations/bmcKeySets.js +56 -58
  111. package/dist/esm/operations/bmcKeySets.js.map +1 -1
  112. package/dist/esm/operations/cloudServicesNetworks.js +78 -97
  113. package/dist/esm/operations/cloudServicesNetworks.js.map +1 -1
  114. package/dist/esm/operations/clusterManagers.js +67 -91
  115. package/dist/esm/operations/clusterManagers.js.map +1 -1
  116. package/dist/esm/operations/clusters.js +122 -121
  117. package/dist/esm/operations/clusters.js.map +1 -1
  118. package/dist/esm/operations/consoles.js +56 -58
  119. package/dist/esm/operations/consoles.js.map +1 -1
  120. package/dist/esm/operations/kubernetesClusterFeatures.js +56 -58
  121. package/dist/esm/operations/kubernetesClusterFeatures.js.map +1 -1
  122. package/dist/esm/operations/kubernetesClusters.js +89 -103
  123. package/dist/esm/operations/kubernetesClusters.js.map +1 -1
  124. package/dist/esm/operations/l2Networks.js +67 -91
  125. package/dist/esm/operations/l2Networks.js.map +1 -1
  126. package/dist/esm/operations/l3Networks.js +67 -91
  127. package/dist/esm/operations/l3Networks.js.map +1 -1
  128. package/dist/esm/operations/metricsConfigurations.js +56 -58
  129. package/dist/esm/operations/metricsConfigurations.js.map +1 -1
  130. package/dist/esm/operations/operations.js +23 -40
  131. package/dist/esm/operations/operations.js.map +1 -1
  132. package/dist/esm/operations/rackSkus.js +23 -40
  133. package/dist/esm/operations/rackSkus.js.map +1 -1
  134. package/dist/esm/operations/racks.js +78 -97
  135. package/dist/esm/operations/racks.js.map +1 -1
  136. package/dist/esm/operations/storageAppliances.js +100 -109
  137. package/dist/esm/operations/storageAppliances.js.map +1 -1
  138. package/dist/esm/operations/trunkedNetworks.js +67 -91
  139. package/dist/esm/operations/trunkedNetworks.js.map +1 -1
  140. package/dist/esm/operations/virtualMachines.js +122 -121
  141. package/dist/esm/operations/virtualMachines.js.map +1 -1
  142. package/dist/esm/operations/volumes.js +67 -91
  143. package/dist/esm/operations/volumes.js.map +1 -1
  144. package/dist/esm/pagingHelper.js +2 -4
  145. package/dist/esm/pagingHelper.js.map +1 -1
  146. package/dist/react-native/lroImpl.js +7 -3
  147. package/dist/react-native/lroImpl.js.map +1 -1
  148. package/dist/react-native/models/mappers.js +648 -314
  149. package/dist/react-native/models/mappers.js.map +1 -1
  150. package/dist/react-native/networkCloud.js +33 -5
  151. package/dist/react-native/networkCloud.js.map +1 -1
  152. package/dist/react-native/operations/agentPools.js +56 -58
  153. package/dist/react-native/operations/agentPools.js.map +1 -1
  154. package/dist/react-native/operations/bareMetalMachineKeySets.js +56 -58
  155. package/dist/react-native/operations/bareMetalMachineKeySets.js.map +1 -1
  156. package/dist/react-native/operations/bareMetalMachines.js +188 -157
  157. package/dist/react-native/operations/bareMetalMachines.js.map +1 -1
  158. package/dist/react-native/operations/bmcKeySets.js +56 -58
  159. package/dist/react-native/operations/bmcKeySets.js.map +1 -1
  160. package/dist/react-native/operations/cloudServicesNetworks.js +78 -97
  161. package/dist/react-native/operations/cloudServicesNetworks.js.map +1 -1
  162. package/dist/react-native/operations/clusterManagers.js +67 -91
  163. package/dist/react-native/operations/clusterManagers.js.map +1 -1
  164. package/dist/react-native/operations/clusters.js +122 -121
  165. package/dist/react-native/operations/clusters.js.map +1 -1
  166. package/dist/react-native/operations/consoles.js +56 -58
  167. package/dist/react-native/operations/consoles.js.map +1 -1
  168. package/dist/react-native/operations/kubernetesClusterFeatures.js +56 -58
  169. package/dist/react-native/operations/kubernetesClusterFeatures.js.map +1 -1
  170. package/dist/react-native/operations/kubernetesClusters.js +89 -103
  171. package/dist/react-native/operations/kubernetesClusters.js.map +1 -1
  172. package/dist/react-native/operations/l2Networks.js +67 -91
  173. package/dist/react-native/operations/l2Networks.js.map +1 -1
  174. package/dist/react-native/operations/l3Networks.js +67 -91
  175. package/dist/react-native/operations/l3Networks.js.map +1 -1
  176. package/dist/react-native/operations/metricsConfigurations.js +56 -58
  177. package/dist/react-native/operations/metricsConfigurations.js.map +1 -1
  178. package/dist/react-native/operations/operations.js +23 -40
  179. package/dist/react-native/operations/operations.js.map +1 -1
  180. package/dist/react-native/operations/rackSkus.js +23 -40
  181. package/dist/react-native/operations/rackSkus.js.map +1 -1
  182. package/dist/react-native/operations/racks.js +78 -97
  183. package/dist/react-native/operations/racks.js.map +1 -1
  184. package/dist/react-native/operations/storageAppliances.js +100 -109
  185. package/dist/react-native/operations/storageAppliances.js.map +1 -1
  186. package/dist/react-native/operations/trunkedNetworks.js +67 -91
  187. package/dist/react-native/operations/trunkedNetworks.js.map +1 -1
  188. package/dist/react-native/operations/virtualMachines.js +122 -121
  189. package/dist/react-native/operations/virtualMachines.js.map +1 -1
  190. package/dist/react-native/operations/volumes.js +67 -91
  191. package/dist/react-native/operations/volumes.js.map +1 -1
  192. package/dist/react-native/pagingHelper.js +2 -4
  193. package/dist/react-native/pagingHelper.js.map +1 -1
  194. package/package.json +2 -2
  195. package/review/arm-networkcloud-node.api.md +4516 -4516
@@ -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 VirtualMachines operations. */
17
16
  export class VirtualMachinesImpl {
17
+ client;
18
18
  /**
19
19
  * Initialize a new instance of the class VirtualMachines class.
20
20
  * @param client Reference to the service client
@@ -36,52 +36,35 @@ export class VirtualMachinesImpl {
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 virtual machines in the provided resource group.
@@ -98,52 +81,35 @@ export class VirtualMachinesImpl {
98
81
  return this;
99
82
  },
100
83
  byPage: (settings) => {
101
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
84
+ if (settings?.maxPageSize) {
102
85
  throw new Error("maxPageSize is not supported by this operation.");
103
86
  }
104
87
  return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
105
88
  },
106
89
  };
107
90
  }
108
- listByResourceGroupPagingPage(resourceGroupName, options, settings) {
109
- return __asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
110
- let result;
111
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
112
- if (!continuationToken) {
113
- result = yield __await(this._listByResourceGroup(resourceGroupName, options));
114
- let page = result.value || [];
115
- continuationToken = result.nextLink;
116
- setContinuationToken(page, continuationToken);
117
- yield yield __await(page);
118
- }
119
- while (continuationToken) {
120
- result = yield __await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
121
- continuationToken = result.nextLink;
122
- let page = result.value || [];
123
- setContinuationToken(page, continuationToken);
124
- yield yield __await(page);
125
- }
126
- });
91
+ async *listByResourceGroupPagingPage(resourceGroupName, options, settings) {
92
+ let result;
93
+ let continuationToken = settings?.continuationToken;
94
+ if (!continuationToken) {
95
+ result = await this._listByResourceGroup(resourceGroupName, options);
96
+ let page = result.value || [];
97
+ continuationToken = result.nextLink;
98
+ setContinuationToken(page, continuationToken);
99
+ yield page;
100
+ }
101
+ while (continuationToken) {
102
+ result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options);
103
+ continuationToken = result.nextLink;
104
+ let page = result.value || [];
105
+ setContinuationToken(page, continuationToken);
106
+ yield page;
107
+ }
127
108
  }
128
- listByResourceGroupPagingAll(resourceGroupName, options) {
129
- return __asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
130
- var _a, e_2, _b, _c;
131
- try {
132
- for (var _d = true, _e = __asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
133
- _c = _f.value;
134
- _d = false;
135
- const page = _c;
136
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
137
- }
138
- }
139
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
140
- finally {
141
- try {
142
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
143
- }
144
- finally { if (e_2) throw e_2.error; }
145
- }
146
- });
109
+ async *listByResourceGroupPagingAll(resourceGroupName, options) {
110
+ for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
111
+ yield* page;
112
+ }
147
113
  }
148
114
  /**
149
115
  * Get a list of virtual machines in the provided subscription.
@@ -181,14 +147,19 @@ export class VirtualMachinesImpl {
181
147
  return this.client.sendOperationRequest(args, spec);
182
148
  };
183
149
  const sendOperationFn = async (args, spec) => {
184
- var _a;
185
150
  let currentRawResponse = undefined;
186
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
151
+ const providedCallback = args.options?.onResponse;
187
152
  const callback = (rawResponse, flatResponse) => {
188
153
  currentRawResponse = rawResponse;
189
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
154
+ providedCallback?.(rawResponse, flatResponse);
155
+ };
156
+ const updatedArgs = {
157
+ ...args,
158
+ options: {
159
+ ...args.options,
160
+ onResponse: callback,
161
+ },
190
162
  };
191
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
192
163
  const flatResponse = await directSendOperation(updatedArgs, spec);
193
164
  return {
194
165
  flatResponse,
@@ -210,8 +181,8 @@ export class VirtualMachinesImpl {
210
181
  spec: createOrUpdateOperationSpec,
211
182
  });
212
183
  const poller = await createHttpPoller(lro, {
213
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
214
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
184
+ restoreFrom: options?.resumeFrom,
185
+ intervalInMs: options?.updateIntervalInMs,
215
186
  resourceLocationConfig: "azure-async-operation",
216
187
  });
217
188
  await poller.poll();
@@ -239,14 +210,19 @@ export class VirtualMachinesImpl {
239
210
  return this.client.sendOperationRequest(args, spec);
240
211
  };
241
212
  const sendOperationFn = async (args, spec) => {
242
- var _a;
243
213
  let currentRawResponse = undefined;
244
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
214
+ const providedCallback = args.options?.onResponse;
245
215
  const callback = (rawResponse, flatResponse) => {
246
216
  currentRawResponse = rawResponse;
247
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
217
+ providedCallback?.(rawResponse, flatResponse);
218
+ };
219
+ const updatedArgs = {
220
+ ...args,
221
+ options: {
222
+ ...args.options,
223
+ onResponse: callback,
224
+ },
248
225
  };
249
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
250
226
  const flatResponse = await directSendOperation(updatedArgs, spec);
251
227
  return {
252
228
  flatResponse,
@@ -263,8 +239,8 @@ export class VirtualMachinesImpl {
263
239
  spec: deleteOperationSpec,
264
240
  });
265
241
  const poller = await createHttpPoller(lro, {
266
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
267
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
242
+ restoreFrom: options?.resumeFrom,
243
+ intervalInMs: options?.updateIntervalInMs,
268
244
  resourceLocationConfig: "location",
269
245
  });
270
246
  await poller.poll();
@@ -292,14 +268,19 @@ export class VirtualMachinesImpl {
292
268
  return this.client.sendOperationRequest(args, spec);
293
269
  };
294
270
  const sendOperationFn = async (args, spec) => {
295
- var _a;
296
271
  let currentRawResponse = undefined;
297
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
272
+ const providedCallback = args.options?.onResponse;
298
273
  const callback = (rawResponse, flatResponse) => {
299
274
  currentRawResponse = rawResponse;
300
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
275
+ providedCallback?.(rawResponse, flatResponse);
276
+ };
277
+ const updatedArgs = {
278
+ ...args,
279
+ options: {
280
+ ...args.options,
281
+ onResponse: callback,
282
+ },
301
283
  };
302
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
303
284
  const flatResponse = await directSendOperation(updatedArgs, spec);
304
285
  return {
305
286
  flatResponse,
@@ -316,8 +297,8 @@ export class VirtualMachinesImpl {
316
297
  spec: updateOperationSpec,
317
298
  });
318
299
  const poller = await createHttpPoller(lro, {
319
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
320
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
300
+ restoreFrom: options?.resumeFrom,
301
+ intervalInMs: options?.updateIntervalInMs,
321
302
  resourceLocationConfig: "azure-async-operation",
322
303
  });
323
304
  await poller.poll();
@@ -345,14 +326,19 @@ export class VirtualMachinesImpl {
345
326
  return this.client.sendOperationRequest(args, spec);
346
327
  };
347
328
  const sendOperationFn = async (args, spec) => {
348
- var _a;
349
329
  let currentRawResponse = undefined;
350
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
330
+ const providedCallback = args.options?.onResponse;
351
331
  const callback = (rawResponse, flatResponse) => {
352
332
  currentRawResponse = rawResponse;
353
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
333
+ providedCallback?.(rawResponse, flatResponse);
334
+ };
335
+ const updatedArgs = {
336
+ ...args,
337
+ options: {
338
+ ...args.options,
339
+ onResponse: callback,
340
+ },
354
341
  };
355
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
356
342
  const flatResponse = await directSendOperation(updatedArgs, spec);
357
343
  return {
358
344
  flatResponse,
@@ -369,8 +355,8 @@ export class VirtualMachinesImpl {
369
355
  spec: powerOffOperationSpec,
370
356
  });
371
357
  const poller = await createHttpPoller(lro, {
372
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
373
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
358
+ restoreFrom: options?.resumeFrom,
359
+ intervalInMs: options?.updateIntervalInMs,
374
360
  resourceLocationConfig: "location",
375
361
  });
376
362
  await poller.poll();
@@ -397,14 +383,19 @@ export class VirtualMachinesImpl {
397
383
  return this.client.sendOperationRequest(args, spec);
398
384
  };
399
385
  const sendOperationFn = async (args, spec) => {
400
- var _a;
401
386
  let currentRawResponse = undefined;
402
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
387
+ const providedCallback = args.options?.onResponse;
403
388
  const callback = (rawResponse, flatResponse) => {
404
389
  currentRawResponse = rawResponse;
405
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
390
+ providedCallback?.(rawResponse, flatResponse);
391
+ };
392
+ const updatedArgs = {
393
+ ...args,
394
+ options: {
395
+ ...args.options,
396
+ onResponse: callback,
397
+ },
406
398
  };
407
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
408
399
  const flatResponse = await directSendOperation(updatedArgs, spec);
409
400
  return {
410
401
  flatResponse,
@@ -421,8 +412,8 @@ export class VirtualMachinesImpl {
421
412
  spec: reimageOperationSpec,
422
413
  });
423
414
  const poller = await createHttpPoller(lro, {
424
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
425
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
415
+ restoreFrom: options?.resumeFrom,
416
+ intervalInMs: options?.updateIntervalInMs,
426
417
  resourceLocationConfig: "location",
427
418
  });
428
419
  await poller.poll();
@@ -449,14 +440,19 @@ export class VirtualMachinesImpl {
449
440
  return this.client.sendOperationRequest(args, spec);
450
441
  };
451
442
  const sendOperationFn = async (args, spec) => {
452
- var _a;
453
443
  let currentRawResponse = undefined;
454
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
444
+ const providedCallback = args.options?.onResponse;
455
445
  const callback = (rawResponse, flatResponse) => {
456
446
  currentRawResponse = rawResponse;
457
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
447
+ providedCallback?.(rawResponse, flatResponse);
448
+ };
449
+ const updatedArgs = {
450
+ ...args,
451
+ options: {
452
+ ...args.options,
453
+ onResponse: callback,
454
+ },
458
455
  };
459
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
460
456
  const flatResponse = await directSendOperation(updatedArgs, spec);
461
457
  return {
462
458
  flatResponse,
@@ -473,8 +469,8 @@ export class VirtualMachinesImpl {
473
469
  spec: restartOperationSpec,
474
470
  });
475
471
  const poller = await createHttpPoller(lro, {
476
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
477
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
472
+ restoreFrom: options?.resumeFrom,
473
+ intervalInMs: options?.updateIntervalInMs,
478
474
  resourceLocationConfig: "location",
479
475
  });
480
476
  await poller.poll();
@@ -501,14 +497,19 @@ export class VirtualMachinesImpl {
501
497
  return this.client.sendOperationRequest(args, spec);
502
498
  };
503
499
  const sendOperationFn = async (args, spec) => {
504
- var _a;
505
500
  let currentRawResponse = undefined;
506
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
501
+ const providedCallback = args.options?.onResponse;
507
502
  const callback = (rawResponse, flatResponse) => {
508
503
  currentRawResponse = rawResponse;
509
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
504
+ providedCallback?.(rawResponse, flatResponse);
505
+ };
506
+ const updatedArgs = {
507
+ ...args,
508
+ options: {
509
+ ...args.options,
510
+ onResponse: callback,
511
+ },
510
512
  };
511
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
512
513
  const flatResponse = await directSendOperation(updatedArgs, spec);
513
514
  return {
514
515
  flatResponse,
@@ -525,8 +526,8 @@ export class VirtualMachinesImpl {
525
526
  spec: startOperationSpec,
526
527
  });
527
528
  const poller = await createHttpPoller(lro, {
528
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
529
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
529
+ restoreFrom: options?.resumeFrom,
530
+ intervalInMs: options?.updateIntervalInMs,
530
531
  resourceLocationConfig: "location",
531
532
  });
532
533
  await poller.poll();