@azure/arm-sqlvirtualmachine 4.1.1 → 5.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -85
  4. package/dist/index.js +2827 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +783 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +103 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +31 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/{esm → dist-esm/src}/models/mappers.js +320 -368
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +18 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +143 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/availabilityGroupListeners.d.ts +89 -0
  29. package/dist-esm/src/operations/availabilityGroupListeners.d.ts.map +1 -0
  30. package/dist-esm/src/operations/availabilityGroupListeners.js +338 -0
  31. package/dist-esm/src/operations/availabilityGroupListeners.js.map +1 -0
  32. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  33. package/dist-esm/src/operations/index.d.ts.map +1 -0
  34. package/{esm → dist-esm/src}/operations/index.js +3 -5
  35. package/dist-esm/src/operations/index.js.map +1 -0
  36. package/dist-esm/src/operations/operations.d.ts +32 -0
  37. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  38. package/dist-esm/src/operations/operations.js +116 -0
  39. package/dist-esm/src/operations/operations.js.map +1 -0
  40. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts +117 -0
  41. package/dist-esm/src/operations/sqlVirtualMachineGroups.d.ts.map +1 -0
  42. package/dist-esm/src/operations/sqlVirtualMachineGroups.js +487 -0
  43. package/dist-esm/src/operations/sqlVirtualMachineGroups.js.map +1 -0
  44. package/dist-esm/src/operations/sqlVirtualMachines.d.ts +144 -0
  45. package/dist-esm/src/operations/sqlVirtualMachines.d.ts.map +1 -0
  46. package/dist-esm/src/operations/sqlVirtualMachines.js +598 -0
  47. package/dist-esm/src/operations/sqlVirtualMachines.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts +62 -0
  49. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.js +9 -0
  51. package/dist-esm/src/operationsInterfaces/availabilityGroupListeners.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  53. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  55. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  57. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts +79 -0
  61. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/sqlVirtualMachineGroups.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts +87 -0
  65. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/sqlVirtualMachines.js.map +1 -0
  68. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts +21 -0
  69. package/dist-esm/src/sqlVirtualMachineManagementClient.d.ts.map +1 -0
  70. package/dist-esm/src/sqlVirtualMachineManagementClient.js +54 -0
  71. package/dist-esm/src/sqlVirtualMachineManagementClient.js.map +1 -0
  72. package/dist-esm/test/sampleTest.d.ts +2 -0
  73. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  74. package/dist-esm/test/sampleTest.js +40 -0
  75. package/dist-esm/test/sampleTest.js.map +1 -0
  76. package/package.json +65 -32
  77. package/review/arm-sqlvirtualmachine.api.md +678 -0
  78. package/rollup.config.js +181 -30
  79. package/src/index.ts +12 -0
  80. package/src/lroImpl.ts +34 -0
  81. package/src/models/index.ts +629 -1065
  82. package/src/models/mappers.ts +328 -376
  83. package/src/models/parameters.ts +106 -41
  84. package/src/operations/availabilityGroupListeners.ts +366 -222
  85. package/src/operations/index.ts +3 -5
  86. package/src/operations/operations.ts +89 -79
  87. package/src/operations/sqlVirtualMachineGroups.ts +517 -344
  88. package/src/operations/sqlVirtualMachines.ts +641 -424
  89. package/src/operationsInterfaces/availabilityGroupListeners.ts +115 -0
  90. package/src/operationsInterfaces/index.ts +12 -0
  91. package/src/operationsInterfaces/operations.ts +22 -0
  92. package/src/operationsInterfaces/sqlVirtualMachineGroups.ts +147 -0
  93. package/src/operationsInterfaces/sqlVirtualMachines.ts +160 -0
  94. package/src/sqlVirtualMachineManagementClient.ts +78 -41
  95. package/tsconfig.json +3 -3
  96. package/types/arm-sqlvirtualmachine.d.ts +1141 -0
  97. package/types/tsdoc-metadata.json +11 -0
  98. package/dist/arm-sqlvirtualmachine.js +0 -2479
  99. package/dist/arm-sqlvirtualmachine.js.map +0 -1
  100. package/dist/arm-sqlvirtualmachine.min.js +0 -1
  101. package/dist/arm-sqlvirtualmachine.min.js.map +0 -1
  102. package/esm/models/availabilityGroupListenersMappers.d.ts +0 -2
  103. package/esm/models/availabilityGroupListenersMappers.d.ts.map +0 -1
  104. package/esm/models/availabilityGroupListenersMappers.js +0 -9
  105. package/esm/models/availabilityGroupListenersMappers.js.map +0 -1
  106. package/esm/models/index.d.ts +0 -1241
  107. package/esm/models/index.d.ts.map +0 -1
  108. package/esm/models/index.js +0 -8
  109. package/esm/models/index.js.map +0 -1
  110. package/esm/models/mappers.d.ts +0 -33
  111. package/esm/models/mappers.d.ts.map +0 -1
  112. package/esm/models/mappers.js.map +0 -1
  113. package/esm/models/operationsMappers.d.ts +0 -2
  114. package/esm/models/operationsMappers.d.ts.map +0 -1
  115. package/esm/models/operationsMappers.js +0 -9
  116. package/esm/models/operationsMappers.js.map +0 -1
  117. package/esm/models/parameters.d.ts +0 -11
  118. package/esm/models/parameters.d.ts.map +0 -1
  119. package/esm/models/parameters.js +0 -103
  120. package/esm/models/parameters.js.map +0 -1
  121. package/esm/models/sqlVirtualMachineGroupsMappers.d.ts +0 -2
  122. package/esm/models/sqlVirtualMachineGroupsMappers.d.ts.map +0 -1
  123. package/esm/models/sqlVirtualMachineGroupsMappers.js +0 -9
  124. package/esm/models/sqlVirtualMachineGroupsMappers.js.map +0 -1
  125. package/esm/models/sqlVirtualMachinesMappers.d.ts +0 -2
  126. package/esm/models/sqlVirtualMachinesMappers.d.ts.map +0 -1
  127. package/esm/models/sqlVirtualMachinesMappers.js +0 -9
  128. package/esm/models/sqlVirtualMachinesMappers.js.map +0 -1
  129. package/esm/operations/availabilityGroupListeners.d.ts +0 -125
  130. package/esm/operations/availabilityGroupListeners.d.ts.map +0 -1
  131. package/esm/operations/availabilityGroupListeners.js +0 -238
  132. package/esm/operations/availabilityGroupListeners.js.map +0 -1
  133. package/esm/operations/index.d.ts.map +0 -1
  134. package/esm/operations/index.js.map +0 -1
  135. package/esm/operations/operations.d.ts +0 -46
  136. package/esm/operations/operations.d.ts.map +0 -1
  137. package/esm/operations/operations.js +0 -77
  138. package/esm/operations/operations.js.map +0 -1
  139. package/esm/operations/sqlVirtualMachineGroups.d.ts +0 -168
  140. package/esm/operations/sqlVirtualMachineGroups.d.ts.map +0 -1
  141. package/esm/operations/sqlVirtualMachineGroups.js +0 -337
  142. package/esm/operations/sqlVirtualMachineGroups.js.map +0 -1
  143. package/esm/operations/sqlVirtualMachines.d.ts +0 -210
  144. package/esm/operations/sqlVirtualMachines.d.ts.map +0 -1
  145. package/esm/operations/sqlVirtualMachines.js +0 -395
  146. package/esm/operations/sqlVirtualMachines.js.map +0 -1
  147. package/esm/sqlVirtualMachineManagementClient.d.ts +0 -27
  148. package/esm/sqlVirtualMachineManagementClient.d.ts.map +0 -1
  149. package/esm/sqlVirtualMachineManagementClient.js +0 -41
  150. package/esm/sqlVirtualMachineManagementClient.js.map +0 -1
  151. package/esm/sqlVirtualMachineManagementClientContext.d.ts +0 -22
  152. package/esm/sqlVirtualMachineManagementClientContext.d.ts.map +0 -1
  153. package/esm/sqlVirtualMachineManagementClientContext.js +0 -61
  154. package/esm/sqlVirtualMachineManagementClientContext.js.map +0 -1
  155. package/src/models/availabilityGroupListenersMappers.ts +0 -34
  156. package/src/models/operationsMappers.ts +0 -14
  157. package/src/models/sqlVirtualMachineGroupsMappers.ts +0 -35
  158. package/src/models/sqlVirtualMachinesMappers.ts +0 -35
  159. package/src/sqlVirtualMachineManagementClientContext.ts +0 -68
@@ -1,465 +1,667 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as msRestAzure from "@azure/ms-rest-azure-js";
13
- import * as Models from "../models";
14
- import * as Mappers from "../models/sqlVirtualMachinesMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { SqlVirtualMachines } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
15
13
  import * as Parameters from "../models/parameters";
16
- import { SqlVirtualMachineManagementClientContext } from "../sqlVirtualMachineManagementClientContext";
14
+ import { SqlVirtualMachineManagementClient } from "../sqlVirtualMachineManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ SqlVirtualMachine,
19
+ SqlVirtualMachinesListBySqlVmGroupNextOptionalParams,
20
+ SqlVirtualMachinesListBySqlVmGroupOptionalParams,
21
+ SqlVirtualMachinesListNextOptionalParams,
22
+ SqlVirtualMachinesListOptionalParams,
23
+ SqlVirtualMachinesListByResourceGroupNextOptionalParams,
24
+ SqlVirtualMachinesListByResourceGroupOptionalParams,
25
+ SqlVirtualMachinesListBySqlVmGroupResponse,
26
+ SqlVirtualMachinesListResponse,
27
+ SqlVirtualMachinesGetOptionalParams,
28
+ SqlVirtualMachinesGetResponse,
29
+ SqlVirtualMachinesCreateOrUpdateOptionalParams,
30
+ SqlVirtualMachinesCreateOrUpdateResponse,
31
+ SqlVirtualMachinesDeleteOptionalParams,
32
+ SqlVirtualMachineUpdate,
33
+ SqlVirtualMachinesUpdateOptionalParams,
34
+ SqlVirtualMachinesUpdateResponse,
35
+ SqlVirtualMachinesListByResourceGroupResponse,
36
+ SqlVirtualMachinesListBySqlVmGroupNextResponse,
37
+ SqlVirtualMachinesListNextResponse,
38
+ SqlVirtualMachinesListByResourceGroupNextResponse
39
+ } from "../models";
17
40
 
18
- /** Class representing a SqlVirtualMachines. */
19
- export class SqlVirtualMachines {
20
- private readonly client: SqlVirtualMachineManagementClientContext;
41
+ /// <reference lib="esnext.asynciterable" />
42
+ /** Class containing SqlVirtualMachines operations. */
43
+ export class SqlVirtualMachinesImpl implements SqlVirtualMachines {
44
+ private readonly client: SqlVirtualMachineManagementClient;
21
45
 
22
46
  /**
23
- * Create a SqlVirtualMachines.
24
- * @param {SqlVirtualMachineManagementClientContext} client Reference to the service client.
47
+ * Initialize a new instance of the class SqlVirtualMachines class.
48
+ * @param client Reference to the service client
25
49
  */
26
- constructor(client: SqlVirtualMachineManagementClientContext) {
50
+ constructor(client: SqlVirtualMachineManagementClient) {
27
51
  this.client = client;
28
52
  }
29
53
 
30
54
  /**
31
55
  * Gets the list of sql virtual machines in a SQL virtual machine group.
32
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
33
- * this value from the Azure Resource Manager API or the portal.
56
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
57
+ * value from the Azure Resource Manager API or the portal.
34
58
  * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group.
35
- * @param [options] The optional parameters
36
- * @returns Promise<Models.SqlVirtualMachinesListBySqlVmGroupResponse>
59
+ * @param options The options parameters.
37
60
  */
38
- listBySqlVmGroup(resourceGroupName: string, sqlVirtualMachineGroupName: string, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListBySqlVmGroupResponse>;
39
- /**
40
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
41
- * this value from the Azure Resource Manager API or the portal.
42
- * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group.
43
- * @param callback The callback
44
- */
45
- listBySqlVmGroup(resourceGroupName: string, sqlVirtualMachineGroupName: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
46
- /**
47
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
48
- * this value from the Azure Resource Manager API or the portal.
49
- * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group.
50
- * @param options The optional parameters
51
- * @param callback The callback
52
- */
53
- listBySqlVmGroup(resourceGroupName: string, sqlVirtualMachineGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
54
- listBySqlVmGroup(resourceGroupName: string, sqlVirtualMachineGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListBySqlVmGroupResponse> {
55
- return this.client.sendOperationRequest(
56
- {
61
+ public listBySqlVmGroup(
62
+ resourceGroupName: string,
63
+ sqlVirtualMachineGroupName: string,
64
+ options?: SqlVirtualMachinesListBySqlVmGroupOptionalParams
65
+ ): PagedAsyncIterableIterator<SqlVirtualMachine> {
66
+ const iter = this.listBySqlVmGroupPagingAll(
67
+ resourceGroupName,
68
+ sqlVirtualMachineGroupName,
69
+ options
70
+ );
71
+ return {
72
+ next() {
73
+ return iter.next();
74
+ },
75
+ [Symbol.asyncIterator]() {
76
+ return this;
77
+ },
78
+ byPage: () => {
79
+ return this.listBySqlVmGroupPagingPage(
80
+ resourceGroupName,
81
+ sqlVirtualMachineGroupName,
82
+ options
83
+ );
84
+ }
85
+ };
86
+ }
87
+
88
+ private async *listBySqlVmGroupPagingPage(
89
+ resourceGroupName: string,
90
+ sqlVirtualMachineGroupName: string,
91
+ options?: SqlVirtualMachinesListBySqlVmGroupOptionalParams
92
+ ): AsyncIterableIterator<SqlVirtualMachine[]> {
93
+ let result = await this._listBySqlVmGroup(
94
+ resourceGroupName,
95
+ sqlVirtualMachineGroupName,
96
+ options
97
+ );
98
+ yield result.value || [];
99
+ let continuationToken = result.nextLink;
100
+ while (continuationToken) {
101
+ result = await this._listBySqlVmGroupNext(
57
102
  resourceGroupName,
58
103
  sqlVirtualMachineGroupName,
104
+ continuationToken,
59
105
  options
60
- },
61
- listBySqlVmGroupOperationSpec,
62
- callback) as Promise<Models.SqlVirtualMachinesListBySqlVmGroupResponse>;
106
+ );
107
+ continuationToken = result.nextLink;
108
+ yield result.value || [];
109
+ }
110
+ }
111
+
112
+ private async *listBySqlVmGroupPagingAll(
113
+ resourceGroupName: string,
114
+ sqlVirtualMachineGroupName: string,
115
+ options?: SqlVirtualMachinesListBySqlVmGroupOptionalParams
116
+ ): AsyncIterableIterator<SqlVirtualMachine> {
117
+ for await (const page of this.listBySqlVmGroupPagingPage(
118
+ resourceGroupName,
119
+ sqlVirtualMachineGroupName,
120
+ options
121
+ )) {
122
+ yield* page;
123
+ }
63
124
  }
64
125
 
65
126
  /**
66
127
  * Gets all SQL virtual machines in a subscription.
67
- * @param [options] The optional parameters
68
- * @returns Promise<Models.SqlVirtualMachinesListResponse>
69
- */
70
- list(options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListResponse>;
71
- /**
72
- * @param callback The callback
128
+ * @param options The options parameters.
73
129
  */
74
- list(callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
130
+ public list(
131
+ options?: SqlVirtualMachinesListOptionalParams
132
+ ): PagedAsyncIterableIterator<SqlVirtualMachine> {
133
+ const iter = this.listPagingAll(options);
134
+ return {
135
+ next() {
136
+ return iter.next();
137
+ },
138
+ [Symbol.asyncIterator]() {
139
+ return this;
140
+ },
141
+ byPage: () => {
142
+ return this.listPagingPage(options);
143
+ }
144
+ };
145
+ }
146
+
147
+ private async *listPagingPage(
148
+ options?: SqlVirtualMachinesListOptionalParams
149
+ ): AsyncIterableIterator<SqlVirtualMachine[]> {
150
+ let result = await this._list(options);
151
+ yield result.value || [];
152
+ let continuationToken = result.nextLink;
153
+ while (continuationToken) {
154
+ result = await this._listNext(continuationToken, options);
155
+ continuationToken = result.nextLink;
156
+ yield result.value || [];
157
+ }
158
+ }
159
+
160
+ private async *listPagingAll(
161
+ options?: SqlVirtualMachinesListOptionalParams
162
+ ): AsyncIterableIterator<SqlVirtualMachine> {
163
+ for await (const page of this.listPagingPage(options)) {
164
+ yield* page;
165
+ }
166
+ }
167
+
75
168
  /**
76
- * @param options The optional parameters
77
- * @param callback The callback
169
+ * Gets all SQL virtual machines in a resource group.
170
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
171
+ * value from the Azure Resource Manager API or the portal.
172
+ * @param options The options parameters.
78
173
  */
79
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
80
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListResponse> {
81
- return this.client.sendOperationRequest(
82
- {
83
- options
174
+ public listByResourceGroup(
175
+ resourceGroupName: string,
176
+ options?: SqlVirtualMachinesListByResourceGroupOptionalParams
177
+ ): PagedAsyncIterableIterator<SqlVirtualMachine> {
178
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
179
+ return {
180
+ next() {
181
+ return iter.next();
182
+ },
183
+ [Symbol.asyncIterator]() {
184
+ return this;
84
185
  },
85
- listOperationSpec,
86
- callback) as Promise<Models.SqlVirtualMachinesListResponse>;
186
+ byPage: () => {
187
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
188
+ }
189
+ };
190
+ }
191
+
192
+ private async *listByResourceGroupPagingPage(
193
+ resourceGroupName: string,
194
+ options?: SqlVirtualMachinesListByResourceGroupOptionalParams
195
+ ): AsyncIterableIterator<SqlVirtualMachine[]> {
196
+ let result = await this._listByResourceGroup(resourceGroupName, options);
197
+ yield result.value || [];
198
+ let continuationToken = result.nextLink;
199
+ while (continuationToken) {
200
+ result = await this._listByResourceGroupNext(
201
+ resourceGroupName,
202
+ continuationToken,
203
+ options
204
+ );
205
+ continuationToken = result.nextLink;
206
+ yield result.value || [];
207
+ }
208
+ }
209
+
210
+ private async *listByResourceGroupPagingAll(
211
+ resourceGroupName: string,
212
+ options?: SqlVirtualMachinesListByResourceGroupOptionalParams
213
+ ): AsyncIterableIterator<SqlVirtualMachine> {
214
+ for await (const page of this.listByResourceGroupPagingPage(
215
+ resourceGroupName,
216
+ options
217
+ )) {
218
+ yield* page;
219
+ }
87
220
  }
88
221
 
89
222
  /**
90
- * Gets a SQL virtual machine.
91
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
92
- * this value from the Azure Resource Manager API or the portal.
93
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
94
- * @param [options] The optional parameters
95
- * @returns Promise<Models.SqlVirtualMachinesGetResponse>
223
+ * Gets the list of sql virtual machines in a SQL virtual machine group.
224
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
225
+ * value from the Azure Resource Manager API or the portal.
226
+ * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group.
227
+ * @param options The options parameters.
96
228
  */
97
- get(resourceGroupName: string, sqlVirtualMachineName: string, options?: Models.SqlVirtualMachinesGetOptionalParams): Promise<Models.SqlVirtualMachinesGetResponse>;
229
+ private _listBySqlVmGroup(
230
+ resourceGroupName: string,
231
+ sqlVirtualMachineGroupName: string,
232
+ options?: SqlVirtualMachinesListBySqlVmGroupOptionalParams
233
+ ): Promise<SqlVirtualMachinesListBySqlVmGroupResponse> {
234
+ return this.client.sendOperationRequest(
235
+ { resourceGroupName, sqlVirtualMachineGroupName, options },
236
+ listBySqlVmGroupOperationSpec
237
+ );
238
+ }
239
+
98
240
  /**
99
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
100
- * this value from the Azure Resource Manager API or the portal.
101
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
102
- * @param callback The callback
241
+ * Gets all SQL virtual machines in a subscription.
242
+ * @param options The options parameters.
103
243
  */
104
- get(resourceGroupName: string, sqlVirtualMachineName: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachine>): void;
244
+ private _list(
245
+ options?: SqlVirtualMachinesListOptionalParams
246
+ ): Promise<SqlVirtualMachinesListResponse> {
247
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
248
+ }
249
+
105
250
  /**
106
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
107
- * this value from the Azure Resource Manager API or the portal.
251
+ * Gets a SQL virtual machine.
252
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
253
+ * value from the Azure Resource Manager API or the portal.
108
254
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
109
- * @param options The optional parameters
110
- * @param callback The callback
255
+ * @param options The options parameters.
111
256
  */
112
- get(resourceGroupName: string, sqlVirtualMachineName: string, options: Models.SqlVirtualMachinesGetOptionalParams, callback: msRest.ServiceCallback<Models.SqlVirtualMachine>): void;
113
- get(resourceGroupName: string, sqlVirtualMachineName: string, options?: Models.SqlVirtualMachinesGetOptionalParams | msRest.ServiceCallback<Models.SqlVirtualMachine>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachine>): Promise<Models.SqlVirtualMachinesGetResponse> {
257
+ get(
258
+ resourceGroupName: string,
259
+ sqlVirtualMachineName: string,
260
+ options?: SqlVirtualMachinesGetOptionalParams
261
+ ): Promise<SqlVirtualMachinesGetResponse> {
114
262
  return this.client.sendOperationRequest(
115
- {
116
- resourceGroupName,
117
- sqlVirtualMachineName,
118
- options
119
- },
120
- getOperationSpec,
121
- callback) as Promise<Models.SqlVirtualMachinesGetResponse>;
263
+ { resourceGroupName, sqlVirtualMachineName, options },
264
+ getOperationSpec
265
+ );
122
266
  }
123
267
 
124
268
  /**
125
269
  * Creates or updates a SQL virtual machine.
126
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
127
- * this value from the Azure Resource Manager API or the portal.
270
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
271
+ * value from the Azure Resource Manager API or the portal.
128
272
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
129
273
  * @param parameters The SQL virtual machine.
130
- * @param [options] The optional parameters
131
- * @returns Promise<Models.SqlVirtualMachinesCreateOrUpdateResponse>
274
+ * @param options The options parameters.
132
275
  */
133
- createOrUpdate(resourceGroupName: string, sqlVirtualMachineName: string, parameters: Models.SqlVirtualMachine, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesCreateOrUpdateResponse> {
134
- return this.beginCreateOrUpdate(resourceGroupName,sqlVirtualMachineName,parameters,options)
135
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.SqlVirtualMachinesCreateOrUpdateResponse>;
136
- }
276
+ async beginCreateOrUpdate(
277
+ resourceGroupName: string,
278
+ sqlVirtualMachineName: string,
279
+ parameters: SqlVirtualMachine,
280
+ options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
281
+ ): Promise<
282
+ PollerLike<
283
+ PollOperationState<SqlVirtualMachinesCreateOrUpdateResponse>,
284
+ SqlVirtualMachinesCreateOrUpdateResponse
285
+ >
286
+ > {
287
+ const directSendOperation = async (
288
+ args: coreClient.OperationArguments,
289
+ spec: coreClient.OperationSpec
290
+ ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> => {
291
+ return this.client.sendOperationRequest(args, spec);
292
+ };
293
+ const sendOperation = async (
294
+ args: coreClient.OperationArguments,
295
+ spec: coreClient.OperationSpec
296
+ ) => {
297
+ let currentRawResponse:
298
+ | coreClient.FullOperationResponse
299
+ | undefined = undefined;
300
+ const providedCallback = args.options?.onResponse;
301
+ const callback: coreClient.RawResponseCallback = (
302
+ rawResponse: coreClient.FullOperationResponse,
303
+ flatResponse: unknown
304
+ ) => {
305
+ currentRawResponse = rawResponse;
306
+ providedCallback?.(rawResponse, flatResponse);
307
+ };
308
+ const updatedArgs = {
309
+ ...args,
310
+ options: {
311
+ ...args.options,
312
+ onResponse: callback
313
+ }
314
+ };
315
+ const flatResponse = await directSendOperation(updatedArgs, spec);
316
+ return {
317
+ flatResponse,
318
+ rawResponse: {
319
+ statusCode: currentRawResponse!.status,
320
+ body: currentRawResponse!.parsedBody,
321
+ headers: currentRawResponse!.headers.toJSON()
322
+ }
323
+ };
324
+ };
137
325
 
138
- /**
139
- * Deletes a SQL virtual machine.
140
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
141
- * this value from the Azure Resource Manager API or the portal.
142
- * @param sqlVirtualMachineName Name of the SQL virtual machine.
143
- * @param [options] The optional parameters
144
- * @returns Promise<msRest.RestResponse>
145
- */
146
- deleteMethod(resourceGroupName: string, sqlVirtualMachineName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
147
- return this.beginDeleteMethod(resourceGroupName,sqlVirtualMachineName,options)
148
- .then(lroPoller => lroPoller.pollUntilFinished());
326
+ const lro = new LroImpl(
327
+ sendOperation,
328
+ { resourceGroupName, sqlVirtualMachineName, parameters, options },
329
+ createOrUpdateOperationSpec
330
+ );
331
+ return new LroEngine(lro, {
332
+ resumeFrom: options?.resumeFrom,
333
+ intervalInMs: options?.updateIntervalInMs
334
+ });
149
335
  }
150
336
 
151
337
  /**
152
- * Updates a SQL virtual machine.
153
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
154
- * this value from the Azure Resource Manager API or the portal.
338
+ * Creates or updates a SQL virtual machine.
339
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
340
+ * value from the Azure Resource Manager API or the portal.
155
341
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
156
342
  * @param parameters The SQL virtual machine.
157
- * @param [options] The optional parameters
158
- * @returns Promise<Models.SqlVirtualMachinesUpdateResponse>
343
+ * @param options The options parameters.
159
344
  */
160
- update(resourceGroupName: string, sqlVirtualMachineName: string, parameters: Models.SqlVirtualMachineUpdate, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesUpdateResponse> {
161
- return this.beginUpdate(resourceGroupName,sqlVirtualMachineName,parameters,options)
162
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.SqlVirtualMachinesUpdateResponse>;
345
+ async beginCreateOrUpdateAndWait(
346
+ resourceGroupName: string,
347
+ sqlVirtualMachineName: string,
348
+ parameters: SqlVirtualMachine,
349
+ options?: SqlVirtualMachinesCreateOrUpdateOptionalParams
350
+ ): Promise<SqlVirtualMachinesCreateOrUpdateResponse> {
351
+ const poller = await this.beginCreateOrUpdate(
352
+ resourceGroupName,
353
+ sqlVirtualMachineName,
354
+ parameters,
355
+ options
356
+ );
357
+ return poller.pollUntilDone();
163
358
  }
164
359
 
165
360
  /**
166
- * Gets all SQL virtual machines in a resource group.
167
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
168
- * this value from the Azure Resource Manager API or the portal.
169
- * @param [options] The optional parameters
170
- * @returns Promise<Models.SqlVirtualMachinesListByResourceGroupResponse>
171
- */
172
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListByResourceGroupResponse>;
173
- /**
174
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
175
- * this value from the Azure Resource Manager API or the portal.
176
- * @param callback The callback
177
- */
178
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
179
- /**
180
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
181
- * this value from the Azure Resource Manager API or the portal.
182
- * @param options The optional parameters
183
- * @param callback The callback
361
+ * Deletes a SQL virtual machine.
362
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
363
+ * value from the Azure Resource Manager API or the portal.
364
+ * @param sqlVirtualMachineName Name of the SQL virtual machine.
365
+ * @param options The options parameters.
184
366
  */
185
- listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
186
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListByResourceGroupResponse> {
187
- return this.client.sendOperationRequest(
188
- {
189
- resourceGroupName,
190
- options
191
- },
192
- listByResourceGroupOperationSpec,
193
- callback) as Promise<Models.SqlVirtualMachinesListByResourceGroupResponse>;
367
+ async beginDelete(
368
+ resourceGroupName: string,
369
+ sqlVirtualMachineName: string,
370
+ options?: SqlVirtualMachinesDeleteOptionalParams
371
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
372
+ const directSendOperation = async (
373
+ args: coreClient.OperationArguments,
374
+ spec: coreClient.OperationSpec
375
+ ): Promise<void> => {
376
+ return this.client.sendOperationRequest(args, spec);
377
+ };
378
+ const sendOperation = async (
379
+ args: coreClient.OperationArguments,
380
+ spec: coreClient.OperationSpec
381
+ ) => {
382
+ let currentRawResponse:
383
+ | coreClient.FullOperationResponse
384
+ | undefined = undefined;
385
+ const providedCallback = args.options?.onResponse;
386
+ const callback: coreClient.RawResponseCallback = (
387
+ rawResponse: coreClient.FullOperationResponse,
388
+ flatResponse: unknown
389
+ ) => {
390
+ currentRawResponse = rawResponse;
391
+ providedCallback?.(rawResponse, flatResponse);
392
+ };
393
+ const updatedArgs = {
394
+ ...args,
395
+ options: {
396
+ ...args.options,
397
+ onResponse: callback
398
+ }
399
+ };
400
+ const flatResponse = await directSendOperation(updatedArgs, spec);
401
+ return {
402
+ flatResponse,
403
+ rawResponse: {
404
+ statusCode: currentRawResponse!.status,
405
+ body: currentRawResponse!.parsedBody,
406
+ headers: currentRawResponse!.headers.toJSON()
407
+ }
408
+ };
409
+ };
410
+
411
+ const lro = new LroImpl(
412
+ sendOperation,
413
+ { resourceGroupName, sqlVirtualMachineName, options },
414
+ deleteOperationSpec
415
+ );
416
+ return new LroEngine(lro, {
417
+ resumeFrom: options?.resumeFrom,
418
+ intervalInMs: options?.updateIntervalInMs
419
+ });
194
420
  }
195
421
 
196
422
  /**
197
- * Creates or updates a SQL virtual machine.
198
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
199
- * this value from the Azure Resource Manager API or the portal.
423
+ * Deletes a SQL virtual machine.
424
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
425
+ * value from the Azure Resource Manager API or the portal.
200
426
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
201
- * @param parameters The SQL virtual machine.
202
- * @param [options] The optional parameters
203
- * @returns Promise<msRestAzure.LROPoller>
427
+ * @param options The options parameters.
204
428
  */
205
- beginCreateOrUpdate(resourceGroupName: string, sqlVirtualMachineName: string, parameters: Models.SqlVirtualMachine, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
206
- return this.client.sendLRORequest(
207
- {
208
- resourceGroupName,
209
- sqlVirtualMachineName,
210
- parameters,
211
- options
212
- },
213
- beginCreateOrUpdateOperationSpec,
214
- options);
429
+ async beginDeleteAndWait(
430
+ resourceGroupName: string,
431
+ sqlVirtualMachineName: string,
432
+ options?: SqlVirtualMachinesDeleteOptionalParams
433
+ ): Promise<void> {
434
+ const poller = await this.beginDelete(
435
+ resourceGroupName,
436
+ sqlVirtualMachineName,
437
+ options
438
+ );
439
+ return poller.pollUntilDone();
215
440
  }
216
441
 
217
442
  /**
218
- * Deletes a SQL virtual machine.
219
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
220
- * this value from the Azure Resource Manager API or the portal.
443
+ * Updates a SQL virtual machine.
444
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
445
+ * value from the Azure Resource Manager API or the portal.
221
446
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
222
- * @param [options] The optional parameters
223
- * @returns Promise<msRestAzure.LROPoller>
447
+ * @param parameters The SQL virtual machine.
448
+ * @param options The options parameters.
224
449
  */
225
- beginDeleteMethod(resourceGroupName: string, sqlVirtualMachineName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
226
- return this.client.sendLRORequest(
227
- {
228
- resourceGroupName,
229
- sqlVirtualMachineName,
230
- options
231
- },
232
- beginDeleteMethodOperationSpec,
233
- options);
450
+ async beginUpdate(
451
+ resourceGroupName: string,
452
+ sqlVirtualMachineName: string,
453
+ parameters: SqlVirtualMachineUpdate,
454
+ options?: SqlVirtualMachinesUpdateOptionalParams
455
+ ): Promise<
456
+ PollerLike<
457
+ PollOperationState<SqlVirtualMachinesUpdateResponse>,
458
+ SqlVirtualMachinesUpdateResponse
459
+ >
460
+ > {
461
+ const directSendOperation = async (
462
+ args: coreClient.OperationArguments,
463
+ spec: coreClient.OperationSpec
464
+ ): Promise<SqlVirtualMachinesUpdateResponse> => {
465
+ return this.client.sendOperationRequest(args, spec);
466
+ };
467
+ const sendOperation = async (
468
+ args: coreClient.OperationArguments,
469
+ spec: coreClient.OperationSpec
470
+ ) => {
471
+ let currentRawResponse:
472
+ | coreClient.FullOperationResponse
473
+ | undefined = undefined;
474
+ const providedCallback = args.options?.onResponse;
475
+ const callback: coreClient.RawResponseCallback = (
476
+ rawResponse: coreClient.FullOperationResponse,
477
+ flatResponse: unknown
478
+ ) => {
479
+ currentRawResponse = rawResponse;
480
+ providedCallback?.(rawResponse, flatResponse);
481
+ };
482
+ const updatedArgs = {
483
+ ...args,
484
+ options: {
485
+ ...args.options,
486
+ onResponse: callback
487
+ }
488
+ };
489
+ const flatResponse = await directSendOperation(updatedArgs, spec);
490
+ return {
491
+ flatResponse,
492
+ rawResponse: {
493
+ statusCode: currentRawResponse!.status,
494
+ body: currentRawResponse!.parsedBody,
495
+ headers: currentRawResponse!.headers.toJSON()
496
+ }
497
+ };
498
+ };
499
+
500
+ const lro = new LroImpl(
501
+ sendOperation,
502
+ { resourceGroupName, sqlVirtualMachineName, parameters, options },
503
+ updateOperationSpec
504
+ );
505
+ return new LroEngine(lro, {
506
+ resumeFrom: options?.resumeFrom,
507
+ intervalInMs: options?.updateIntervalInMs
508
+ });
234
509
  }
235
510
 
236
511
  /**
237
512
  * Updates a SQL virtual machine.
238
- * @param resourceGroupName Name of the resource group that contains the resource. You can obtain
239
- * this value from the Azure Resource Manager API or the portal.
513
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
514
+ * value from the Azure Resource Manager API or the portal.
240
515
  * @param sqlVirtualMachineName Name of the SQL virtual machine.
241
516
  * @param parameters The SQL virtual machine.
242
- * @param [options] The optional parameters
243
- * @returns Promise<msRestAzure.LROPoller>
517
+ * @param options The options parameters.
244
518
  */
245
- beginUpdate(resourceGroupName: string, sqlVirtualMachineName: string, parameters: Models.SqlVirtualMachineUpdate, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
246
- return this.client.sendLRORequest(
247
- {
248
- resourceGroupName,
249
- sqlVirtualMachineName,
250
- parameters,
251
- options
252
- },
253
- beginUpdateOperationSpec,
254
- options);
519
+ async beginUpdateAndWait(
520
+ resourceGroupName: string,
521
+ sqlVirtualMachineName: string,
522
+ parameters: SqlVirtualMachineUpdate,
523
+ options?: SqlVirtualMachinesUpdateOptionalParams
524
+ ): Promise<SqlVirtualMachinesUpdateResponse> {
525
+ const poller = await this.beginUpdate(
526
+ resourceGroupName,
527
+ sqlVirtualMachineName,
528
+ parameters,
529
+ options
530
+ );
531
+ return poller.pollUntilDone();
255
532
  }
256
533
 
257
534
  /**
258
- * Gets the list of sql virtual machines in a SQL virtual machine group.
259
- * @param nextPageLink The NextLink from the previous successful call to List operation.
260
- * @param [options] The optional parameters
261
- * @returns Promise<Models.SqlVirtualMachinesListBySqlVmGroupNextResponse>
262
- */
263
- listBySqlVmGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListBySqlVmGroupNextResponse>;
264
- /**
265
- * @param nextPageLink The NextLink from the previous successful call to List operation.
266
- * @param callback The callback
267
- */
268
- listBySqlVmGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
269
- /**
270
- * @param nextPageLink The NextLink from the previous successful call to List operation.
271
- * @param options The optional parameters
272
- * @param callback The callback
535
+ * Gets all SQL virtual machines in a resource group.
536
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
537
+ * value from the Azure Resource Manager API or the portal.
538
+ * @param options The options parameters.
273
539
  */
274
- listBySqlVmGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
275
- listBySqlVmGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListBySqlVmGroupNextResponse> {
540
+ private _listByResourceGroup(
541
+ resourceGroupName: string,
542
+ options?: SqlVirtualMachinesListByResourceGroupOptionalParams
543
+ ): Promise<SqlVirtualMachinesListByResourceGroupResponse> {
276
544
  return this.client.sendOperationRequest(
277
- {
278
- nextPageLink,
279
- options
280
- },
281
- listBySqlVmGroupNextOperationSpec,
282
- callback) as Promise<Models.SqlVirtualMachinesListBySqlVmGroupNextResponse>;
545
+ { resourceGroupName, options },
546
+ listByResourceGroupOperationSpec
547
+ );
283
548
  }
284
549
 
285
550
  /**
286
- * Gets all SQL virtual machines in a subscription.
287
- * @param nextPageLink The NextLink from the previous successful call to List operation.
288
- * @param [options] The optional parameters
289
- * @returns Promise<Models.SqlVirtualMachinesListNextResponse>
290
- */
291
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListNextResponse>;
292
- /**
293
- * @param nextPageLink The NextLink from the previous successful call to List operation.
294
- * @param callback The callback
295
- */
296
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
297
- /**
298
- * @param nextPageLink The NextLink from the previous successful call to List operation.
299
- * @param options The optional parameters
300
- * @param callback The callback
551
+ * ListBySqlVmGroupNext
552
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
553
+ * value from the Azure Resource Manager API or the portal.
554
+ * @param sqlVirtualMachineGroupName Name of the SQL virtual machine group.
555
+ * @param nextLink The nextLink from the previous successful call to the ListBySqlVmGroup method.
556
+ * @param options The options parameters.
301
557
  */
302
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
303
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListNextResponse> {
558
+ private _listBySqlVmGroupNext(
559
+ resourceGroupName: string,
560
+ sqlVirtualMachineGroupName: string,
561
+ nextLink: string,
562
+ options?: SqlVirtualMachinesListBySqlVmGroupNextOptionalParams
563
+ ): Promise<SqlVirtualMachinesListBySqlVmGroupNextResponse> {
304
564
  return this.client.sendOperationRequest(
305
- {
306
- nextPageLink,
307
- options
308
- },
309
- listNextOperationSpec,
310
- callback) as Promise<Models.SqlVirtualMachinesListNextResponse>;
565
+ { resourceGroupName, sqlVirtualMachineGroupName, nextLink, options },
566
+ listBySqlVmGroupNextOperationSpec
567
+ );
311
568
  }
312
569
 
313
570
  /**
314
- * Gets all SQL virtual machines in a resource group.
315
- * @param nextPageLink The NextLink from the previous successful call to List operation.
316
- * @param [options] The optional parameters
317
- * @returns Promise<Models.SqlVirtualMachinesListByResourceGroupNextResponse>
318
- */
319
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.SqlVirtualMachinesListByResourceGroupNextResponse>;
320
- /**
321
- * @param nextPageLink The NextLink from the previous successful call to List operation.
322
- * @param callback The callback
571
+ * ListNext
572
+ * @param nextLink The nextLink from the previous successful call to the List method.
573
+ * @param options The options parameters.
323
574
  */
324
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
575
+ private _listNext(
576
+ nextLink: string,
577
+ options?: SqlVirtualMachinesListNextOptionalParams
578
+ ): Promise<SqlVirtualMachinesListNextResponse> {
579
+ return this.client.sendOperationRequest(
580
+ { nextLink, options },
581
+ listNextOperationSpec
582
+ );
583
+ }
584
+
325
585
  /**
326
- * @param nextPageLink The NextLink from the previous successful call to List operation.
327
- * @param options The optional parameters
328
- * @param callback The callback
586
+ * ListByResourceGroupNext
587
+ * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this
588
+ * value from the Azure Resource Manager API or the portal.
589
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
590
+ * @param options The options parameters.
329
591
  */
330
- listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): void;
331
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SqlVirtualMachineListResult>, callback?: msRest.ServiceCallback<Models.SqlVirtualMachineListResult>): Promise<Models.SqlVirtualMachinesListByResourceGroupNextResponse> {
592
+ private _listByResourceGroupNext(
593
+ resourceGroupName: string,
594
+ nextLink: string,
595
+ options?: SqlVirtualMachinesListByResourceGroupNextOptionalParams
596
+ ): Promise<SqlVirtualMachinesListByResourceGroupNextResponse> {
332
597
  return this.client.sendOperationRequest(
333
- {
334
- nextPageLink,
335
- options
336
- },
337
- listByResourceGroupNextOperationSpec,
338
- callback) as Promise<Models.SqlVirtualMachinesListByResourceGroupNextResponse>;
598
+ { resourceGroupName, nextLink, options },
599
+ listByResourceGroupNextOperationSpec
600
+ );
339
601
  }
340
602
  }
341
-
342
603
  // Operation Specifications
343
- const serializer = new msRest.Serializer(Mappers);
344
- const listBySqlVmGroupOperationSpec: msRest.OperationSpec = {
604
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
605
+
606
+ const listBySqlVmGroupOperationSpec: coreClient.OperationSpec = {
607
+ path:
608
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines",
345
609
  httpMethod: "GET",
346
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/sqlVirtualMachines",
347
- urlParameters: [
348
- Parameters.resourceGroupName,
349
- Parameters.sqlVirtualMachineGroupName,
350
- Parameters.subscriptionId
351
- ],
352
- queryParameters: [
353
- Parameters.apiVersion
354
- ],
355
- headerParameters: [
356
- Parameters.acceptLanguage
357
- ],
358
610
  responses: {
359
611
  200: {
360
612
  bodyMapper: Mappers.SqlVirtualMachineListResult
361
613
  },
362
- default: {
363
- bodyMapper: Mappers.CloudError
364
- }
614
+ default: {}
365
615
  },
366
- serializer
367
- };
368
-
369
- const listOperationSpec: msRest.OperationSpec = {
370
- httpMethod: "GET",
371
- path: "subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
616
+ queryParameters: [Parameters.apiVersion],
372
617
  urlParameters: [
618
+ Parameters.$host,
619
+ Parameters.resourceGroupName,
620
+ Parameters.sqlVirtualMachineGroupName,
373
621
  Parameters.subscriptionId
374
622
  ],
375
- queryParameters: [
376
- Parameters.apiVersion
377
- ],
378
- headerParameters: [
379
- Parameters.acceptLanguage
380
- ],
623
+ headerParameters: [Parameters.accept],
624
+ serializer
625
+ };
626
+ const listOperationSpec: coreClient.OperationSpec = {
627
+ path:
628
+ "/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
629
+ httpMethod: "GET",
381
630
  responses: {
382
631
  200: {
383
632
  bodyMapper: Mappers.SqlVirtualMachineListResult
384
633
  },
385
- default: {
386
- bodyMapper: Mappers.CloudError
387
- }
634
+ default: {}
388
635
  },
636
+ queryParameters: [Parameters.apiVersion],
637
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
638
+ headerParameters: [Parameters.accept],
389
639
  serializer
390
640
  };
391
-
392
- const getOperationSpec: msRest.OperationSpec = {
641
+ const getOperationSpec: coreClient.OperationSpec = {
642
+ path:
643
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
393
644
  httpMethod: "GET",
394
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
395
- urlParameters: [
396
- Parameters.resourceGroupName,
397
- Parameters.sqlVirtualMachineName,
398
- Parameters.subscriptionId
399
- ],
400
- queryParameters: [
401
- Parameters.expand,
402
- Parameters.apiVersion
403
- ],
404
- headerParameters: [
405
- Parameters.acceptLanguage
406
- ],
407
645
  responses: {
408
646
  200: {
409
647
  bodyMapper: Mappers.SqlVirtualMachine
410
648
  },
411
- default: {
412
- bodyMapper: Mappers.CloudError
413
- }
649
+ default: {}
414
650
  },
415
- serializer
416
- };
417
-
418
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
419
- httpMethod: "GET",
420
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
651
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
421
652
  urlParameters: [
653
+ Parameters.$host,
422
654
  Parameters.resourceGroupName,
423
- Parameters.subscriptionId
424
- ],
425
- queryParameters: [
426
- Parameters.apiVersion
655
+ Parameters.subscriptionId,
656
+ Parameters.sqlVirtualMachineName
427
657
  ],
428
- headerParameters: [
429
- Parameters.acceptLanguage
430
- ],
431
- responses: {
432
- 200: {
433
- bodyMapper: Mappers.SqlVirtualMachineListResult
434
- },
435
- default: {
436
- bodyMapper: Mappers.CloudError
437
- }
438
- },
658
+ headerParameters: [Parameters.accept],
439
659
  serializer
440
660
  };
441
-
442
- const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
661
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
662
+ path:
663
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
443
664
  httpMethod: "PUT",
444
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
445
- urlParameters: [
446
- Parameters.resourceGroupName,
447
- Parameters.sqlVirtualMachineName,
448
- Parameters.subscriptionId
449
- ],
450
- queryParameters: [
451
- Parameters.apiVersion
452
- ],
453
- headerParameters: [
454
- Parameters.acceptLanguage
455
- ],
456
- requestBody: {
457
- parameterPath: "parameters",
458
- mapper: {
459
- ...Mappers.SqlVirtualMachine,
460
- required: true
461
- }
462
- },
463
665
  responses: {
464
666
  200: {
465
667
  bodyMapper: Mappers.SqlVirtualMachine
@@ -467,129 +669,144 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
467
669
  201: {
468
670
  bodyMapper: Mappers.SqlVirtualMachine
469
671
  },
470
- default: {
471
- bodyMapper: Mappers.CloudError
472
- }
672
+ 202: {
673
+ bodyMapper: Mappers.SqlVirtualMachine
674
+ },
675
+ 204: {
676
+ bodyMapper: Mappers.SqlVirtualMachine
677
+ },
678
+ default: {}
473
679
  },
680
+ requestBody: Parameters.parameters3,
681
+ queryParameters: [Parameters.apiVersion],
682
+ urlParameters: [
683
+ Parameters.$host,
684
+ Parameters.resourceGroupName,
685
+ Parameters.subscriptionId,
686
+ Parameters.sqlVirtualMachineName
687
+ ],
688
+ headerParameters: [Parameters.accept, Parameters.contentType],
689
+ mediaType: "json",
474
690
  serializer
475
691
  };
476
-
477
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
692
+ const deleteOperationSpec: coreClient.OperationSpec = {
693
+ path:
694
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
478
695
  httpMethod: "DELETE",
479
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
696
+ responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
697
+ queryParameters: [Parameters.apiVersion],
480
698
  urlParameters: [
699
+ Parameters.$host,
481
700
  Parameters.resourceGroupName,
482
- Parameters.sqlVirtualMachineName,
483
- Parameters.subscriptionId
484
- ],
485
- queryParameters: [
486
- Parameters.apiVersion
701
+ Parameters.subscriptionId,
702
+ Parameters.sqlVirtualMachineName
487
703
  ],
488
- headerParameters: [
489
- Parameters.acceptLanguage
490
- ],
491
- responses: {
492
- 200: {},
493
- 202: {},
494
- 204: {},
495
- default: {
496
- bodyMapper: Mappers.CloudError
497
- }
498
- },
499
704
  serializer
500
705
  };
501
-
502
- const beginUpdateOperationSpec: msRest.OperationSpec = {
706
+ const updateOperationSpec: coreClient.OperationSpec = {
707
+ path:
708
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
503
709
  httpMethod: "PATCH",
504
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}",
505
- urlParameters: [
506
- Parameters.resourceGroupName,
507
- Parameters.sqlVirtualMachineName,
508
- Parameters.subscriptionId
509
- ],
510
- queryParameters: [
511
- Parameters.apiVersion
512
- ],
513
- headerParameters: [
514
- Parameters.acceptLanguage
515
- ],
516
- requestBody: {
517
- parameterPath: "parameters",
518
- mapper: {
519
- ...Mappers.SqlVirtualMachineUpdate,
520
- required: true
521
- }
522
- },
523
710
  responses: {
524
711
  200: {
525
712
  bodyMapper: Mappers.SqlVirtualMachine
526
713
  },
527
- default: {
528
- bodyMapper: Mappers.CloudError
529
- }
714
+ 201: {
715
+ bodyMapper: Mappers.SqlVirtualMachine
716
+ },
717
+ 202: {
718
+ bodyMapper: Mappers.SqlVirtualMachine
719
+ },
720
+ 204: {
721
+ bodyMapper: Mappers.SqlVirtualMachine
722
+ },
723
+ default: {}
530
724
  },
725
+ requestBody: Parameters.parameters4,
726
+ queryParameters: [Parameters.apiVersion],
727
+ urlParameters: [
728
+ Parameters.$host,
729
+ Parameters.resourceGroupName,
730
+ Parameters.subscriptionId,
731
+ Parameters.sqlVirtualMachineName
732
+ ],
733
+ headerParameters: [Parameters.accept, Parameters.contentType],
734
+ mediaType: "json",
531
735
  serializer
532
736
  };
533
-
534
- const listBySqlVmGroupNextOperationSpec: msRest.OperationSpec = {
737
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
738
+ path:
739
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines",
535
740
  httpMethod: "GET",
536
- baseUrl: "https://management.azure.com",
537
- path: "{nextLink}",
538
- urlParameters: [
539
- Parameters.nextPageLink
540
- ],
541
- headerParameters: [
542
- Parameters.acceptLanguage
543
- ],
544
741
  responses: {
545
742
  200: {
546
743
  bodyMapper: Mappers.SqlVirtualMachineListResult
547
744
  },
548
- default: {
549
- bodyMapper: Mappers.CloudError
550
- }
745
+ default: {}
551
746
  },
747
+ queryParameters: [Parameters.apiVersion],
748
+ urlParameters: [
749
+ Parameters.$host,
750
+ Parameters.resourceGroupName,
751
+ Parameters.subscriptionId
752
+ ],
753
+ headerParameters: [Parameters.accept],
552
754
  serializer
553
755
  };
554
-
555
- const listNextOperationSpec: msRest.OperationSpec = {
556
- httpMethod: "GET",
557
- baseUrl: "https://management.azure.com",
756
+ const listBySqlVmGroupNextOperationSpec: coreClient.OperationSpec = {
558
757
  path: "{nextLink}",
559
- urlParameters: [
560
- Parameters.nextPageLink
561
- ],
562
- headerParameters: [
563
- Parameters.acceptLanguage
564
- ],
758
+ httpMethod: "GET",
565
759
  responses: {
566
760
  200: {
567
761
  bodyMapper: Mappers.SqlVirtualMachineListResult
568
762
  },
569
- default: {
570
- bodyMapper: Mappers.CloudError
571
- }
763
+ default: {}
572
764
  },
765
+ queryParameters: [Parameters.apiVersion],
766
+ urlParameters: [
767
+ Parameters.$host,
768
+ Parameters.resourceGroupName,
769
+ Parameters.sqlVirtualMachineGroupName,
770
+ Parameters.subscriptionId,
771
+ Parameters.nextLink
772
+ ],
773
+ headerParameters: [Parameters.accept],
573
774
  serializer
574
775
  };
575
-
576
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
577
- httpMethod: "GET",
578
- baseUrl: "https://management.azure.com",
776
+ const listNextOperationSpec: coreClient.OperationSpec = {
579
777
  path: "{nextLink}",
778
+ httpMethod: "GET",
779
+ responses: {
780
+ 200: {
781
+ bodyMapper: Mappers.SqlVirtualMachineListResult
782
+ },
783
+ default: {}
784
+ },
785
+ queryParameters: [Parameters.apiVersion],
580
786
  urlParameters: [
581
- Parameters.nextPageLink
582
- ],
583
- headerParameters: [
584
- Parameters.acceptLanguage
787
+ Parameters.$host,
788
+ Parameters.subscriptionId,
789
+ Parameters.nextLink
585
790
  ],
791
+ headerParameters: [Parameters.accept],
792
+ serializer
793
+ };
794
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
795
+ path: "{nextLink}",
796
+ httpMethod: "GET",
586
797
  responses: {
587
798
  200: {
588
799
  bodyMapper: Mappers.SqlVirtualMachineListResult
589
800
  },
590
- default: {
591
- bodyMapper: Mappers.CloudError
592
- }
801
+ default: {}
593
802
  },
803
+ queryParameters: [Parameters.apiVersion],
804
+ urlParameters: [
805
+ Parameters.$host,
806
+ Parameters.resourceGroupName,
807
+ Parameters.subscriptionId,
808
+ Parameters.nextLink
809
+ ],
810
+ headerParameters: [Parameters.accept],
594
811
  serializer
595
812
  };