@azure/arm-sqlvirtualmachine 5.0.0-beta.6 → 5.0.0-beta.8

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 (187) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/index.js +1065 -306
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js +98 -0
  11. package/dist-esm/samples-dev/availabilityGroupListenersCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js +40 -0
  15. package/dist-esm/samples-dev/availabilityGroupListenersDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js +40 -0
  19. package/dist-esm/samples-dev/availabilityGroupListenersGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js +60 -0
  23. package/dist-esm/samples-dev/availabilityGroupListenersListByGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/operationsListSample.js +58 -0
  27. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  28. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js +55 -0
  31. package/dist-esm/samples-dev/sqlVirtualMachineGroupsCreateOrUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js +39 -0
  35. package/dist-esm/samples-dev/sqlVirtualMachineGroupsDeleteSample.js.map +1 -0
  36. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js +39 -0
  39. package/dist-esm/samples-dev/sqlVirtualMachineGroupsGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js +59 -0
  43. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListByResourceGroupSample.js.map +1 -0
  44. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js +58 -0
  47. package/dist-esm/samples-dev/sqlVirtualMachineGroupsListSample.js.map +1 -0
  48. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js +40 -0
  51. package/dist-esm/samples-dev/sqlVirtualMachineGroupsUpdateSample.js.map +1 -0
  52. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js +45 -0
  55. package/dist-esm/samples-dev/sqlVirtualMachineTroubleshootSample.js.map +1 -0
  56. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js +290 -0
  59. package/dist-esm/samples-dev/sqlVirtualMachinesCreateOrUpdateSample.js.map +1 -0
  60. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js +39 -0
  63. package/dist-esm/samples-dev/sqlVirtualMachinesDeleteSample.js.map +1 -0
  64. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js +39 -0
  67. package/dist-esm/samples-dev/sqlVirtualMachinesGetSample.js.map +1 -0
  68. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.d.ts +2 -0
  69. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js +59 -0
  71. package/dist-esm/samples-dev/sqlVirtualMachinesListByResourceGroupSample.js.map +1 -0
  72. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.d.ts +2 -0
  73. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js +60 -0
  75. package/dist-esm/samples-dev/sqlVirtualMachinesListBySqlVMGroupSample.js.map +1 -0
  76. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.d.ts +2 -0
  77. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js +58 -0
  79. package/dist-esm/samples-dev/sqlVirtualMachinesListSample.js.map +1 -0
  80. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.d.ts +2 -0
  81. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.d.ts.map +1 -0
  82. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js +39 -0
  83. package/dist-esm/samples-dev/sqlVirtualMachinesRedeploySample.js.map +1 -0
  84. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.d.ts +2 -0
  85. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.d.ts.map +1 -0
  86. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js +39 -0
  87. package/dist-esm/samples-dev/sqlVirtualMachinesStartAssessmentSample.js.map +1 -0
  88. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.d.ts +2 -0
  89. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.d.ts.map +1 -0
  90. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js +40 -0
  91. package/dist-esm/samples-dev/sqlVirtualMachinesUpdateSample.js.map +1 -0
  92. package/dist-esm/src/index.d.ts +1 -0
  93. package/dist-esm/src/index.d.ts.map +1 -1
  94. package/dist-esm/src/index.js +1 -0
  95. package/dist-esm/src/index.js.map +1 -1
  96. package/dist-esm/src/lroImpl.d.ts +6 -11
  97. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  98. package/dist-esm/src/lroImpl.js +12 -20
  99. package/dist-esm/src/lroImpl.js.map +1 -1
  100. package/dist-esm/src/models/index.d.ts +234 -68
  101. package/dist-esm/src/models/index.d.ts.map +1 -1
  102. package/dist-esm/src/models/index.js +8 -0
  103. package/dist-esm/src/models/index.js.map +1 -1
  104. package/dist-esm/src/models/mappers.d.ts +14 -0
  105. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  106. package/dist-esm/src/models/mappers.js +325 -0
  107. package/dist-esm/src/models/mappers.js.map +1 -1
  108. package/dist-esm/src/models/parameters.d.ts +1 -0
  109. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  110. package/dist-esm/src/models/parameters.js +11 -2
  111. package/dist-esm/src/models/parameters.js.map +1 -1
  112. package/dist-esm/src/operations/availabilityGroupListeners.d.ts +3 -3
  113. package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -1
  114. package/dist-esm/src/operations/availabilityGroupListeners.js +86 -41
  115. package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -1
  116. package/dist-esm/src/operations/index.d.ts +1 -0
  117. package/dist-esm/src/operations/index.d.ts.map +1 -1
  118. package/dist-esm/src/operations/index.js +1 -0
  119. package/dist-esm/src/operations/index.js.map +1 -1
  120. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  121. package/dist-esm/src/operations/operations.js +37 -15
  122. package/dist-esm/src/operations/operations.js.map +1 -1
  123. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts +4 -4
  124. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -1
  125. package/dist-esm/src/operations/sqlVirtualMachineGroups.js +134 -51
  126. package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -1
  127. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts +32 -0
  128. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
  129. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js +118 -0
  130. package/dist-esm/src/operations/sqlVirtualMachineTroubleshoot.js.map +1 -0
  131. package/dist-esm/src/operations/sqlVirtualMachines.d.ts +29 -29
  132. package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -1
  133. package/dist-esm/src/operations/sqlVirtualMachines.js +270 -148
  134. package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -1
  135. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts +3 -3
  136. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts.map +1 -1
  137. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  138. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  139. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  140. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  141. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts +4 -4
  142. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +1 -1
  143. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +24 -0
  144. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +1 -0
  145. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +9 -0
  146. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +1 -0
  147. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +26 -26
  148. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -1
  149. package/dist-esm/src/pagingHelper.d.ts +13 -0
  150. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  151. package/dist-esm/src/pagingHelper.js +32 -0
  152. package/dist-esm/src/pagingHelper.js.map +1 -0
  153. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts +2 -1
  154. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -1
  155. package/dist-esm/src/sqlVirtualMachineManagementClient.js +7 -9
  156. package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -1
  157. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts +4 -0
  158. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.d.ts.map +1 -0
  159. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js +78 -0
  160. package/dist-esm/test/sqlvirtualmachine_operations_test.spec.js.map +1 -0
  161. package/package.json +22 -12
  162. package/review/arm-sqlvirtualmachine.api.md +134 -13
  163. package/src/index.ts +1 -0
  164. package/src/lroImpl.ts +31 -23
  165. package/src/models/index.ts +210 -25
  166. package/src/models/mappers.ts +340 -0
  167. package/src/models/parameters.ts +15 -2
  168. package/src/operations/availabilityGroupListeners.ts +81 -42
  169. package/src/operations/index.ts +1 -0
  170. package/src/operations/operations.ts +27 -11
  171. package/src/operations/sqlVirtualMachineGroups.ts +134 -61
  172. package/src/operations/sqlVirtualMachineTroubleshoot.ts +172 -0
  173. package/src/operations/sqlVirtualMachines.ts +312 -213
  174. package/src/operationsInterfaces/availabilityGroupListeners.ts +4 -4
  175. package/src/operationsInterfaces/index.ts +1 -0
  176. package/src/operationsInterfaces/sqlVirtualMachineGroups.ts +6 -6
  177. package/src/operationsInterfaces/sqlVirtualMachineTroubleshoot.ts +51 -0
  178. package/src/operationsInterfaces/sqlVirtualMachines.ts +57 -57
  179. package/src/pagingHelper.ts +39 -0
  180. package/src/sqlVirtualMachineManagementClient.ts +14 -9
  181. package/tsconfig.json +8 -2
  182. package/types/arm-sqlvirtualmachine.d.ts +254 -38
  183. package/types/tsdoc-metadata.json +1 -1
  184. package/dist-esm/test/sampleTest.d.ts +0 -2
  185. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  186. package/dist-esm/test/sampleTest.js +0 -38
  187. package/dist-esm/test/sampleTest.js.map +0 -1
package/dist/index.js CHANGED
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
28
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
29
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
30
 
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
31
63
  /*
32
64
  * Copyright (c) Microsoft Corporation.
33
65
  * Licensed under the MIT License.
@@ -156,6 +188,8 @@ exports.KnownLeastPrivilegeMode = void 0;
156
188
  (function (KnownLeastPrivilegeMode) {
157
189
  /** Enabled */
158
190
  KnownLeastPrivilegeMode["Enabled"] = "Enabled";
191
+ /** NotSet */
192
+ KnownLeastPrivilegeMode["NotSet"] = "NotSet";
159
193
  })(exports.KnownLeastPrivilegeMode || (exports.KnownLeastPrivilegeMode = {}));
160
194
  /** Known values of {@link SqlImageSku} that the service accepts. */
161
195
  exports.KnownSqlImageSku = void 0;
@@ -245,6 +279,12 @@ exports.KnownStorageWorkloadType = void 0;
245
279
  /** DW */
246
280
  KnownStorageWorkloadType["DW"] = "DW";
247
281
  })(exports.KnownStorageWorkloadType || (exports.KnownStorageWorkloadType = {}));
282
+ /** Known values of {@link TroubleshootingScenario} that the service accepts. */
283
+ exports.KnownTroubleshootingScenario = void 0;
284
+ (function (KnownTroubleshootingScenario) {
285
+ /** UnhealthyReplica */
286
+ KnownTroubleshootingScenario["UnhealthyReplica"] = "UnhealthyReplica";
287
+ })(exports.KnownTroubleshootingScenario || (exports.KnownTroubleshootingScenario = {}));
248
288
 
249
289
  /*
250
290
  * Copyright (c) Microsoft Corporation.
@@ -470,6 +510,99 @@ const Resource = {
470
510
  }
471
511
  }
472
512
  };
513
+ const ErrorResponse = {
514
+ type: {
515
+ name: "Composite",
516
+ className: "ErrorResponse",
517
+ modelProperties: {
518
+ error: {
519
+ serializedName: "error",
520
+ type: {
521
+ name: "Composite",
522
+ className: "ErrorDetail"
523
+ }
524
+ }
525
+ }
526
+ }
527
+ };
528
+ const ErrorDetail = {
529
+ type: {
530
+ name: "Composite",
531
+ className: "ErrorDetail",
532
+ modelProperties: {
533
+ code: {
534
+ serializedName: "code",
535
+ readOnly: true,
536
+ type: {
537
+ name: "String"
538
+ }
539
+ },
540
+ message: {
541
+ serializedName: "message",
542
+ readOnly: true,
543
+ type: {
544
+ name: "String"
545
+ }
546
+ },
547
+ target: {
548
+ serializedName: "target",
549
+ readOnly: true,
550
+ type: {
551
+ name: "String"
552
+ }
553
+ },
554
+ details: {
555
+ serializedName: "details",
556
+ readOnly: true,
557
+ type: {
558
+ name: "Sequence",
559
+ element: {
560
+ type: {
561
+ name: "Composite",
562
+ className: "ErrorDetail"
563
+ }
564
+ }
565
+ }
566
+ },
567
+ additionalInfo: {
568
+ serializedName: "additionalInfo",
569
+ readOnly: true,
570
+ type: {
571
+ name: "Sequence",
572
+ element: {
573
+ type: {
574
+ name: "Composite",
575
+ className: "ErrorAdditionalInfo"
576
+ }
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+ };
583
+ const ErrorAdditionalInfo = {
584
+ type: {
585
+ name: "Composite",
586
+ className: "ErrorAdditionalInfo",
587
+ modelProperties: {
588
+ type: {
589
+ serializedName: "type",
590
+ readOnly: true,
591
+ type: {
592
+ name: "String"
593
+ }
594
+ },
595
+ info: {
596
+ serializedName: "info",
597
+ readOnly: true,
598
+ type: {
599
+ name: "Dictionary",
600
+ value: { type: { name: "any" } }
601
+ }
602
+ }
603
+ }
604
+ }
605
+ };
473
606
  const AvailabilityGroupListenerListResult = {
474
607
  type: {
475
608
  name: "Composite",
@@ -1004,6 +1137,13 @@ const ServerConfigurationsManagementSettings = {
1004
1137
  name: "Composite",
1005
1138
  className: "SQLInstanceSettings"
1006
1139
  }
1140
+ },
1141
+ azureAdAuthenticationSettings: {
1142
+ serializedName: "azureAdAuthenticationSettings",
1143
+ type: {
1144
+ name: "Composite",
1145
+ className: "AADAuthenticationSettings"
1146
+ }
1007
1147
  }
1008
1148
  }
1009
1149
  }
@@ -1144,6 +1284,20 @@ const SQLInstanceSettings = {
1144
1284
  }
1145
1285
  }
1146
1286
  };
1287
+ const AADAuthenticationSettings = {
1288
+ type: {
1289
+ name: "Composite",
1290
+ className: "AADAuthenticationSettings",
1291
+ modelProperties: {
1292
+ clientId: {
1293
+ serializedName: "clientId",
1294
+ type: {
1295
+ name: "String"
1296
+ }
1297
+ }
1298
+ }
1299
+ }
1300
+ };
1147
1301
  const StorageConfigurationSettings = {
1148
1302
  type: {
1149
1303
  name: "Composite",
@@ -1283,6 +1437,85 @@ const SQLTempDbSettings = {
1283
1437
  }
1284
1438
  }
1285
1439
  };
1440
+ const TroubleshootingStatus = {
1441
+ type: {
1442
+ name: "Composite",
1443
+ className: "TroubleshootingStatus",
1444
+ modelProperties: {
1445
+ rootCause: {
1446
+ serializedName: "rootCause",
1447
+ readOnly: true,
1448
+ type: {
1449
+ name: "String"
1450
+ }
1451
+ },
1452
+ lastTriggerTimeUtc: {
1453
+ serializedName: "lastTriggerTimeUtc",
1454
+ readOnly: true,
1455
+ type: {
1456
+ name: "DateTime"
1457
+ }
1458
+ },
1459
+ startTimeUtc: {
1460
+ serializedName: "startTimeUtc",
1461
+ readOnly: true,
1462
+ type: {
1463
+ name: "DateTime"
1464
+ }
1465
+ },
1466
+ endTimeUtc: {
1467
+ serializedName: "endTimeUtc",
1468
+ readOnly: true,
1469
+ type: {
1470
+ name: "DateTime"
1471
+ }
1472
+ },
1473
+ troubleshootingScenario: {
1474
+ serializedName: "troubleshootingScenario",
1475
+ readOnly: true,
1476
+ type: {
1477
+ name: "String"
1478
+ }
1479
+ },
1480
+ properties: {
1481
+ serializedName: "properties",
1482
+ type: {
1483
+ name: "Composite",
1484
+ className: "TroubleshootingAdditionalProperties"
1485
+ }
1486
+ }
1487
+ }
1488
+ }
1489
+ };
1490
+ const TroubleshootingAdditionalProperties = {
1491
+ type: {
1492
+ name: "Composite",
1493
+ className: "TroubleshootingAdditionalProperties",
1494
+ modelProperties: {
1495
+ unhealthyReplicaInfo: {
1496
+ serializedName: "unhealthyReplicaInfo",
1497
+ type: {
1498
+ name: "Composite",
1499
+ className: "UnhealthyReplicaInfo"
1500
+ }
1501
+ }
1502
+ }
1503
+ }
1504
+ };
1505
+ const UnhealthyReplicaInfo = {
1506
+ type: {
1507
+ name: "Composite",
1508
+ className: "UnhealthyReplicaInfo",
1509
+ modelProperties: {
1510
+ availabilityGroupName: {
1511
+ serializedName: "availabilityGroupName",
1512
+ type: {
1513
+ name: "String"
1514
+ }
1515
+ }
1516
+ }
1517
+ }
1518
+ };
1286
1519
  const AssessmentSettings = {
1287
1520
  type: {
1288
1521
  name: "Composite",
@@ -1372,6 +1605,46 @@ const SqlVirtualMachineUpdate = {
1372
1605
  }
1373
1606
  }
1374
1607
  };
1608
+ const SqlVmTroubleshooting = {
1609
+ type: {
1610
+ name: "Composite",
1611
+ className: "SqlVmTroubleshooting",
1612
+ modelProperties: {
1613
+ startTimeUtc: {
1614
+ serializedName: "startTimeUtc",
1615
+ type: {
1616
+ name: "DateTime"
1617
+ }
1618
+ },
1619
+ endTimeUtc: {
1620
+ serializedName: "endTimeUtc",
1621
+ type: {
1622
+ name: "DateTime"
1623
+ }
1624
+ },
1625
+ troubleshootingScenario: {
1626
+ serializedName: "troubleshootingScenario",
1627
+ type: {
1628
+ name: "String"
1629
+ }
1630
+ },
1631
+ properties: {
1632
+ serializedName: "properties",
1633
+ type: {
1634
+ name: "Composite",
1635
+ className: "TroubleshootingAdditionalProperties"
1636
+ }
1637
+ },
1638
+ virtualMachineResourceId: {
1639
+ serializedName: "virtualMachineResourceId",
1640
+ readOnly: true,
1641
+ type: {
1642
+ name: "String"
1643
+ }
1644
+ }
1645
+ }
1646
+ }
1647
+ };
1375
1648
  const ProxyResource = {
1376
1649
  type: {
1377
1650
  name: "Composite",
@@ -1556,6 +1829,7 @@ const SqlVirtualMachine = {
1556
1829
  name: "String"
1557
1830
  }
1558
1831
  }, leastPrivilegeMode: {
1832
+ defaultValue: "NotSet",
1559
1833
  serializedName: "properties.leastPrivilegeMode",
1560
1834
  type: {
1561
1835
  name: "String"
@@ -1611,6 +1885,12 @@ const SqlVirtualMachine = {
1611
1885
  name: "Composite",
1612
1886
  className: "StorageConfigurationSettings"
1613
1887
  }
1888
+ }, troubleshootingStatus: {
1889
+ serializedName: "properties.troubleshootingStatus",
1890
+ type: {
1891
+ name: "Composite",
1892
+ className: "TroubleshootingStatus"
1893
+ }
1614
1894
  }, assessmentSettings: {
1615
1895
  serializedName: "properties.assessmentSettings",
1616
1896
  type: {
@@ -1618,6 +1898,7 @@ const SqlVirtualMachine = {
1618
1898
  className: "AssessmentSettings"
1619
1899
  }
1620
1900
  }, enableAutomaticUpgrade: {
1901
+ defaultValue: false,
1621
1902
  serializedName: "properties.enableAutomaticUpgrade",
1622
1903
  type: {
1623
1904
  name: "Boolean"
@@ -1625,6 +1906,90 @@ const SqlVirtualMachine = {
1625
1906
  } })
1626
1907
  }
1627
1908
  };
1909
+ const AvailabilityGroupListenersDeleteHeaders = {
1910
+ type: {
1911
+ name: "Composite",
1912
+ className: "AvailabilityGroupListenersDeleteHeaders",
1913
+ modelProperties: {
1914
+ location: {
1915
+ serializedName: "location",
1916
+ type: {
1917
+ name: "String"
1918
+ }
1919
+ }
1920
+ }
1921
+ }
1922
+ };
1923
+ const SqlVirtualMachineGroupsDeleteHeaders = {
1924
+ type: {
1925
+ name: "Composite",
1926
+ className: "SqlVirtualMachineGroupsDeleteHeaders",
1927
+ modelProperties: {
1928
+ location: {
1929
+ serializedName: "location",
1930
+ type: {
1931
+ name: "String"
1932
+ }
1933
+ }
1934
+ }
1935
+ }
1936
+ };
1937
+ const SqlVirtualMachinesDeleteHeaders = {
1938
+ type: {
1939
+ name: "Composite",
1940
+ className: "SqlVirtualMachinesDeleteHeaders",
1941
+ modelProperties: {
1942
+ location: {
1943
+ serializedName: "location",
1944
+ type: {
1945
+ name: "String"
1946
+ }
1947
+ }
1948
+ }
1949
+ }
1950
+ };
1951
+ const SqlVirtualMachinesStartAssessmentHeaders = {
1952
+ type: {
1953
+ name: "Composite",
1954
+ className: "SqlVirtualMachinesStartAssessmentHeaders",
1955
+ modelProperties: {
1956
+ location: {
1957
+ serializedName: "location",
1958
+ type: {
1959
+ name: "String"
1960
+ }
1961
+ }
1962
+ }
1963
+ }
1964
+ };
1965
+ const SqlVirtualMachinesRedeployHeaders = {
1966
+ type: {
1967
+ name: "Composite",
1968
+ className: "SqlVirtualMachinesRedeployHeaders",
1969
+ modelProperties: {
1970
+ location: {
1971
+ serializedName: "location",
1972
+ type: {
1973
+ name: "String"
1974
+ }
1975
+ }
1976
+ }
1977
+ }
1978
+ };
1979
+ const SqlVirtualMachineTroubleshootTroubleshootHeaders = {
1980
+ type: {
1981
+ name: "Composite",
1982
+ className: "SqlVirtualMachineTroubleshootTroubleshootHeaders",
1983
+ modelProperties: {
1984
+ location: {
1985
+ serializedName: "location",
1986
+ type: {
1987
+ name: "String"
1988
+ }
1989
+ }
1990
+ }
1991
+ }
1992
+ };
1628
1993
 
1629
1994
  var Mappers = /*#__PURE__*/Object.freeze({
1630
1995
  __proto__: null,
@@ -1635,6 +2000,9 @@ var Mappers = /*#__PURE__*/Object.freeze({
1635
2000
  AgReplica: AgReplica,
1636
2001
  SystemData: SystemData,
1637
2002
  Resource: Resource,
2003
+ ErrorResponse: ErrorResponse,
2004
+ ErrorDetail: ErrorDetail,
2005
+ ErrorAdditionalInfo: ErrorAdditionalInfo,
1638
2006
  AvailabilityGroupListenerListResult: AvailabilityGroupListenerListResult,
1639
2007
  OperationListResult: OperationListResult,
1640
2008
  Operation: Operation,
@@ -1654,17 +2022,28 @@ var Mappers = /*#__PURE__*/Object.freeze({
1654
2022
  SqlStorageUpdateSettings: SqlStorageUpdateSettings,
1655
2023
  AdditionalFeaturesServerConfigurations: AdditionalFeaturesServerConfigurations,
1656
2024
  SQLInstanceSettings: SQLInstanceSettings,
2025
+ AADAuthenticationSettings: AADAuthenticationSettings,
1657
2026
  StorageConfigurationSettings: StorageConfigurationSettings,
1658
2027
  SQLStorageSettings: SQLStorageSettings,
1659
2028
  SQLTempDbSettings: SQLTempDbSettings,
2029
+ TroubleshootingStatus: TroubleshootingStatus,
2030
+ TroubleshootingAdditionalProperties: TroubleshootingAdditionalProperties,
2031
+ UnhealthyReplicaInfo: UnhealthyReplicaInfo,
1660
2032
  AssessmentSettings: AssessmentSettings,
1661
2033
  Schedule: Schedule,
1662
2034
  SqlVirtualMachineUpdate: SqlVirtualMachineUpdate,
2035
+ SqlVmTroubleshooting: SqlVmTroubleshooting,
1663
2036
  ProxyResource: ProxyResource,
1664
2037
  TrackedResource: TrackedResource,
1665
2038
  AvailabilityGroupListener: AvailabilityGroupListener,
1666
2039
  SqlVirtualMachineGroup: SqlVirtualMachineGroup,
1667
- SqlVirtualMachine: SqlVirtualMachine
2040
+ SqlVirtualMachine: SqlVirtualMachine,
2041
+ AvailabilityGroupListenersDeleteHeaders: AvailabilityGroupListenersDeleteHeaders,
2042
+ SqlVirtualMachineGroupsDeleteHeaders: SqlVirtualMachineGroupsDeleteHeaders,
2043
+ SqlVirtualMachinesDeleteHeaders: SqlVirtualMachinesDeleteHeaders,
2044
+ SqlVirtualMachinesStartAssessmentHeaders: SqlVirtualMachinesStartAssessmentHeaders,
2045
+ SqlVirtualMachinesRedeployHeaders: SqlVirtualMachinesRedeployHeaders,
2046
+ SqlVirtualMachineTroubleshootTroubleshootHeaders: SqlVirtualMachineTroubleshootTroubleshootHeaders
1668
2047
  });
1669
2048
 
1670
2049
  /*
@@ -1748,7 +2127,7 @@ const subscriptionId = {
1748
2127
  const apiVersion = {
1749
2128
  parameterPath: "apiVersion",
1750
2129
  mapper: {
1751
- defaultValue: "2022-07-01-preview",
2130
+ defaultValue: "2022-08-01-preview",
1752
2131
  isConstant: true,
1753
2132
  serializedName: "api-version",
1754
2133
  type: {
@@ -1793,6 +2172,11 @@ const parameters2 = {
1793
2172
  const sqlVirtualMachineName = {
1794
2173
  parameterPath: "sqlVirtualMachineName",
1795
2174
  mapper: {
2175
+ constraints: {
2176
+ Pattern: new RegExp("^((?!_)[^\\\\/\"'\\[\\]:|<>+=;,?*@&]{1,64}(?<![.-]))$"),
2177
+ MaxLength: 64,
2178
+ MinLength: 1
2179
+ },
1796
2180
  serializedName: "sqlVirtualMachineName",
1797
2181
  required: true,
1798
2182
  type: {
@@ -1808,6 +2192,10 @@ const parameters4 = {
1808
2192
  parameterPath: "parameters",
1809
2193
  mapper: SqlVirtualMachineUpdate
1810
2194
  };
2195
+ const parameters5 = {
2196
+ parameterPath: "parameters",
2197
+ mapper: SqlVmTroubleshooting
2198
+ };
1811
2199
 
1812
2200
  /*
1813
2201
  * Copyright (c) Microsoft Corporation.
@@ -1816,25 +2204,17 @@ const parameters4 = {
1816
2204
  * Code generated by Microsoft (R) AutoRest Code Generator.
1817
2205
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1818
2206
  */
1819
- class LroImpl {
1820
- constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
1821
- this.sendOperationFn = sendOperationFn;
1822
- this.args = args;
1823
- this.spec = spec;
1824
- this.requestPath = requestPath;
1825
- this.requestMethod = requestMethod;
1826
- }
1827
- sendInitialRequest() {
1828
- return tslib.__awaiter(this, void 0, void 0, function* () {
1829
- return this.sendOperationFn(this.args, this.spec);
1830
- });
1831
- }
1832
- sendPollRequest(path) {
1833
- return tslib.__awaiter(this, void 0, void 0, function* () {
1834
- const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
1835
- return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
1836
- });
1837
- }
2207
+ function createLroSpec(inputs) {
2208
+ const { args, spec, sendOperationFn } = inputs;
2209
+ return {
2210
+ requestMethod: spec.httpMethod,
2211
+ requestPath: spec.path,
2212
+ sendInitialRequest: () => sendOperationFn(args, spec),
2213
+ sendPollRequest: (path, options) => {
2214
+ const restSpec = tslib.__rest(spec, ["requestBody"]);
2215
+ return sendOperationFn(args, Object.assign(Object.assign({}, restSpec), { httpMethod: "GET", path, abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }));
2216
+ }
2217
+ };
1838
2218
  }
1839
2219
 
1840
2220
  /*
@@ -1870,36 +2250,54 @@ class AvailabilityGroupListenersImpl {
1870
2250
  [Symbol.asyncIterator]() {
1871
2251
  return this;
1872
2252
  },
1873
- byPage: () => {
1874
- return this.listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options);
2253
+ byPage: (settings) => {
2254
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2255
+ throw new Error("maxPageSize is not supported by this operation.");
2256
+ }
2257
+ return this.listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options, settings);
1875
2258
  }
1876
2259
  };
1877
2260
  }
1878
- listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options) {
2261
+ listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options, settings) {
1879
2262
  return tslib.__asyncGenerator(this, arguments, function* listByGroupPagingPage_1() {
1880
- let result = yield tslib.__await(this._listByGroup(resourceGroupName, sqlVirtualMachineGroupName, options));
1881
- yield yield tslib.__await(result.value || []);
1882
- let continuationToken = result.nextLink;
2263
+ let result;
2264
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2265
+ if (!continuationToken) {
2266
+ result = yield tslib.__await(this._listByGroup(resourceGroupName, sqlVirtualMachineGroupName, options));
2267
+ let page = result.value || [];
2268
+ continuationToken = result.nextLink;
2269
+ setContinuationToken(page, continuationToken);
2270
+ yield yield tslib.__await(page);
2271
+ }
1883
2272
  while (continuationToken) {
1884
2273
  result = yield tslib.__await(this._listByGroupNext(resourceGroupName, sqlVirtualMachineGroupName, continuationToken, options));
1885
2274
  continuationToken = result.nextLink;
1886
- yield yield tslib.__await(result.value || []);
2275
+ let page = result.value || [];
2276
+ setContinuationToken(page, continuationToken);
2277
+ yield yield tslib.__await(page);
1887
2278
  }
1888
2279
  });
1889
2280
  }
1890
2281
  listByGroupPagingAll(resourceGroupName, sqlVirtualMachineGroupName, options) {
1891
2282
  return tslib.__asyncGenerator(this, arguments, function* listByGroupPagingAll_1() {
1892
- var e_1, _a;
2283
+ var _a, e_1, _b, _c;
1893
2284
  try {
1894
- for (var _b = tslib.__asyncValues(this.listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1895
- const page = _c.value;
1896
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2285
+ for (var _d = true, _e = tslib.__asyncValues(this.listByGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2286
+ _c = _f.value;
2287
+ _d = false;
2288
+ try {
2289
+ const page = _c;
2290
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2291
+ }
2292
+ finally {
2293
+ _d = true;
2294
+ }
1897
2295
  }
1898
2296
  }
1899
2297
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1900
2298
  finally {
1901
2299
  try {
1902
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2300
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1903
2301
  }
1904
2302
  finally { if (e_1) throw e_1.error; }
1905
2303
  }
@@ -1935,7 +2333,7 @@ class AvailabilityGroupListenersImpl {
1935
2333
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1936
2334
  return this.client.sendOperationRequest(args, spec);
1937
2335
  });
1938
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2336
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1939
2337
  var _a;
1940
2338
  let currentRawResponse = undefined;
1941
2339
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -1954,16 +2352,21 @@ class AvailabilityGroupListenersImpl {
1954
2352
  }
1955
2353
  };
1956
2354
  });
1957
- const lro = new LroImpl(sendOperation, {
1958
- resourceGroupName,
1959
- sqlVirtualMachineGroupName,
1960
- availabilityGroupListenerName,
1961
- parameters,
1962
- options
1963
- }, createOrUpdateOperationSpec$2);
1964
- const poller = new coreLro.LroEngine(lro, {
1965
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1966
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2355
+ const lro = createLroSpec({
2356
+ sendOperationFn,
2357
+ args: {
2358
+ resourceGroupName,
2359
+ sqlVirtualMachineGroupName,
2360
+ availabilityGroupListenerName,
2361
+ parameters,
2362
+ options
2363
+ },
2364
+ spec: createOrUpdateOperationSpec$2
2365
+ });
2366
+ const poller = yield coreLro.createHttpPoller(lro, {
2367
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2368
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
2369
+ resourceLocationConfig: "azure-async-operation"
1967
2370
  });
1968
2371
  yield poller.poll();
1969
2372
  return poller;
@@ -1997,7 +2400,7 @@ class AvailabilityGroupListenersImpl {
1997
2400
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1998
2401
  return this.client.sendOperationRequest(args, spec);
1999
2402
  });
2000
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2403
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2001
2404
  var _a;
2002
2405
  let currentRawResponse = undefined;
2003
2406
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -2016,15 +2419,20 @@ class AvailabilityGroupListenersImpl {
2016
2419
  }
2017
2420
  };
2018
2421
  });
2019
- const lro = new LroImpl(sendOperation, {
2020
- resourceGroupName,
2021
- sqlVirtualMachineGroupName,
2022
- availabilityGroupListenerName,
2023
- options
2024
- }, deleteOperationSpec$2);
2025
- const poller = new coreLro.LroEngine(lro, {
2026
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2027
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2422
+ const lro = createLroSpec({
2423
+ sendOperationFn,
2424
+ args: {
2425
+ resourceGroupName,
2426
+ sqlVirtualMachineGroupName,
2427
+ availabilityGroupListenerName,
2428
+ options
2429
+ },
2430
+ spec: deleteOperationSpec$2
2431
+ });
2432
+ const poller = yield coreLro.createHttpPoller(lro, {
2433
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2434
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
2435
+ resourceLocationConfig: "location"
2028
2436
  });
2029
2437
  yield poller.poll();
2030
2438
  return poller;
@@ -2067,7 +2475,7 @@ class AvailabilityGroupListenersImpl {
2067
2475
  }
2068
2476
  }
2069
2477
  // Operation Specifications
2070
- const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2478
+ const serializer$4 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2071
2479
  const getOperationSpec$2 = {
2072
2480
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}",
2073
2481
  httpMethod: "GET",
@@ -2075,7 +2483,9 @@ const getOperationSpec$2 = {
2075
2483
  200: {
2076
2484
  bodyMapper: AvailabilityGroupListener
2077
2485
  },
2078
- default: {}
2486
+ default: {
2487
+ bodyMapper: ErrorResponse
2488
+ }
2079
2489
  },
2080
2490
  queryParameters: [expand, apiVersion],
2081
2491
  urlParameters: [
@@ -2086,7 +2496,7 @@ const getOperationSpec$2 = {
2086
2496
  subscriptionId
2087
2497
  ],
2088
2498
  headerParameters: [accept],
2089
- serializer: serializer$3
2499
+ serializer: serializer$4
2090
2500
  };
2091
2501
  const createOrUpdateOperationSpec$2 = {
2092
2502
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}",
@@ -2104,7 +2514,9 @@ const createOrUpdateOperationSpec$2 = {
2104
2514
  204: {
2105
2515
  bodyMapper: AvailabilityGroupListener
2106
2516
  },
2107
- default: {}
2517
+ default: {
2518
+ bodyMapper: ErrorResponse
2519
+ }
2108
2520
  },
2109
2521
  requestBody: parameters,
2110
2522
  queryParameters: [apiVersion],
@@ -2117,12 +2529,20 @@ const createOrUpdateOperationSpec$2 = {
2117
2529
  ],
2118
2530
  headerParameters: [accept, contentType],
2119
2531
  mediaType: "json",
2120
- serializer: serializer$3
2532
+ serializer: serializer$4
2121
2533
  };
2122
2534
  const deleteOperationSpec$2 = {
2123
2535
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}",
2124
2536
  httpMethod: "DELETE",
2125
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
2537
+ responses: {
2538
+ 200: {},
2539
+ 201: {},
2540
+ 202: {},
2541
+ 204: {},
2542
+ default: {
2543
+ bodyMapper: ErrorResponse
2544
+ }
2545
+ },
2126
2546
  queryParameters: [apiVersion],
2127
2547
  urlParameters: [
2128
2548
  $host,
@@ -2131,7 +2551,8 @@ const deleteOperationSpec$2 = {
2131
2551
  availabilityGroupListenerName,
2132
2552
  subscriptionId
2133
2553
  ],
2134
- serializer: serializer$3
2554
+ headerParameters: [accept],
2555
+ serializer: serializer$4
2135
2556
  };
2136
2557
  const listByGroupOperationSpec = {
2137
2558
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners",
@@ -2140,7 +2561,9 @@ const listByGroupOperationSpec = {
2140
2561
  200: {
2141
2562
  bodyMapper: AvailabilityGroupListenerListResult
2142
2563
  },
2143
- default: {}
2564
+ default: {
2565
+ bodyMapper: ErrorResponse
2566
+ }
2144
2567
  },
2145
2568
  queryParameters: [apiVersion],
2146
2569
  urlParameters: [
@@ -2150,7 +2573,7 @@ const listByGroupOperationSpec = {
2150
2573
  subscriptionId
2151
2574
  ],
2152
2575
  headerParameters: [accept],
2153
- serializer: serializer$3
2576
+ serializer: serializer$4
2154
2577
  };
2155
2578
  const listByGroupNextOperationSpec = {
2156
2579
  path: "{nextLink}",
@@ -2159,9 +2582,10 @@ const listByGroupNextOperationSpec = {
2159
2582
  200: {
2160
2583
  bodyMapper: AvailabilityGroupListenerListResult
2161
2584
  },
2162
- default: {}
2585
+ default: {
2586
+ bodyMapper: ErrorResponse
2587
+ }
2163
2588
  },
2164
- queryParameters: [apiVersion],
2165
2589
  urlParameters: [
2166
2590
  $host,
2167
2591
  resourceGroupName,
@@ -2170,7 +2594,7 @@ const listByGroupNextOperationSpec = {
2170
2594
  nextLink
2171
2595
  ],
2172
2596
  headerParameters: [accept],
2173
- serializer: serializer$3
2597
+ serializer: serializer$4
2174
2598
  };
2175
2599
 
2176
2600
  /*
@@ -2203,36 +2627,54 @@ class OperationsImpl {
2203
2627
  [Symbol.asyncIterator]() {
2204
2628
  return this;
2205
2629
  },
2206
- byPage: () => {
2207
- return this.listPagingPage(options);
2630
+ byPage: (settings) => {
2631
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2632
+ throw new Error("maxPageSize is not supported by this operation.");
2633
+ }
2634
+ return this.listPagingPage(options, settings);
2208
2635
  }
2209
2636
  };
2210
2637
  }
2211
- listPagingPage(options) {
2638
+ listPagingPage(options, settings) {
2212
2639
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2213
- let result = yield tslib.__await(this._list(options));
2214
- yield yield tslib.__await(result.value || []);
2215
- let continuationToken = result.nextLink;
2640
+ let result;
2641
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2642
+ if (!continuationToken) {
2643
+ result = yield tslib.__await(this._list(options));
2644
+ let page = result.value || [];
2645
+ continuationToken = result.nextLink;
2646
+ setContinuationToken(page, continuationToken);
2647
+ yield yield tslib.__await(page);
2648
+ }
2216
2649
  while (continuationToken) {
2217
2650
  result = yield tslib.__await(this._listNext(continuationToken, options));
2218
2651
  continuationToken = result.nextLink;
2219
- yield yield tslib.__await(result.value || []);
2652
+ let page = result.value || [];
2653
+ setContinuationToken(page, continuationToken);
2654
+ yield yield tslib.__await(page);
2220
2655
  }
2221
2656
  });
2222
2657
  }
2223
2658
  listPagingAll(options) {
2224
2659
  return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
2225
- var e_1, _a;
2660
+ var _a, e_1, _b, _c;
2226
2661
  try {
2227
- for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2228
- const page = _c.value;
2229
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2662
+ for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2663
+ _c = _f.value;
2664
+ _d = false;
2665
+ try {
2666
+ const page = _c;
2667
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2668
+ }
2669
+ finally {
2670
+ _d = true;
2671
+ }
2230
2672
  }
2231
2673
  }
2232
2674
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
2233
2675
  finally {
2234
2676
  try {
2235
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2677
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2236
2678
  }
2237
2679
  finally { if (e_1) throw e_1.error; }
2238
2680
  }
@@ -2255,7 +2697,7 @@ class OperationsImpl {
2255
2697
  }
2256
2698
  }
2257
2699
  // Operation Specifications
2258
- const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2700
+ const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2259
2701
  const listOperationSpec$2 = {
2260
2702
  path: "/providers/Microsoft.SqlVirtualMachine/operations",
2261
2703
  httpMethod: "GET",
@@ -2263,12 +2705,14 @@ const listOperationSpec$2 = {
2263
2705
  200: {
2264
2706
  bodyMapper: OperationListResult
2265
2707
  },
2266
- default: {}
2708
+ default: {
2709
+ bodyMapper: ErrorResponse
2710
+ }
2267
2711
  },
2268
2712
  queryParameters: [apiVersion],
2269
2713
  urlParameters: [$host],
2270
2714
  headerParameters: [accept],
2271
- serializer: serializer$2
2715
+ serializer: serializer$3
2272
2716
  };
2273
2717
  const listNextOperationSpec$2 = {
2274
2718
  path: "{nextLink}",
@@ -2277,12 +2721,13 @@ const listNextOperationSpec$2 = {
2277
2721
  200: {
2278
2722
  bodyMapper: OperationListResult
2279
2723
  },
2280
- default: {}
2724
+ default: {
2725
+ bodyMapper: ErrorResponse
2726
+ }
2281
2727
  },
2282
- queryParameters: [apiVersion],
2283
2728
  urlParameters: [$host, nextLink],
2284
2729
  headerParameters: [accept],
2285
- serializer: serializer$2
2730
+ serializer: serializer$3
2286
2731
  };
2287
2732
 
2288
2733
  /*
@@ -2317,36 +2762,54 @@ class SqlVirtualMachineGroupsImpl {
2317
2762
  [Symbol.asyncIterator]() {
2318
2763
  return this;
2319
2764
  },
2320
- byPage: () => {
2321
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
2765
+ byPage: (settings) => {
2766
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2767
+ throw new Error("maxPageSize is not supported by this operation.");
2768
+ }
2769
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
2322
2770
  }
2323
2771
  };
2324
2772
  }
2325
- listByResourceGroupPagingPage(resourceGroupName, options) {
2773
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
2326
2774
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
2327
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
2328
- yield yield tslib.__await(result.value || []);
2329
- let continuationToken = result.nextLink;
2775
+ let result;
2776
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2777
+ if (!continuationToken) {
2778
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
2779
+ let page = result.value || [];
2780
+ continuationToken = result.nextLink;
2781
+ setContinuationToken(page, continuationToken);
2782
+ yield yield tslib.__await(page);
2783
+ }
2330
2784
  while (continuationToken) {
2331
2785
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
2332
2786
  continuationToken = result.nextLink;
2333
- yield yield tslib.__await(result.value || []);
2787
+ let page = result.value || [];
2788
+ setContinuationToken(page, continuationToken);
2789
+ yield yield tslib.__await(page);
2334
2790
  }
2335
2791
  });
2336
2792
  }
2337
2793
  listByResourceGroupPagingAll(resourceGroupName, options) {
2338
2794
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
2339
- var e_1, _a;
2795
+ var _a, e_1, _b, _c;
2340
2796
  try {
2341
- for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2342
- const page = _c.value;
2343
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2797
+ for (var _d = true, _e = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2798
+ _c = _f.value;
2799
+ _d = false;
2800
+ try {
2801
+ const page = _c;
2802
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2803
+ }
2804
+ finally {
2805
+ _d = true;
2806
+ }
2344
2807
  }
2345
2808
  }
2346
2809
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
2347
2810
  finally {
2348
2811
  try {
2349
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2812
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2350
2813
  }
2351
2814
  finally { if (e_1) throw e_1.error; }
2352
2815
  }
@@ -2365,36 +2828,54 @@ class SqlVirtualMachineGroupsImpl {
2365
2828
  [Symbol.asyncIterator]() {
2366
2829
  return this;
2367
2830
  },
2368
- byPage: () => {
2369
- return this.listPagingPage(options);
2831
+ byPage: (settings) => {
2832
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2833
+ throw new Error("maxPageSize is not supported by this operation.");
2834
+ }
2835
+ return this.listPagingPage(options, settings);
2370
2836
  }
2371
2837
  };
2372
2838
  }
2373
- listPagingPage(options) {
2839
+ listPagingPage(options, settings) {
2374
2840
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2375
- let result = yield tslib.__await(this._list(options));
2376
- yield yield tslib.__await(result.value || []);
2377
- let continuationToken = result.nextLink;
2841
+ let result;
2842
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2843
+ if (!continuationToken) {
2844
+ result = yield tslib.__await(this._list(options));
2845
+ let page = result.value || [];
2846
+ continuationToken = result.nextLink;
2847
+ setContinuationToken(page, continuationToken);
2848
+ yield yield tslib.__await(page);
2849
+ }
2378
2850
  while (continuationToken) {
2379
2851
  result = yield tslib.__await(this._listNext(continuationToken, options));
2380
2852
  continuationToken = result.nextLink;
2381
- yield yield tslib.__await(result.value || []);
2853
+ let page = result.value || [];
2854
+ setContinuationToken(page, continuationToken);
2855
+ yield yield tslib.__await(page);
2382
2856
  }
2383
2857
  });
2384
2858
  }
2385
2859
  listPagingAll(options) {
2386
2860
  return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
2387
- var e_2, _a;
2861
+ var _a, e_2, _b, _c;
2388
2862
  try {
2389
- for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2390
- const page = _c.value;
2391
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2863
+ for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2864
+ _c = _f.value;
2865
+ _d = false;
2866
+ try {
2867
+ const page = _c;
2868
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2869
+ }
2870
+ finally {
2871
+ _d = true;
2872
+ }
2392
2873
  }
2393
2874
  }
2394
2875
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
2395
2876
  finally {
2396
2877
  try {
2397
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2878
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2398
2879
  }
2399
2880
  finally { if (e_2) throw e_2.error; }
2400
2881
  }
@@ -2423,7 +2904,7 @@ class SqlVirtualMachineGroupsImpl {
2423
2904
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2424
2905
  return this.client.sendOperationRequest(args, spec);
2425
2906
  });
2426
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2907
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2427
2908
  var _a;
2428
2909
  let currentRawResponse = undefined;
2429
2910
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -2442,10 +2923,20 @@ class SqlVirtualMachineGroupsImpl {
2442
2923
  }
2443
2924
  };
2444
2925
  });
2445
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineGroupName, parameters, options }, createOrUpdateOperationSpec$1);
2446
- const poller = new coreLro.LroEngine(lro, {
2447
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2448
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2926
+ const lro = createLroSpec({
2927
+ sendOperationFn,
2928
+ args: {
2929
+ resourceGroupName,
2930
+ sqlVirtualMachineGroupName,
2931
+ parameters,
2932
+ options
2933
+ },
2934
+ spec: createOrUpdateOperationSpec$1
2935
+ });
2936
+ const poller = yield coreLro.createHttpPoller(lro, {
2937
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2938
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
2939
+ resourceLocationConfig: "azure-async-operation"
2449
2940
  });
2450
2941
  yield poller.poll();
2451
2942
  return poller;
@@ -2477,7 +2968,7 @@ class SqlVirtualMachineGroupsImpl {
2477
2968
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2478
2969
  return this.client.sendOperationRequest(args, spec);
2479
2970
  });
2480
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2971
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2481
2972
  var _a;
2482
2973
  let currentRawResponse = undefined;
2483
2974
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -2496,10 +2987,15 @@ class SqlVirtualMachineGroupsImpl {
2496
2987
  }
2497
2988
  };
2498
2989
  });
2499
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineGroupName, options }, deleteOperationSpec$1);
2500
- const poller = new coreLro.LroEngine(lro, {
2501
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2502
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2990
+ const lro = createLroSpec({
2991
+ sendOperationFn,
2992
+ args: { resourceGroupName, sqlVirtualMachineGroupName, options },
2993
+ spec: deleteOperationSpec$1
2994
+ });
2995
+ const poller = yield coreLro.createHttpPoller(lro, {
2996
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2997
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
2998
+ resourceLocationConfig: "location"
2503
2999
  });
2504
3000
  yield poller.poll();
2505
3001
  return poller;
@@ -2531,7 +3027,7 @@ class SqlVirtualMachineGroupsImpl {
2531
3027
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2532
3028
  return this.client.sendOperationRequest(args, spec);
2533
3029
  });
2534
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3030
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2535
3031
  var _a;
2536
3032
  let currentRawResponse = undefined;
2537
3033
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -2550,10 +3046,20 @@ class SqlVirtualMachineGroupsImpl {
2550
3046
  }
2551
3047
  };
2552
3048
  });
2553
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineGroupName, parameters, options }, updateOperationSpec$1);
2554
- const poller = new coreLro.LroEngine(lro, {
2555
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2556
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3049
+ const lro = createLroSpec({
3050
+ sendOperationFn,
3051
+ args: {
3052
+ resourceGroupName,
3053
+ sqlVirtualMachineGroupName,
3054
+ parameters,
3055
+ options
3056
+ },
3057
+ spec: updateOperationSpec$1
3058
+ });
3059
+ const poller = yield coreLro.createHttpPoller(lro, {
3060
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3061
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3062
+ resourceLocationConfig: "azure-async-operation"
2557
3063
  });
2558
3064
  yield poller.poll();
2559
3065
  return poller;
@@ -2609,7 +3115,7 @@ class SqlVirtualMachineGroupsImpl {
2609
3115
  }
2610
3116
  }
2611
3117
  // Operation Specifications
2612
- const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
3118
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2613
3119
  const getOperationSpec$1 = {
2614
3120
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}",
2615
3121
  httpMethod: "GET",
@@ -2617,7 +3123,9 @@ const getOperationSpec$1 = {
2617
3123
  200: {
2618
3124
  bodyMapper: SqlVirtualMachineGroup
2619
3125
  },
2620
- default: {}
3126
+ default: {
3127
+ bodyMapper: ErrorResponse
3128
+ }
2621
3129
  },
2622
3130
  queryParameters: [apiVersion],
2623
3131
  urlParameters: [
@@ -2627,7 +3135,7 @@ const getOperationSpec$1 = {
2627
3135
  subscriptionId
2628
3136
  ],
2629
3137
  headerParameters: [accept],
2630
- serializer: serializer$1
3138
+ serializer: serializer$2
2631
3139
  };
2632
3140
  const createOrUpdateOperationSpec$1 = {
2633
3141
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}",
@@ -2645,7 +3153,9 @@ const createOrUpdateOperationSpec$1 = {
2645
3153
  204: {
2646
3154
  bodyMapper: SqlVirtualMachineGroup
2647
3155
  },
2648
- default: {}
3156
+ default: {
3157
+ bodyMapper: ErrorResponse
3158
+ }
2649
3159
  },
2650
3160
  requestBody: parameters1,
2651
3161
  queryParameters: [apiVersion],
@@ -2657,12 +3167,20 @@ const createOrUpdateOperationSpec$1 = {
2657
3167
  ],
2658
3168
  headerParameters: [accept, contentType],
2659
3169
  mediaType: "json",
2660
- serializer: serializer$1
3170
+ serializer: serializer$2
2661
3171
  };
2662
3172
  const deleteOperationSpec$1 = {
2663
3173
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}",
2664
3174
  httpMethod: "DELETE",
2665
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
3175
+ responses: {
3176
+ 200: {},
3177
+ 201: {},
3178
+ 202: {},
3179
+ 204: {},
3180
+ default: {
3181
+ bodyMapper: ErrorResponse
3182
+ }
3183
+ },
2666
3184
  queryParameters: [apiVersion],
2667
3185
  urlParameters: [
2668
3186
  $host,
@@ -2670,7 +3188,8 @@ const deleteOperationSpec$1 = {
2670
3188
  sqlVirtualMachineGroupName,
2671
3189
  subscriptionId
2672
3190
  ],
2673
- serializer: serializer$1
3191
+ headerParameters: [accept],
3192
+ serializer: serializer$2
2674
3193
  };
2675
3194
  const updateOperationSpec$1 = {
2676
3195
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}",
@@ -2688,7 +3207,9 @@ const updateOperationSpec$1 = {
2688
3207
  204: {
2689
3208
  bodyMapper: SqlVirtualMachineGroup
2690
3209
  },
2691
- default: {}
3210
+ default: {
3211
+ bodyMapper: ErrorResponse
3212
+ }
2692
3213
  },
2693
3214
  requestBody: parameters2,
2694
3215
  queryParameters: [apiVersion],
@@ -2700,7 +3221,7 @@ const updateOperationSpec$1 = {
2700
3221
  ],
2701
3222
  headerParameters: [accept, contentType],
2702
3223
  mediaType: "json",
2703
- serializer: serializer$1
3224
+ serializer: serializer$2
2704
3225
  };
2705
3226
  const listByResourceGroupOperationSpec$1 = {
2706
3227
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups",
@@ -2709,7 +3230,9 @@ const listByResourceGroupOperationSpec$1 = {
2709
3230
  200: {
2710
3231
  bodyMapper: SqlVirtualMachineGroupListResult
2711
3232
  },
2712
- default: {}
3233
+ default: {
3234
+ bodyMapper: ErrorResponse
3235
+ }
2713
3236
  },
2714
3237
  queryParameters: [apiVersion],
2715
3238
  urlParameters: [
@@ -2718,7 +3241,7 @@ const listByResourceGroupOperationSpec$1 = {
2718
3241
  subscriptionId
2719
3242
  ],
2720
3243
  headerParameters: [accept],
2721
- serializer: serializer$1
3244
+ serializer: serializer$2
2722
3245
  };
2723
3246
  const listOperationSpec$1 = {
2724
3247
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups",
@@ -2727,12 +3250,14 @@ const listOperationSpec$1 = {
2727
3250
  200: {
2728
3251
  bodyMapper: SqlVirtualMachineGroupListResult
2729
3252
  },
2730
- default: {}
3253
+ default: {
3254
+ bodyMapper: ErrorResponse
3255
+ }
2731
3256
  },
2732
3257
  queryParameters: [apiVersion],
2733
3258
  urlParameters: [$host, subscriptionId],
2734
3259
  headerParameters: [accept],
2735
- serializer: serializer$1
3260
+ serializer: serializer$2
2736
3261
  };
2737
3262
  const listByResourceGroupNextOperationSpec$1 = {
2738
3263
  path: "{nextLink}",
@@ -2741,9 +3266,10 @@ const listByResourceGroupNextOperationSpec$1 = {
2741
3266
  200: {
2742
3267
  bodyMapper: SqlVirtualMachineGroupListResult
2743
3268
  },
2744
- default: {}
3269
+ default: {
3270
+ bodyMapper: ErrorResponse
3271
+ }
2745
3272
  },
2746
- queryParameters: [apiVersion],
2747
3273
  urlParameters: [
2748
3274
  $host,
2749
3275
  resourceGroupName,
@@ -2751,7 +3277,7 @@ const listByResourceGroupNextOperationSpec$1 = {
2751
3277
  nextLink
2752
3278
  ],
2753
3279
  headerParameters: [accept],
2754
- serializer: serializer$1
3280
+ serializer: serializer$2
2755
3281
  };
2756
3282
  const listNextOperationSpec$1 = {
2757
3283
  path: "{nextLink}",
@@ -2760,16 +3286,17 @@ const listNextOperationSpec$1 = {
2760
3286
  200: {
2761
3287
  bodyMapper: SqlVirtualMachineGroupListResult
2762
3288
  },
2763
- default: {}
3289
+ default: {
3290
+ bodyMapper: ErrorResponse
3291
+ }
2764
3292
  },
2765
- queryParameters: [apiVersion],
2766
3293
  urlParameters: [
2767
3294
  $host,
2768
3295
  subscriptionId,
2769
3296
  nextLink
2770
3297
  ],
2771
3298
  headerParameters: [accept],
2772
- serializer: serializer$1
3299
+ serializer: serializer$2
2773
3300
  };
2774
3301
 
2775
3302
  /*
@@ -2805,36 +3332,54 @@ class SqlVirtualMachinesImpl {
2805
3332
  [Symbol.asyncIterator]() {
2806
3333
  return this;
2807
3334
  },
2808
- byPage: () => {
2809
- return this.listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options);
3335
+ byPage: (settings) => {
3336
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3337
+ throw new Error("maxPageSize is not supported by this operation.");
3338
+ }
3339
+ return this.listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options, settings);
2810
3340
  }
2811
3341
  };
2812
3342
  }
2813
- listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options) {
3343
+ listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options, settings) {
2814
3344
  return tslib.__asyncGenerator(this, arguments, function* listBySqlVmGroupPagingPage_1() {
2815
- let result = yield tslib.__await(this._listBySqlVmGroup(resourceGroupName, sqlVirtualMachineGroupName, options));
2816
- yield yield tslib.__await(result.value || []);
2817
- let continuationToken = result.nextLink;
3345
+ let result;
3346
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3347
+ if (!continuationToken) {
3348
+ result = yield tslib.__await(this._listBySqlVmGroup(resourceGroupName, sqlVirtualMachineGroupName, options));
3349
+ let page = result.value || [];
3350
+ continuationToken = result.nextLink;
3351
+ setContinuationToken(page, continuationToken);
3352
+ yield yield tslib.__await(page);
3353
+ }
2818
3354
  while (continuationToken) {
2819
3355
  result = yield tslib.__await(this._listBySqlVmGroupNext(resourceGroupName, sqlVirtualMachineGroupName, continuationToken, options));
2820
3356
  continuationToken = result.nextLink;
2821
- yield yield tslib.__await(result.value || []);
3357
+ let page = result.value || [];
3358
+ setContinuationToken(page, continuationToken);
3359
+ yield yield tslib.__await(page);
2822
3360
  }
2823
3361
  });
2824
3362
  }
2825
3363
  listBySqlVmGroupPagingAll(resourceGroupName, sqlVirtualMachineGroupName, options) {
2826
3364
  return tslib.__asyncGenerator(this, arguments, function* listBySqlVmGroupPagingAll_1() {
2827
- var e_1, _a;
3365
+ var _a, e_1, _b, _c;
2828
3366
  try {
2829
- for (var _b = tslib.__asyncValues(this.listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2830
- const page = _c.value;
2831
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3367
+ for (var _d = true, _e = tslib.__asyncValues(this.listBySqlVmGroupPagingPage(resourceGroupName, sqlVirtualMachineGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
3368
+ _c = _f.value;
3369
+ _d = false;
3370
+ try {
3371
+ const page = _c;
3372
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3373
+ }
3374
+ finally {
3375
+ _d = true;
3376
+ }
2832
3377
  }
2833
3378
  }
2834
3379
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
2835
3380
  finally {
2836
3381
  try {
2837
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
3382
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2838
3383
  }
2839
3384
  finally { if (e_1) throw e_1.error; }
2840
3385
  }
@@ -2853,36 +3398,54 @@ class SqlVirtualMachinesImpl {
2853
3398
  [Symbol.asyncIterator]() {
2854
3399
  return this;
2855
3400
  },
2856
- byPage: () => {
2857
- return this.listPagingPage(options);
3401
+ byPage: (settings) => {
3402
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3403
+ throw new Error("maxPageSize is not supported by this operation.");
3404
+ }
3405
+ return this.listPagingPage(options, settings);
2858
3406
  }
2859
3407
  };
2860
3408
  }
2861
- listPagingPage(options) {
3409
+ listPagingPage(options, settings) {
2862
3410
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2863
- let result = yield tslib.__await(this._list(options));
2864
- yield yield tslib.__await(result.value || []);
2865
- let continuationToken = result.nextLink;
3411
+ let result;
3412
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3413
+ if (!continuationToken) {
3414
+ result = yield tslib.__await(this._list(options));
3415
+ let page = result.value || [];
3416
+ continuationToken = result.nextLink;
3417
+ setContinuationToken(page, continuationToken);
3418
+ yield yield tslib.__await(page);
3419
+ }
2866
3420
  while (continuationToken) {
2867
3421
  result = yield tslib.__await(this._listNext(continuationToken, options));
2868
3422
  continuationToken = result.nextLink;
2869
- yield yield tslib.__await(result.value || []);
3423
+ let page = result.value || [];
3424
+ setContinuationToken(page, continuationToken);
3425
+ yield yield tslib.__await(page);
2870
3426
  }
2871
3427
  });
2872
3428
  }
2873
3429
  listPagingAll(options) {
2874
3430
  return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
2875
- var e_2, _a;
3431
+ var _a, e_2, _b, _c;
2876
3432
  try {
2877
- for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2878
- const page = _c.value;
2879
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3433
+ for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
3434
+ _c = _f.value;
3435
+ _d = false;
3436
+ try {
3437
+ const page = _c;
3438
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3439
+ }
3440
+ finally {
3441
+ _d = true;
3442
+ }
2880
3443
  }
2881
3444
  }
2882
3445
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
2883
3446
  finally {
2884
3447
  try {
2885
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
3448
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2886
3449
  }
2887
3450
  finally { if (e_2) throw e_2.error; }
2888
3451
  }
@@ -2903,36 +3466,54 @@ class SqlVirtualMachinesImpl {
2903
3466
  [Symbol.asyncIterator]() {
2904
3467
  return this;
2905
3468
  },
2906
- byPage: () => {
2907
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
3469
+ byPage: (settings) => {
3470
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3471
+ throw new Error("maxPageSize is not supported by this operation.");
3472
+ }
3473
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
2908
3474
  }
2909
3475
  };
2910
3476
  }
2911
- listByResourceGroupPagingPage(resourceGroupName, options) {
3477
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
2912
3478
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
2913
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
2914
- yield yield tslib.__await(result.value || []);
2915
- let continuationToken = result.nextLink;
3479
+ let result;
3480
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3481
+ if (!continuationToken) {
3482
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
3483
+ let page = result.value || [];
3484
+ continuationToken = result.nextLink;
3485
+ setContinuationToken(page, continuationToken);
3486
+ yield yield tslib.__await(page);
3487
+ }
2916
3488
  while (continuationToken) {
2917
3489
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
2918
3490
  continuationToken = result.nextLink;
2919
- yield yield tslib.__await(result.value || []);
3491
+ let page = result.value || [];
3492
+ setContinuationToken(page, continuationToken);
3493
+ yield yield tslib.__await(page);
2920
3494
  }
2921
3495
  });
2922
3496
  }
2923
3497
  listByResourceGroupPagingAll(resourceGroupName, options) {
2924
3498
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
2925
- var e_3, _a;
3499
+ var _a, e_3, _b, _c;
2926
3500
  try {
2927
- for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2928
- const page = _c.value;
2929
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3501
+ for (var _d = true, _e = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
3502
+ _c = _f.value;
3503
+ _d = false;
3504
+ try {
3505
+ const page = _c;
3506
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
3507
+ }
3508
+ finally {
3509
+ _d = true;
3510
+ }
2930
3511
  }
2931
3512
  }
2932
3513
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
2933
3514
  finally {
2934
3515
  try {
2935
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
3516
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
2936
3517
  }
2937
3518
  finally { if (e_3) throw e_3.error; }
2938
3519
  }
@@ -2956,18 +3537,29 @@ class SqlVirtualMachinesImpl {
2956
3537
  return this.client.sendOperationRequest({ options }, listOperationSpec);
2957
3538
  }
2958
3539
  /**
2959
- * Starts Assessment on SQL virtual machine.
3540
+ * Gets a SQL virtual machine.
2960
3541
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
2961
3542
  * value from the Azure Resource Manager API or the portal.
2962
3543
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
2963
3544
  * @param options The options parameters.
2964
3545
  */
2965
- beginStartAssessment(resourceGroupName, sqlVirtualMachineName, options) {
3546
+ get(resourceGroupName, sqlVirtualMachineName, options) {
3547
+ return this.client.sendOperationRequest({ resourceGroupName, sqlVirtualMachineName, options }, getOperationSpec);
3548
+ }
3549
+ /**
3550
+ * Creates or updates a SQL virtual machine.
3551
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3552
+ * value from the Azure Resource Manager API or the portal.
3553
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
3554
+ * @param parameters The SQL virtual machine.
3555
+ * @param options The options parameters.
3556
+ */
3557
+ beginCreateOrUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options) {
2966
3558
  return tslib.__awaiter(this, void 0, void 0, function* () {
2967
3559
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2968
3560
  return this.client.sendOperationRequest(args, spec);
2969
3561
  });
2970
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3562
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2971
3563
  var _a;
2972
3564
  let currentRawResponse = undefined;
2973
3565
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -2986,41 +3578,47 @@ class SqlVirtualMachinesImpl {
2986
3578
  }
2987
3579
  };
2988
3580
  });
2989
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineName, options }, startAssessmentOperationSpec);
2990
- const poller = new coreLro.LroEngine(lro, {
2991
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2992
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3581
+ const lro = createLroSpec({
3582
+ sendOperationFn,
3583
+ args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
3584
+ spec: createOrUpdateOperationSpec
3585
+ });
3586
+ const poller = yield coreLro.createHttpPoller(lro, {
3587
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3588
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3589
+ resourceLocationConfig: "azure-async-operation"
2993
3590
  });
2994
3591
  yield poller.poll();
2995
3592
  return poller;
2996
3593
  });
2997
3594
  }
2998
3595
  /**
2999
- * Starts Assessment on SQL virtual machine.
3596
+ * Creates or updates a SQL virtual machine.
3000
3597
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3001
3598
  * value from the Azure Resource Manager API or the portal.
3002
3599
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3600
+ * @param parameters The SQL virtual machine.
3003
3601
  * @param options The options parameters.
3004
3602
  */
3005
- beginStartAssessmentAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3603
+ beginCreateOrUpdateAndWait(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3006
3604
  return tslib.__awaiter(this, void 0, void 0, function* () {
3007
- const poller = yield this.beginStartAssessment(resourceGroupName, sqlVirtualMachineName, options);
3605
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options);
3008
3606
  return poller.pollUntilDone();
3009
3607
  });
3010
3608
  }
3011
3609
  /**
3012
- * Uninstalls and reinstalls the SQL Iaas Extension.
3610
+ * Deletes a SQL virtual machine.
3013
3611
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3014
3612
  * value from the Azure Resource Manager API or the portal.
3015
3613
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3016
3614
  * @param options The options parameters.
3017
3615
  */
3018
- beginRedeploy(resourceGroupName, sqlVirtualMachineName, options) {
3616
+ beginDelete(resourceGroupName, sqlVirtualMachineName, options) {
3019
3617
  return tslib.__awaiter(this, void 0, void 0, function* () {
3020
3618
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3021
3619
  return this.client.sendOperationRequest(args, spec);
3022
3620
  });
3023
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3621
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3024
3622
  var _a;
3025
3623
  let currentRawResponse = undefined;
3026
3624
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -3039,52 +3637,47 @@ class SqlVirtualMachinesImpl {
3039
3637
  }
3040
3638
  };
3041
3639
  });
3042
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineName, options }, redeployOperationSpec);
3043
- const poller = new coreLro.LroEngine(lro, {
3044
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3045
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3640
+ const lro = createLroSpec({
3641
+ sendOperationFn,
3642
+ args: { resourceGroupName, sqlVirtualMachineName, options },
3643
+ spec: deleteOperationSpec
3644
+ });
3645
+ const poller = yield coreLro.createHttpPoller(lro, {
3646
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3647
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3648
+ resourceLocationConfig: "location"
3046
3649
  });
3047
3650
  yield poller.poll();
3048
3651
  return poller;
3049
3652
  });
3050
3653
  }
3051
3654
  /**
3052
- * Uninstalls and reinstalls the SQL Iaas Extension.
3655
+ * Deletes a SQL virtual machine.
3053
3656
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3054
3657
  * value from the Azure Resource Manager API or the portal.
3055
3658
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3056
3659
  * @param options The options parameters.
3057
3660
  */
3058
- beginRedeployAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3661
+ beginDeleteAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3059
3662
  return tslib.__awaiter(this, void 0, void 0, function* () {
3060
- const poller = yield this.beginRedeploy(resourceGroupName, sqlVirtualMachineName, options);
3663
+ const poller = yield this.beginDelete(resourceGroupName, sqlVirtualMachineName, options);
3061
3664
  return poller.pollUntilDone();
3062
3665
  });
3063
3666
  }
3064
3667
  /**
3065
- * Gets a SQL virtual machine.
3066
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3067
- * value from the Azure Resource Manager API or the portal.
3068
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
3069
- * @param options The options parameters.
3070
- */
3071
- get(resourceGroupName, sqlVirtualMachineName, options) {
3072
- return this.client.sendOperationRequest({ resourceGroupName, sqlVirtualMachineName, options }, getOperationSpec);
3073
- }
3074
- /**
3075
- * Creates or updates a SQL virtual machine.
3668
+ * Updates a SQL virtual machine.
3076
3669
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3077
3670
  * value from the Azure Resource Manager API or the portal.
3078
3671
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3079
3672
  * @param parameters The SQL virtual machine.
3080
3673
  * @param options The options parameters.
3081
3674
  */
3082
- beginCreateOrUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3675
+ beginUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3083
3676
  return tslib.__awaiter(this, void 0, void 0, function* () {
3084
3677
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3085
3678
  return this.client.sendOperationRequest(args, spec);
3086
3679
  });
3087
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3680
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3088
3681
  var _a;
3089
3682
  let currentRawResponse = undefined;
3090
3683
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -3103,42 +3696,56 @@ class SqlVirtualMachinesImpl {
3103
3696
  }
3104
3697
  };
3105
3698
  });
3106
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineName, parameters, options }, createOrUpdateOperationSpec);
3107
- const poller = new coreLro.LroEngine(lro, {
3108
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3109
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3699
+ const lro = createLroSpec({
3700
+ sendOperationFn,
3701
+ args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
3702
+ spec: updateOperationSpec
3703
+ });
3704
+ const poller = yield coreLro.createHttpPoller(lro, {
3705
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3706
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3707
+ resourceLocationConfig: "azure-async-operation"
3110
3708
  });
3111
3709
  yield poller.poll();
3112
3710
  return poller;
3113
3711
  });
3114
3712
  }
3115
3713
  /**
3116
- * Creates or updates a SQL virtual machine.
3714
+ * Updates a SQL virtual machine.
3117
3715
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3118
3716
  * value from the Azure Resource Manager API or the portal.
3119
3717
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3120
3718
  * @param parameters The SQL virtual machine.
3121
3719
  * @param options The options parameters.
3122
3720
  */
3123
- beginCreateOrUpdateAndWait(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3721
+ beginUpdateAndWait(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3124
3722
  return tslib.__awaiter(this, void 0, void 0, function* () {
3125
- const poller = yield this.beginCreateOrUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options);
3723
+ const poller = yield this.beginUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options);
3126
3724
  return poller.pollUntilDone();
3127
3725
  });
3128
3726
  }
3129
3727
  /**
3130
- * Deletes a SQL virtual machine.
3728
+ * Gets all SQL virtual machines in a resource group.
3729
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3730
+ * value from the Azure Resource Manager API or the portal.
3731
+ * @param options The options parameters.
3732
+ */
3733
+ _listByResourceGroup(resourceGroupName, options) {
3734
+ return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
3735
+ }
3736
+ /**
3737
+ * Starts SQL best practices Assessment on SQL virtual machine.
3131
3738
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3132
3739
  * value from the Azure Resource Manager API or the portal.
3133
3740
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3134
3741
  * @param options The options parameters.
3135
3742
  */
3136
- beginDelete(resourceGroupName, sqlVirtualMachineName, options) {
3743
+ beginStartAssessment(resourceGroupName, sqlVirtualMachineName, options) {
3137
3744
  return tslib.__awaiter(this, void 0, void 0, function* () {
3138
3745
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3139
3746
  return this.client.sendOperationRequest(args, spec);
3140
3747
  });
3141
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3748
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3142
3749
  var _a;
3143
3750
  let currentRawResponse = undefined;
3144
3751
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -3157,42 +3764,46 @@ class SqlVirtualMachinesImpl {
3157
3764
  }
3158
3765
  };
3159
3766
  });
3160
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineName, options }, deleteOperationSpec);
3161
- const poller = new coreLro.LroEngine(lro, {
3162
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3163
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3767
+ const lro = createLroSpec({
3768
+ sendOperationFn,
3769
+ args: { resourceGroupName, sqlVirtualMachineName, options },
3770
+ spec: startAssessmentOperationSpec
3771
+ });
3772
+ const poller = yield coreLro.createHttpPoller(lro, {
3773
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3774
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3775
+ resourceLocationConfig: "location"
3164
3776
  });
3165
3777
  yield poller.poll();
3166
3778
  return poller;
3167
3779
  });
3168
3780
  }
3169
3781
  /**
3170
- * Deletes a SQL virtual machine.
3782
+ * Starts SQL best practices Assessment on SQL virtual machine.
3171
3783
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3172
3784
  * value from the Azure Resource Manager API or the portal.
3173
3785
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3174
3786
  * @param options The options parameters.
3175
3787
  */
3176
- beginDeleteAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3788
+ beginStartAssessmentAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3177
3789
  return tslib.__awaiter(this, void 0, void 0, function* () {
3178
- const poller = yield this.beginDelete(resourceGroupName, sqlVirtualMachineName, options);
3790
+ const poller = yield this.beginStartAssessment(resourceGroupName, sqlVirtualMachineName, options);
3179
3791
  return poller.pollUntilDone();
3180
3792
  });
3181
3793
  }
3182
3794
  /**
3183
- * Updates a SQL virtual machine.
3795
+ * Uninstalls and reinstalls the SQL IaaS Extension.
3184
3796
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3185
3797
  * value from the Azure Resource Manager API or the portal.
3186
3798
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3187
- * @param parameters The SQL virtual machine.
3188
3799
  * @param options The options parameters.
3189
3800
  */
3190
- beginUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3801
+ beginRedeploy(resourceGroupName, sqlVirtualMachineName, options) {
3191
3802
  return tslib.__awaiter(this, void 0, void 0, function* () {
3192
3803
  const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3193
3804
  return this.client.sendOperationRequest(args, spec);
3194
3805
  });
3195
- const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3806
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
3196
3807
  var _a;
3197
3808
  let currentRawResponse = undefined;
3198
3809
  const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
@@ -3211,38 +3822,33 @@ class SqlVirtualMachinesImpl {
3211
3822
  }
3212
3823
  };
3213
3824
  });
3214
- const lro = new LroImpl(sendOperation, { resourceGroupName, sqlVirtualMachineName, parameters, options }, updateOperationSpec);
3215
- const poller = new coreLro.LroEngine(lro, {
3216
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3217
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
3825
+ const lro = createLroSpec({
3826
+ sendOperationFn,
3827
+ args: { resourceGroupName, sqlVirtualMachineName, options },
3828
+ spec: redeployOperationSpec
3829
+ });
3830
+ const poller = yield coreLro.createHttpPoller(lro, {
3831
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
3832
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
3833
+ resourceLocationConfig: "location"
3218
3834
  });
3219
3835
  yield poller.poll();
3220
3836
  return poller;
3221
3837
  });
3222
3838
  }
3223
3839
  /**
3224
- * Updates a SQL virtual machine.
3840
+ * Uninstalls and reinstalls the SQL IaaS Extension.
3225
3841
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3226
3842
  * value from the Azure Resource Manager API or the portal.
3227
3843
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
3228
- * @param parameters The SQL virtual machine.
3229
3844
  * @param options The options parameters.
3230
3845
  */
3231
- beginUpdateAndWait(resourceGroupName, sqlVirtualMachineName, parameters, options) {
3846
+ beginRedeployAndWait(resourceGroupName, sqlVirtualMachineName, options) {
3232
3847
  return tslib.__awaiter(this, void 0, void 0, function* () {
3233
- const poller = yield this.beginUpdate(resourceGroupName, sqlVirtualMachineName, parameters, options);
3848
+ const poller = yield this.beginRedeploy(resourceGroupName, sqlVirtualMachineName, options);
3234
3849
  return poller.pollUntilDone();
3235
3850
  });
3236
3851
  }
3237
- /**
3238
- * Gets all SQL virtual machines in a resource group.
3239
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
3240
- * value from the Azure Resource Manager API or the portal.
3241
- * @param options The options parameters.
3242
- */
3243
- _listByResourceGroup(resourceGroupName, options) {
3244
- return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
3245
- }
3246
3852
  /**
3247
3853
  * ListBySqlVmGroupNext
3248
3854
  * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
@@ -3274,7 +3880,7 @@ class SqlVirtualMachinesImpl {
3274
3880
  }
3275
3881
  }
3276
3882
  // Operation Specifications
3277
- const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
3883
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
3278
3884
  const listBySqlVmGroupOperationSpec = {
3279
3885
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines",
3280
3886
  httpMethod: "GET",
@@ -3282,7 +3888,9 @@ const listBySqlVmGroupOperationSpec = {
3282
3888
  200: {
3283
3889
  bodyMapper: SqlVirtualMachineListResult
3284
3890
  },
3285
- default: {}
3891
+ default: {
3892
+ bodyMapper: ErrorResponse
3893
+ }
3286
3894
  },
3287
3895
  queryParameters: [apiVersion],
3288
3896
  urlParameters: [
@@ -3292,7 +3900,7 @@ const listBySqlVmGroupOperationSpec = {
3292
3900
  subscriptionId
3293
3901
  ],
3294
3902
  headerParameters: [accept],
3295
- serializer
3903
+ serializer: serializer$1
3296
3904
  };
3297
3905
  const listOperationSpec = {
3298
3906
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
@@ -3301,38 +3909,14 @@ const listOperationSpec = {
3301
3909
  200: {
3302
3910
  bodyMapper: SqlVirtualMachineListResult
3303
3911
  },
3304
- default: {}
3912
+ default: {
3913
+ bodyMapper: ErrorResponse
3914
+ }
3305
3915
  },
3306
3916
  queryParameters: [apiVersion],
3307
3917
  urlParameters: [$host, subscriptionId],
3308
3918
  headerParameters: [accept],
3309
- serializer
3310
- };
3311
- const startAssessmentOperationSpec = {
3312
- path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment",
3313
- httpMethod: "POST",
3314
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
3315
- queryParameters: [apiVersion],
3316
- urlParameters: [
3317
- $host,
3318
- resourceGroupName,
3319
- subscriptionId,
3320
- sqlVirtualMachineName
3321
- ],
3322
- serializer
3323
- };
3324
- const redeployOperationSpec = {
3325
- path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy",
3326
- httpMethod: "POST",
3327
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
3328
- queryParameters: [apiVersion],
3329
- urlParameters: [
3330
- $host,
3331
- resourceGroupName,
3332
- subscriptionId,
3333
- sqlVirtualMachineName
3334
- ],
3335
- serializer
3919
+ serializer: serializer$1
3336
3920
  };
3337
3921
  const getOperationSpec = {
3338
3922
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
@@ -3341,7 +3925,9 @@ const getOperationSpec = {
3341
3925
  200: {
3342
3926
  bodyMapper: SqlVirtualMachine
3343
3927
  },
3344
- default: {}
3928
+ default: {
3929
+ bodyMapper: ErrorResponse
3930
+ }
3345
3931
  },
3346
3932
  queryParameters: [expand, apiVersion],
3347
3933
  urlParameters: [
@@ -3351,7 +3937,7 @@ const getOperationSpec = {
3351
3937
  sqlVirtualMachineName
3352
3938
  ],
3353
3939
  headerParameters: [accept],
3354
- serializer
3940
+ serializer: serializer$1
3355
3941
  };
3356
3942
  const createOrUpdateOperationSpec = {
3357
3943
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
@@ -3369,7 +3955,9 @@ const createOrUpdateOperationSpec = {
3369
3955
  204: {
3370
3956
  bodyMapper: SqlVirtualMachine
3371
3957
  },
3372
- default: {}
3958
+ default: {
3959
+ bodyMapper: ErrorResponse
3960
+ }
3373
3961
  },
3374
3962
  requestBody: parameters3,
3375
3963
  queryParameters: [apiVersion],
@@ -3381,12 +3969,20 @@ const createOrUpdateOperationSpec = {
3381
3969
  ],
3382
3970
  headerParameters: [accept, contentType],
3383
3971
  mediaType: "json",
3384
- serializer
3972
+ serializer: serializer$1
3385
3973
  };
3386
3974
  const deleteOperationSpec = {
3387
3975
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
3388
3976
  httpMethod: "DELETE",
3389
- responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
3977
+ responses: {
3978
+ 200: {},
3979
+ 201: {},
3980
+ 202: {},
3981
+ 204: {},
3982
+ default: {
3983
+ bodyMapper: ErrorResponse
3984
+ }
3985
+ },
3390
3986
  queryParameters: [apiVersion],
3391
3987
  urlParameters: [
3392
3988
  $host,
@@ -3394,7 +3990,8 @@ const deleteOperationSpec = {
3394
3990
  subscriptionId,
3395
3991
  sqlVirtualMachineName
3396
3992
  ],
3397
- serializer
3993
+ headerParameters: [accept],
3994
+ serializer: serializer$1
3398
3995
  };
3399
3996
  const updateOperationSpec = {
3400
3997
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
@@ -3412,7 +4009,9 @@ const updateOperationSpec = {
3412
4009
  204: {
3413
4010
  bodyMapper: SqlVirtualMachine
3414
4011
  },
3415
- default: {}
4012
+ default: {
4013
+ bodyMapper: ErrorResponse
4014
+ }
3416
4015
  },
3417
4016
  requestBody: parameters4,
3418
4017
  queryParameters: [apiVersion],
@@ -3424,7 +4023,7 @@ const updateOperationSpec = {
3424
4023
  ],
3425
4024
  headerParameters: [accept, contentType],
3426
4025
  mediaType: "json",
3427
- serializer
4026
+ serializer: serializer$1
3428
4027
  };
3429
4028
  const listByResourceGroupOperationSpec = {
3430
4029
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
@@ -3433,7 +4032,9 @@ const listByResourceGroupOperationSpec = {
3433
4032
  200: {
3434
4033
  bodyMapper: SqlVirtualMachineListResult
3435
4034
  },
3436
- default: {}
4035
+ default: {
4036
+ bodyMapper: ErrorResponse
4037
+ }
3437
4038
  },
3438
4039
  queryParameters: [apiVersion],
3439
4040
  urlParameters: [
@@ -3442,7 +4043,51 @@ const listByResourceGroupOperationSpec = {
3442
4043
  subscriptionId
3443
4044
  ],
3444
4045
  headerParameters: [accept],
3445
- serializer
4046
+ serializer: serializer$1
4047
+ };
4048
+ const startAssessmentOperationSpec = {
4049
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/startAssessment",
4050
+ httpMethod: "POST",
4051
+ responses: {
4052
+ 200: {},
4053
+ 201: {},
4054
+ 202: {},
4055
+ 204: {},
4056
+ default: {
4057
+ bodyMapper: ErrorResponse
4058
+ }
4059
+ },
4060
+ queryParameters: [apiVersion],
4061
+ urlParameters: [
4062
+ $host,
4063
+ resourceGroupName,
4064
+ subscriptionId,
4065
+ sqlVirtualMachineName
4066
+ ],
4067
+ headerParameters: [accept],
4068
+ serializer: serializer$1
4069
+ };
4070
+ const redeployOperationSpec = {
4071
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/redeploy",
4072
+ httpMethod: "POST",
4073
+ responses: {
4074
+ 200: {},
4075
+ 201: {},
4076
+ 202: {},
4077
+ 204: {},
4078
+ default: {
4079
+ bodyMapper: ErrorResponse
4080
+ }
4081
+ },
4082
+ queryParameters: [apiVersion],
4083
+ urlParameters: [
4084
+ $host,
4085
+ resourceGroupName,
4086
+ subscriptionId,
4087
+ sqlVirtualMachineName
4088
+ ],
4089
+ headerParameters: [accept],
4090
+ serializer: serializer$1
3446
4091
  };
3447
4092
  const listBySqlVmGroupNextOperationSpec = {
3448
4093
  path: "{nextLink}",
@@ -3451,9 +4096,10 @@ const listBySqlVmGroupNextOperationSpec = {
3451
4096
  200: {
3452
4097
  bodyMapper: SqlVirtualMachineListResult
3453
4098
  },
3454
- default: {}
4099
+ default: {
4100
+ bodyMapper: ErrorResponse
4101
+ }
3455
4102
  },
3456
- queryParameters: [apiVersion],
3457
4103
  urlParameters: [
3458
4104
  $host,
3459
4105
  resourceGroupName,
@@ -3462,7 +4108,7 @@ const listBySqlVmGroupNextOperationSpec = {
3462
4108
  nextLink
3463
4109
  ],
3464
4110
  headerParameters: [accept],
3465
- serializer
4111
+ serializer: serializer$1
3466
4112
  };
3467
4113
  const listNextOperationSpec = {
3468
4114
  path: "{nextLink}",
@@ -3471,16 +4117,17 @@ const listNextOperationSpec = {
3471
4117
  200: {
3472
4118
  bodyMapper: SqlVirtualMachineListResult
3473
4119
  },
3474
- default: {}
4120
+ default: {
4121
+ bodyMapper: ErrorResponse
4122
+ }
3475
4123
  },
3476
- queryParameters: [apiVersion],
3477
4124
  urlParameters: [
3478
4125
  $host,
3479
4126
  subscriptionId,
3480
4127
  nextLink
3481
4128
  ],
3482
4129
  headerParameters: [accept],
3483
- serializer
4130
+ serializer: serializer$1
3484
4131
  };
3485
4132
  const listByResourceGroupNextOperationSpec = {
3486
4133
  path: "{nextLink}",
@@ -3489,9 +4136,10 @@ const listByResourceGroupNextOperationSpec = {
3489
4136
  200: {
3490
4137
  bodyMapper: SqlVirtualMachineListResult
3491
4138
  },
3492
- default: {}
4139
+ default: {
4140
+ bodyMapper: ErrorResponse
4141
+ }
3493
4142
  },
3494
- queryParameters: [apiVersion],
3495
4143
  urlParameters: [
3496
4144
  $host,
3497
4145
  resourceGroupName,
@@ -3499,6 +4147,118 @@ const listByResourceGroupNextOperationSpec = {
3499
4147
  nextLink
3500
4148
  ],
3501
4149
  headerParameters: [accept],
4150
+ serializer: serializer$1
4151
+ };
4152
+
4153
+ /*
4154
+ * Copyright (c) Microsoft Corporation.
4155
+ * Licensed under the MIT License.
4156
+ *
4157
+ * Code generated by Microsoft (R) AutoRest Code Generator.
4158
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
4159
+ */
4160
+ /** Class containing SqlVirtualMachineTroubleshoot operations. */
4161
+ class SqlVirtualMachineTroubleshootImpl {
4162
+ /**
4163
+ * Initialize a new instance of the class SqlVirtualMachineTroubleshoot class.
4164
+ * @param client Reference to the service client
4165
+ */
4166
+ constructor(client) {
4167
+ this.client = client;
4168
+ }
4169
+ /**
4170
+ * Starts SQL virtual machine troubleshooting.
4171
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
4172
+ * value from the Azure Resource Manager API or the portal.
4173
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
4174
+ * @param parameters The SQL virtual machine troubleshooting entity.
4175
+ * @param options The options parameters.
4176
+ */
4177
+ beginTroubleshoot(resourceGroupName, sqlVirtualMachineName, parameters, options) {
4178
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4179
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
4180
+ return this.client.sendOperationRequest(args, spec);
4181
+ });
4182
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
4183
+ var _a;
4184
+ let currentRawResponse = undefined;
4185
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
4186
+ const callback = (rawResponse, flatResponse) => {
4187
+ currentRawResponse = rawResponse;
4188
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
4189
+ };
4190
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
4191
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
4192
+ return {
4193
+ flatResponse,
4194
+ rawResponse: {
4195
+ statusCode: currentRawResponse.status,
4196
+ body: currentRawResponse.parsedBody,
4197
+ headers: currentRawResponse.headers.toJSON()
4198
+ }
4199
+ };
4200
+ });
4201
+ const lro = createLroSpec({
4202
+ sendOperationFn,
4203
+ args: { resourceGroupName, sqlVirtualMachineName, parameters, options },
4204
+ spec: troubleshootOperationSpec
4205
+ });
4206
+ const poller = yield coreLro.createHttpPoller(lro, {
4207
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
4208
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
4209
+ resourceLocationConfig: "location"
4210
+ });
4211
+ yield poller.poll();
4212
+ return poller;
4213
+ });
4214
+ }
4215
+ /**
4216
+ * Starts SQL virtual machine troubleshooting.
4217
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
4218
+ * value from the Azure Resource Manager API or the portal.
4219
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
4220
+ * @param parameters The SQL virtual machine troubleshooting entity.
4221
+ * @param options The options parameters.
4222
+ */
4223
+ beginTroubleshootAndWait(resourceGroupName, sqlVirtualMachineName, parameters, options) {
4224
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4225
+ const poller = yield this.beginTroubleshoot(resourceGroupName, sqlVirtualMachineName, parameters, options);
4226
+ return poller.pollUntilDone();
4227
+ });
4228
+ }
4229
+ }
4230
+ // Operation Specifications
4231
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
4232
+ const troubleshootOperationSpec = {
4233
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/troubleshoot",
4234
+ httpMethod: "POST",
4235
+ responses: {
4236
+ 200: {
4237
+ bodyMapper: SqlVmTroubleshooting
4238
+ },
4239
+ 201: {
4240
+ bodyMapper: SqlVmTroubleshooting
4241
+ },
4242
+ 202: {
4243
+ bodyMapper: SqlVmTroubleshooting
4244
+ },
4245
+ 204: {
4246
+ bodyMapper: SqlVmTroubleshooting
4247
+ },
4248
+ default: {
4249
+ bodyMapper: ErrorResponse
4250
+ }
4251
+ },
4252
+ requestBody: parameters5,
4253
+ queryParameters: [apiVersion],
4254
+ urlParameters: [
4255
+ $host,
4256
+ resourceGroupName,
4257
+ subscriptionId,
4258
+ sqlVirtualMachineName
4259
+ ],
4260
+ headerParameters: [accept, contentType],
4261
+ mediaType: "json",
3502
4262
  serializer
3503
4263
  };
3504
4264
 
@@ -3517,7 +4277,7 @@ class SqlVirtualMachineManagementClient extends coreClient__namespace.ServiceCli
3517
4277
  * @param options The parameter options
3518
4278
  */
3519
4279
  constructor(credentials, subscriptionId, options) {
3520
- var _a, _b;
4280
+ var _a, _b, _c;
3521
4281
  if (credentials === undefined) {
3522
4282
  throw new Error("'credentials' cannot be null");
3523
4283
  }
@@ -3532,16 +4292,13 @@ class SqlVirtualMachineManagementClient extends coreClient__namespace.ServiceCli
3532
4292
  requestContentType: "application/json; charset=utf-8",
3533
4293
  credential: credentials
3534
4294
  };
3535
- const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.6`;
4295
+ const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.8`;
3536
4296
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3537
4297
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3538
4298
  : `${packageDetails}`;
3539
- if (!options.credentialScopes) {
3540
- options.credentialScopes = ["https://management.azure.com/.default"];
3541
- }
3542
4299
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
3543
4300
  userAgentPrefix
3544
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
4301
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3545
4302
  super(optionsWithDefaults);
3546
4303
  let bearerTokenAuthenticationPolicyFound = false;
3547
4304
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
@@ -3558,7 +4315,7 @@ class SqlVirtualMachineManagementClient extends coreClient__namespace.ServiceCli
3558
4315
  });
3559
4316
  this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3560
4317
  credential: credentials,
3561
- scopes: `${optionsWithDefaults.credentialScopes}`,
4318
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
3562
4319
  challengeCallbacks: {
3563
4320
  authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3564
4321
  }
@@ -3568,11 +4325,12 @@ class SqlVirtualMachineManagementClient extends coreClient__namespace.ServiceCli
3568
4325
  this.subscriptionId = subscriptionId;
3569
4326
  // Assigning values to Constant parameters
3570
4327
  this.$host = options.$host || "https://management.azure.com";
3571
- this.apiVersion = options.apiVersion || "2022-07-01-preview";
4328
+ this.apiVersion = options.apiVersion || "2022-08-01-preview";
3572
4329
  this.availabilityGroupListeners = new AvailabilityGroupListenersImpl(this);
3573
4330
  this.operations = new OperationsImpl(this);
3574
4331
  this.sqlVirtualMachineGroups = new SqlVirtualMachineGroupsImpl(this);
3575
4332
  this.sqlVirtualMachines = new SqlVirtualMachinesImpl(this);
4333
+ this.sqlVirtualMachineTroubleshoot = new SqlVirtualMachineTroubleshootImpl(this);
3576
4334
  this.addCustomApiVersionPolicy(options.apiVersion);
3577
4335
  }
3578
4336
  /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
@@ -3605,4 +4363,5 @@ class SqlVirtualMachineManagementClient extends coreClient__namespace.ServiceCli
3605
4363
  }
3606
4364
 
3607
4365
  exports.SqlVirtualMachineManagementClient = SqlVirtualMachineManagementClient;
4366
+ exports.getContinuationToken = getContinuationToken;
3608
4367
  //# sourceMappingURL=index.js.map