@azure/arm-mysql-flexible 3.1.1-alpha.20230501.1 → 4.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 (210) hide show
  1. package/CHANGELOG.md +96 -8
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/index.js +3646 -1927
  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/azureAdAdministratorsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/azureAdAdministratorsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/azureAdAdministratorsCreateOrUpdateSample.js +47 -0
  11. package/dist-esm/samples-dev/azureAdAdministratorsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/azureAdAdministratorsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/azureAdAdministratorsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/azureAdAdministratorsDeleteSample.js +40 -0
  15. package/dist-esm/samples-dev/azureAdAdministratorsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/azureAdAdministratorsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/azureAdAdministratorsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/azureAdAdministratorsGetSample.js +40 -0
  19. package/dist-esm/samples-dev/azureAdAdministratorsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/azureAdAdministratorsListByServerSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/azureAdAdministratorsListByServerSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/azureAdAdministratorsListByServerSample.js +60 -0
  23. package/dist-esm/samples-dev/azureAdAdministratorsListByServerSample.js.map +1 -0
  24. package/dist-esm/samples-dev/backupAndExportCreateSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/backupAndExportCreateSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/backupAndExportCreateSample.js +46 -0
  27. package/dist-esm/samples-dev/backupAndExportCreateSample.js.map +1 -0
  28. package/dist-esm/samples-dev/backupAndExportValidateBackupSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/backupAndExportValidateBackupSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/backupAndExportValidateBackupSample.js +39 -0
  31. package/dist-esm/samples-dev/backupAndExportValidateBackupSample.js.map +1 -0
  32. package/dist-esm/samples-dev/backupsGetSample.js +1 -1
  33. package/dist-esm/samples-dev/backupsListByServerSample.js +1 -1
  34. package/dist-esm/samples-dev/backupsPutSample.d.ts +2 -0
  35. package/dist-esm/samples-dev/backupsPutSample.d.ts.map +1 -0
  36. package/dist-esm/samples-dev/backupsPutSample.js +40 -0
  37. package/dist-esm/samples-dev/backupsPutSample.js.map +1 -0
  38. package/dist-esm/samples-dev/checkNameAvailabilityExecuteSample.js +1 -1
  39. package/dist-esm/samples-dev/checkNameAvailabilityWithoutLocationExecuteSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/checkNameAvailabilityWithoutLocationExecuteSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/checkNameAvailabilityWithoutLocationExecuteSample.js +41 -0
  42. package/dist-esm/samples-dev/checkNameAvailabilityWithoutLocationExecuteSample.js.map +1 -0
  43. package/dist-esm/samples-dev/checkVirtualNetworkSubnetUsageExecuteSample.js +1 -1
  44. package/dist-esm/samples-dev/configurationsBatchUpdateSample.js +2 -1
  45. package/dist-esm/samples-dev/configurationsBatchUpdateSample.js.map +1 -1
  46. package/dist-esm/samples-dev/configurationsCreateOrUpdateSample.d.ts +2 -0
  47. package/dist-esm/samples-dev/configurationsCreateOrUpdateSample.d.ts.map +1 -0
  48. package/dist-esm/samples-dev/configurationsCreateOrUpdateSample.js +41 -0
  49. package/dist-esm/samples-dev/configurationsCreateOrUpdateSample.js.map +1 -0
  50. package/dist-esm/samples-dev/configurationsGetSample.js +1 -1
  51. package/dist-esm/samples-dev/configurationsListByServerSample.js +5 -2
  52. package/dist-esm/samples-dev/configurationsListByServerSample.js.map +1 -1
  53. package/dist-esm/samples-dev/configurationsUpdateSample.js +1 -1
  54. package/dist-esm/samples-dev/databasesCreateOrUpdateSample.js +1 -1
  55. package/dist-esm/samples-dev/databasesDeleteSample.js +1 -1
  56. package/dist-esm/samples-dev/databasesGetSample.js +1 -1
  57. package/dist-esm/samples-dev/databasesListByServerSample.js +1 -1
  58. package/dist-esm/samples-dev/firewallRulesCreateOrUpdateSample.js +1 -1
  59. package/dist-esm/samples-dev/firewallRulesDeleteSample.js +1 -1
  60. package/dist-esm/samples-dev/firewallRulesGetSample.js +1 -1
  61. package/dist-esm/samples-dev/firewallRulesListByServerSample.js +1 -1
  62. package/dist-esm/samples-dev/getPrivateDnsZoneSuffixExecuteSample.js +1 -1
  63. package/dist-esm/samples-dev/locationBasedCapabilitiesListSample.js +1 -1
  64. package/dist-esm/samples-dev/logFilesListByServerSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/logFilesListByServerSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/logFilesListByServerSample.js +60 -0
  67. package/dist-esm/samples-dev/logFilesListByServerSample.js.map +1 -0
  68. package/dist-esm/samples-dev/operationsListSample.js +1 -1
  69. package/dist-esm/samples-dev/replicasListByServerSample.js +1 -1
  70. package/dist-esm/samples-dev/serversCreateSample.js +48 -3
  71. package/dist-esm/samples-dev/serversCreateSample.js.map +1 -1
  72. package/dist-esm/samples-dev/serversDeleteSample.js +1 -1
  73. package/dist-esm/samples-dev/serversFailoverSample.js +1 -1
  74. package/dist-esm/samples-dev/serversGetSample.js +2 -2
  75. package/dist-esm/samples-dev/serversListByResourceGroupSample.js +1 -1
  76. package/dist-esm/samples-dev/serversListSample.js +1 -1
  77. package/dist-esm/samples-dev/serversResetGtidSample.d.ts +2 -0
  78. package/dist-esm/samples-dev/serversResetGtidSample.d.ts.map +1 -0
  79. package/dist-esm/samples-dev/serversResetGtidSample.js +42 -0
  80. package/dist-esm/samples-dev/serversResetGtidSample.js.map +1 -0
  81. package/dist-esm/samples-dev/serversRestartSample.js +1 -1
  82. package/dist-esm/samples-dev/serversStartSample.js +1 -1
  83. package/dist-esm/samples-dev/serversStopSample.js +1 -1
  84. package/dist-esm/samples-dev/serversUpdateSample.js +42 -3
  85. package/dist-esm/samples-dev/serversUpdateSample.js.map +1 -1
  86. package/dist-esm/src/lroImpl.d.ts +6 -11
  87. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  88. package/dist-esm/src/lroImpl.js +12 -20
  89. package/dist-esm/src/lroImpl.js.map +1 -1
  90. package/dist-esm/src/models/index.d.ts +767 -378
  91. package/dist-esm/src/models/index.d.ts.map +1 -1
  92. package/dist-esm/src/models/index.js +78 -44
  93. package/dist-esm/src/models/index.js.map +1 -1
  94. package/dist-esm/src/models/mappers.d.ts +44 -15
  95. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  96. package/dist-esm/src/models/mappers.js +1232 -601
  97. package/dist-esm/src/models/mappers.js.map +1 -1
  98. package/dist-esm/src/models/parameters.d.ts +14 -5
  99. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  100. package/dist-esm/src/models/parameters.js +96 -21
  101. package/dist-esm/src/models/parameters.js.map +1 -1
  102. package/dist-esm/src/mySQLManagementFlexibleServerClient.d.ts +9 -8
  103. package/dist-esm/src/mySQLManagementFlexibleServerClient.d.ts.map +1 -1
  104. package/dist-esm/src/mySQLManagementFlexibleServerClient.js +10 -36
  105. package/dist-esm/src/mySQLManagementFlexibleServerClient.js.map +1 -1
  106. package/dist-esm/src/operations/azureADAdministrators.d.ts +81 -0
  107. package/dist-esm/src/operations/azureADAdministrators.d.ts.map +1 -0
  108. package/dist-esm/src/operations/azureADAdministrators.js +368 -0
  109. package/dist-esm/src/operations/azureADAdministrators.js.map +1 -0
  110. package/dist-esm/src/operations/backupAndExport.d.ts +37 -0
  111. package/dist-esm/src/operations/backupAndExport.d.ts.map +1 -0
  112. package/dist-esm/src/operations/backupAndExport.js +146 -0
  113. package/dist-esm/src/operations/backupAndExport.js.map +1 -0
  114. package/dist-esm/src/operations/backups.d.ts +9 -1
  115. package/dist-esm/src/operations/backups.d.ts.map +1 -1
  116. package/dist-esm/src/operations/backups.js +34 -2
  117. package/dist-esm/src/operations/backups.js.map +1 -1
  118. package/dist-esm/src/operations/checkNameAvailabilityWithoutLocation.d.ts +19 -0
  119. package/dist-esm/src/operations/checkNameAvailabilityWithoutLocation.d.ts.map +1 -0
  120. package/dist-esm/src/operations/checkNameAvailabilityWithoutLocation.js +49 -0
  121. package/dist-esm/src/operations/checkNameAvailabilityWithoutLocation.js.map +1 -0
  122. package/dist-esm/src/operations/checkVirtualNetworkSubnetUsage.js +1 -1
  123. package/dist-esm/src/operations/checkVirtualNetworkSubnetUsage.js.map +1 -1
  124. package/dist-esm/src/operations/configurations.d.ts +22 -4
  125. package/dist-esm/src/operations/configurations.d.ts.map +1 -1
  126. package/dist-esm/src/operations/configurations.js +132 -14
  127. package/dist-esm/src/operations/configurations.js.map +1 -1
  128. package/dist-esm/src/operations/databases.d.ts +3 -3
  129. package/dist-esm/src/operations/databases.d.ts.map +1 -1
  130. package/dist-esm/src/operations/databases.js +24 -10
  131. package/dist-esm/src/operations/databases.js.map +1 -1
  132. package/dist-esm/src/operations/firewallRules.d.ts +3 -3
  133. package/dist-esm/src/operations/firewallRules.d.ts.map +1 -1
  134. package/dist-esm/src/operations/firewallRules.js +25 -11
  135. package/dist-esm/src/operations/firewallRules.js.map +1 -1
  136. package/dist-esm/src/operations/index.d.ts +8 -4
  137. package/dist-esm/src/operations/index.d.ts.map +1 -1
  138. package/dist-esm/src/operations/index.js +8 -4
  139. package/dist-esm/src/operations/index.js.map +1 -1
  140. package/dist-esm/src/operations/logFiles.d.ts +38 -0
  141. package/dist-esm/src/operations/logFiles.d.ts.map +1 -0
  142. package/dist-esm/src/operations/logFiles.js +155 -0
  143. package/dist-esm/src/operations/logFiles.js.map +1 -0
  144. package/dist-esm/src/operations/replicas.js +1 -1
  145. package/dist-esm/src/operations/replicas.js.map +1 -1
  146. package/dist-esm/src/operations/servers.d.ts +25 -9
  147. package/dist-esm/src/operations/servers.d.ts.map +1 -1
  148. package/dist-esm/src/operations/servers.js +155 -44
  149. package/dist-esm/src/operations/servers.js.map +1 -1
  150. package/dist-esm/src/operationsInterfaces/azureADAdministrators.d.ts +56 -0
  151. package/dist-esm/src/operationsInterfaces/azureADAdministrators.d.ts.map +1 -0
  152. package/dist-esm/src/operationsInterfaces/azureADAdministrators.js +9 -0
  153. package/dist-esm/src/operationsInterfaces/azureADAdministrators.js.map +1 -0
  154. package/dist-esm/src/operationsInterfaces/backupAndExport.d.ts +29 -0
  155. package/dist-esm/src/operationsInterfaces/backupAndExport.d.ts.map +1 -0
  156. package/dist-esm/src/operationsInterfaces/backupAndExport.js +9 -0
  157. package/dist-esm/src/operationsInterfaces/backupAndExport.js.map +1 -0
  158. package/dist-esm/src/operationsInterfaces/backups.d.ts +9 -1
  159. package/dist-esm/src/operationsInterfaces/backups.d.ts.map +1 -1
  160. package/dist-esm/src/operationsInterfaces/checkNameAvailabilityWithoutLocation.d.ts +11 -0
  161. package/dist-esm/src/operationsInterfaces/checkNameAvailabilityWithoutLocation.d.ts.map +1 -0
  162. package/dist-esm/src/operationsInterfaces/checkNameAvailabilityWithoutLocation.js +9 -0
  163. package/dist-esm/src/operationsInterfaces/checkNameAvailabilityWithoutLocation.js.map +1 -0
  164. package/dist-esm/src/operationsInterfaces/configurations.d.ts +22 -4
  165. package/dist-esm/src/operationsInterfaces/configurations.d.ts.map +1 -1
  166. package/dist-esm/src/operationsInterfaces/databases.d.ts +3 -3
  167. package/dist-esm/src/operationsInterfaces/databases.d.ts.map +1 -1
  168. package/dist-esm/src/operationsInterfaces/firewallRules.d.ts +3 -3
  169. package/dist-esm/src/operationsInterfaces/firewallRules.d.ts.map +1 -1
  170. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -4
  171. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  172. package/dist-esm/src/operationsInterfaces/index.js +8 -4
  173. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  174. package/dist-esm/src/operationsInterfaces/logFiles.d.ts +13 -0
  175. package/dist-esm/src/operationsInterfaces/logFiles.d.ts.map +1 -0
  176. package/dist-esm/src/operationsInterfaces/logFiles.js +9 -0
  177. package/dist-esm/src/operationsInterfaces/logFiles.js.map +1 -0
  178. package/dist-esm/src/operationsInterfaces/servers.d.ts +25 -9
  179. package/dist-esm/src/operationsInterfaces/servers.d.ts.map +1 -1
  180. package/package.json +6 -6
  181. package/review/arm-mysql-flexible.api.md +383 -18
  182. package/src/lroImpl.ts +31 -23
  183. package/src/models/index.ts +842 -382
  184. package/src/models/mappers.ts +1315 -622
  185. package/src/models/parameters.ts +112 -25
  186. package/src/mySQLManagementFlexibleServerClient.ts +35 -53
  187. package/src/operations/azureADAdministrators.ts +504 -0
  188. package/src/operations/backupAndExport.ts +210 -0
  189. package/src/operations/backups.ts +46 -2
  190. package/src/operations/checkNameAvailabilityWithoutLocation.ts +69 -0
  191. package/src/operations/checkVirtualNetworkSubnetUsage.ts +1 -1
  192. package/src/operations/configurations.ts +190 -26
  193. package/src/operations/databases.ts +34 -21
  194. package/src/operations/firewallRules.ts +35 -22
  195. package/src/operations/index.ts +8 -4
  196. package/src/operations/logFiles.ts +198 -0
  197. package/src/operations/replicas.ts +1 -1
  198. package/src/operations/servers.ts +211 -79
  199. package/src/operationsInterfaces/azureADAdministrators.ts +110 -0
  200. package/src/operationsInterfaces/backupAndExport.ts +62 -0
  201. package/src/operationsInterfaces/backups.ts +15 -0
  202. package/src/operationsInterfaces/checkNameAvailabilityWithoutLocation.ts +26 -0
  203. package/src/operationsInterfaces/configurations.ts +42 -5
  204. package/src/operationsInterfaces/databases.ts +4 -4
  205. package/src/operationsInterfaces/firewallRules.ts +4 -4
  206. package/src/operationsInterfaces/index.ts +8 -4
  207. package/src/operationsInterfaces/logFiles.ts +26 -0
  208. package/src/operationsInterfaces/servers.ts +43 -9
  209. package/types/arm-mysql-flexible.d.ts +624 -29
  210. package/types/tsdoc-metadata.json +1 -1
@@ -18,6 +18,8 @@ import {
18
18
  BackupsListByServerNextOptionalParams,
19
19
  BackupsListByServerOptionalParams,
20
20
  BackupsListByServerResponse,
21
+ BackupsPutOptionalParams,
22
+ BackupsPutResponse,
21
23
  BackupsGetOptionalParams,
22
24
  BackupsGetResponse,
23
25
  BackupsListByServerNextResponse
@@ -116,6 +118,25 @@ export class BackupsImpl implements Backups {
116
118
  }
117
119
  }
118
120
 
121
+ /**
122
+ * Create backup for a given server with specified backup name.
123
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
124
+ * @param serverName The name of the server.
125
+ * @param backupName The name of the backup.
126
+ * @param options The options parameters.
127
+ */
128
+ put(
129
+ resourceGroupName: string,
130
+ serverName: string,
131
+ backupName: string,
132
+ options?: BackupsPutOptionalParams
133
+ ): Promise<BackupsPutResponse> {
134
+ return this.client.sendOperationRequest(
135
+ { resourceGroupName, serverName, backupName, options },
136
+ putOperationSpec
137
+ );
138
+ }
139
+
119
140
  /**
120
141
  * List all the backups for a given server.
121
142
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
@@ -174,6 +195,29 @@ export class BackupsImpl implements Backups {
174
195
  // Operation Specifications
175
196
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
176
197
 
198
+ const putOperationSpec: coreClient.OperationSpec = {
199
+ path:
200
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}",
201
+ httpMethod: "PUT",
202
+ responses: {
203
+ 200: {
204
+ bodyMapper: Mappers.ServerBackup
205
+ },
206
+ default: {
207
+ bodyMapper: Mappers.CloudError
208
+ }
209
+ },
210
+ queryParameters: [Parameters.apiVersion1],
211
+ urlParameters: [
212
+ Parameters.$host,
213
+ Parameters.subscriptionId,
214
+ Parameters.resourceGroupName,
215
+ Parameters.serverName,
216
+ Parameters.backupName
217
+ ],
218
+ headerParameters: [Parameters.accept],
219
+ serializer
220
+ };
177
221
  const getOperationSpec: coreClient.OperationSpec = {
178
222
  path:
179
223
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}",
@@ -186,7 +230,7 @@ const getOperationSpec: coreClient.OperationSpec = {
186
230
  bodyMapper: Mappers.CloudError
187
231
  }
188
232
  },
189
- queryParameters: [Parameters.apiVersion],
233
+ queryParameters: [Parameters.apiVersion1],
190
234
  urlParameters: [
191
235
  Parameters.$host,
192
236
  Parameters.subscriptionId,
@@ -209,7 +253,7 @@ const listByServerOperationSpec: coreClient.OperationSpec = {
209
253
  bodyMapper: Mappers.CloudError
210
254
  }
211
255
  },
212
- queryParameters: [Parameters.apiVersion],
256
+ queryParameters: [Parameters.apiVersion1],
213
257
  urlParameters: [
214
258
  Parameters.$host,
215
259
  Parameters.subscriptionId,
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { CheckNameAvailabilityWithoutLocation } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { MySQLManagementFlexibleServerClient } from "../mySQLManagementFlexibleServerClient";
14
+ import {
15
+ NameAvailabilityRequest,
16
+ CheckNameAvailabilityWithoutLocationExecuteOptionalParams,
17
+ CheckNameAvailabilityWithoutLocationExecuteResponse
18
+ } from "../models";
19
+
20
+ /** Class containing CheckNameAvailabilityWithoutLocation operations. */
21
+ export class CheckNameAvailabilityWithoutLocationImpl
22
+ implements CheckNameAvailabilityWithoutLocation {
23
+ private readonly client: MySQLManagementFlexibleServerClient;
24
+
25
+ /**
26
+ * Initialize a new instance of the class CheckNameAvailabilityWithoutLocation class.
27
+ * @param client Reference to the service client
28
+ */
29
+ constructor(client: MySQLManagementFlexibleServerClient) {
30
+ this.client = client;
31
+ }
32
+
33
+ /**
34
+ * Check the availability of name for server
35
+ * @param nameAvailabilityRequest The required parameters for checking if server name is available.
36
+ * @param options The options parameters.
37
+ */
38
+ execute(
39
+ nameAvailabilityRequest: NameAvailabilityRequest,
40
+ options?: CheckNameAvailabilityWithoutLocationExecuteOptionalParams
41
+ ): Promise<CheckNameAvailabilityWithoutLocationExecuteResponse> {
42
+ return this.client.sendOperationRequest(
43
+ { nameAvailabilityRequest, options },
44
+ executeOperationSpec
45
+ );
46
+ }
47
+ }
48
+ // Operation Specifications
49
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
50
+
51
+ const executeOperationSpec: coreClient.OperationSpec = {
52
+ path:
53
+ "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability",
54
+ httpMethod: "POST",
55
+ responses: {
56
+ 200: {
57
+ bodyMapper: Mappers.NameAvailability
58
+ },
59
+ default: {
60
+ bodyMapper: Mappers.CloudError
61
+ }
62
+ },
63
+ requestBody: Parameters.nameAvailabilityRequest,
64
+ queryParameters: [Parameters.apiVersion],
65
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
66
+ headerParameters: [Parameters.contentType, Parameters.accept],
67
+ mediaType: "json",
68
+ serializer
69
+ };
@@ -62,7 +62,7 @@ const executeOperationSpec: coreClient.OperationSpec = {
62
62
  bodyMapper: Mappers.CloudError
63
63
  }
64
64
  },
65
- requestBody: Parameters.parameters7,
65
+ requestBody: Parameters.parameters10,
66
66
  queryParameters: [Parameters.apiVersion],
67
67
  urlParameters: [
68
68
  Parameters.$host,
@@ -13,13 +13,19 @@ import * as coreClient from "@azure/core-client";
13
13
  import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { MySQLManagementFlexibleServerClient } from "../mySQLManagementFlexibleServerClient";
16
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  Configuration,
20
24
  ConfigurationsListByServerNextOptionalParams,
21
25
  ConfigurationsListByServerOptionalParams,
22
26
  ConfigurationsListByServerResponse,
27
+ ConfigurationsCreateOrUpdateOptionalParams,
28
+ ConfigurationsCreateOrUpdateResponse,
23
29
  ConfigurationsUpdateOptionalParams,
24
30
  ConfigurationsUpdateResponse,
25
31
  ConfigurationsGetOptionalParams,
@@ -123,6 +129,112 @@ export class ConfigurationsImpl implements Configurations {
123
129
  }
124
130
  }
125
131
 
132
+ /**
133
+ * Updates a configuration of a server.
134
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
135
+ * @param serverName The name of the server.
136
+ * @param configurationName The name of the server configuration.
137
+ * @param parameters The required parameters for updating a server configuration.
138
+ * @param options The options parameters.
139
+ */
140
+ async beginCreateOrUpdate(
141
+ resourceGroupName: string,
142
+ serverName: string,
143
+ configurationName: string,
144
+ parameters: Configuration,
145
+ options?: ConfigurationsCreateOrUpdateOptionalParams
146
+ ): Promise<
147
+ SimplePollerLike<
148
+ OperationState<ConfigurationsCreateOrUpdateResponse>,
149
+ ConfigurationsCreateOrUpdateResponse
150
+ >
151
+ > {
152
+ const directSendOperation = async (
153
+ args: coreClient.OperationArguments,
154
+ spec: coreClient.OperationSpec
155
+ ): Promise<ConfigurationsCreateOrUpdateResponse> => {
156
+ return this.client.sendOperationRequest(args, spec);
157
+ };
158
+ const sendOperationFn = async (
159
+ args: coreClient.OperationArguments,
160
+ spec: coreClient.OperationSpec
161
+ ) => {
162
+ let currentRawResponse:
163
+ | coreClient.FullOperationResponse
164
+ | undefined = undefined;
165
+ const providedCallback = args.options?.onResponse;
166
+ const callback: coreClient.RawResponseCallback = (
167
+ rawResponse: coreClient.FullOperationResponse,
168
+ flatResponse: unknown
169
+ ) => {
170
+ currentRawResponse = rawResponse;
171
+ providedCallback?.(rawResponse, flatResponse);
172
+ };
173
+ const updatedArgs = {
174
+ ...args,
175
+ options: {
176
+ ...args.options,
177
+ onResponse: callback
178
+ }
179
+ };
180
+ const flatResponse = await directSendOperation(updatedArgs, spec);
181
+ return {
182
+ flatResponse,
183
+ rawResponse: {
184
+ statusCode: currentRawResponse!.status,
185
+ body: currentRawResponse!.parsedBody,
186
+ headers: currentRawResponse!.headers.toJSON()
187
+ }
188
+ };
189
+ };
190
+
191
+ const lro = createLroSpec({
192
+ sendOperationFn,
193
+ args: {
194
+ resourceGroupName,
195
+ serverName,
196
+ configurationName,
197
+ parameters,
198
+ options
199
+ },
200
+ spec: createOrUpdateOperationSpec
201
+ });
202
+ const poller = await createHttpPoller<
203
+ ConfigurationsCreateOrUpdateResponse,
204
+ OperationState<ConfigurationsCreateOrUpdateResponse>
205
+ >(lro, {
206
+ restoreFrom: options?.resumeFrom,
207
+ intervalInMs: options?.updateIntervalInMs
208
+ });
209
+ await poller.poll();
210
+ return poller;
211
+ }
212
+
213
+ /**
214
+ * Updates a configuration of a server.
215
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
216
+ * @param serverName The name of the server.
217
+ * @param configurationName The name of the server configuration.
218
+ * @param parameters The required parameters for updating a server configuration.
219
+ * @param options The options parameters.
220
+ */
221
+ async beginCreateOrUpdateAndWait(
222
+ resourceGroupName: string,
223
+ serverName: string,
224
+ configurationName: string,
225
+ parameters: Configuration,
226
+ options?: ConfigurationsCreateOrUpdateOptionalParams
227
+ ): Promise<ConfigurationsCreateOrUpdateResponse> {
228
+ const poller = await this.beginCreateOrUpdate(
229
+ resourceGroupName,
230
+ serverName,
231
+ configurationName,
232
+ parameters,
233
+ options
234
+ );
235
+ return poller.pollUntilDone();
236
+ }
237
+
126
238
  /**
127
239
  * Updates a configuration of a server.
128
240
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
@@ -138,8 +250,8 @@ export class ConfigurationsImpl implements Configurations {
138
250
  parameters: Configuration,
139
251
  options?: ConfigurationsUpdateOptionalParams
140
252
  ): Promise<
141
- PollerLike<
142
- PollOperationState<ConfigurationsUpdateResponse>,
253
+ SimplePollerLike<
254
+ OperationState<ConfigurationsUpdateResponse>,
143
255
  ConfigurationsUpdateResponse
144
256
  >
145
257
  > {
@@ -149,7 +261,7 @@ export class ConfigurationsImpl implements Configurations {
149
261
  ): Promise<ConfigurationsUpdateResponse> => {
150
262
  return this.client.sendOperationRequest(args, spec);
151
263
  };
152
- const sendOperation = async (
264
+ const sendOperationFn = async (
153
265
  args: coreClient.OperationArguments,
154
266
  spec: coreClient.OperationSpec
155
267
  ) => {
@@ -182,13 +294,22 @@ export class ConfigurationsImpl implements Configurations {
182
294
  };
183
295
  };
184
296
 
185
- const lro = new LroImpl(
186
- sendOperation,
187
- { resourceGroupName, serverName, configurationName, parameters, options },
188
- updateOperationSpec
189
- );
190
- const poller = new LroEngine(lro, {
191
- resumeFrom: options?.resumeFrom,
297
+ const lro = createLroSpec({
298
+ sendOperationFn,
299
+ args: {
300
+ resourceGroupName,
301
+ serverName,
302
+ configurationName,
303
+ parameters,
304
+ options
305
+ },
306
+ spec: updateOperationSpec
307
+ });
308
+ const poller = await createHttpPoller<
309
+ ConfigurationsUpdateResponse,
310
+ OperationState<ConfigurationsUpdateResponse>
311
+ >(lro, {
312
+ restoreFrom: options?.resumeFrom,
192
313
  intervalInMs: options?.updateIntervalInMs
193
314
  });
194
315
  await poller.poll();
@@ -252,8 +373,8 @@ export class ConfigurationsImpl implements Configurations {
252
373
  parameters: ConfigurationListForBatchUpdate,
253
374
  options?: ConfigurationsBatchUpdateOptionalParams
254
375
  ): Promise<
255
- PollerLike<
256
- PollOperationState<ConfigurationsBatchUpdateResponse>,
376
+ SimplePollerLike<
377
+ OperationState<ConfigurationsBatchUpdateResponse>,
257
378
  ConfigurationsBatchUpdateResponse
258
379
  >
259
380
  > {
@@ -263,7 +384,7 @@ export class ConfigurationsImpl implements Configurations {
263
384
  ): Promise<ConfigurationsBatchUpdateResponse> => {
264
385
  return this.client.sendOperationRequest(args, spec);
265
386
  };
266
- const sendOperation = async (
387
+ const sendOperationFn = async (
267
388
  args: coreClient.OperationArguments,
268
389
  spec: coreClient.OperationSpec
269
390
  ) => {
@@ -296,15 +417,18 @@ export class ConfigurationsImpl implements Configurations {
296
417
  };
297
418
  };
298
419
 
299
- const lro = new LroImpl(
300
- sendOperation,
301
- { resourceGroupName, serverName, parameters, options },
302
- batchUpdateOperationSpec
303
- );
304
- const poller = new LroEngine(lro, {
305
- resumeFrom: options?.resumeFrom,
420
+ const lro = createLroSpec({
421
+ sendOperationFn,
422
+ args: { resourceGroupName, serverName, parameters, options },
423
+ spec: batchUpdateOperationSpec
424
+ });
425
+ const poller = await createHttpPoller<
426
+ ConfigurationsBatchUpdateResponse,
427
+ OperationState<ConfigurationsBatchUpdateResponse>
428
+ >(lro, {
429
+ restoreFrom: options?.resumeFrom,
306
430
  intervalInMs: options?.updateIntervalInMs,
307
- lroResourceLocationConfig: "azure-async-operation"
431
+ resourceLocationConfig: "azure-async-operation"
308
432
  });
309
433
  await poller.poll();
310
434
  return poller;
@@ -371,6 +495,40 @@ export class ConfigurationsImpl implements Configurations {
371
495
  // Operation Specifications
372
496
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
373
497
 
498
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
499
+ path:
500
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}",
501
+ httpMethod: "PUT",
502
+ responses: {
503
+ 200: {
504
+ bodyMapper: Mappers.Configuration
505
+ },
506
+ 201: {
507
+ bodyMapper: Mappers.Configuration
508
+ },
509
+ 202: {
510
+ bodyMapper: Mappers.Configuration
511
+ },
512
+ 204: {
513
+ bodyMapper: Mappers.Configuration
514
+ },
515
+ default: {
516
+ bodyMapper: Mappers.CloudError
517
+ }
518
+ },
519
+ requestBody: Parameters.parameters2,
520
+ queryParameters: [Parameters.apiVersion],
521
+ urlParameters: [
522
+ Parameters.$host,
523
+ Parameters.subscriptionId,
524
+ Parameters.resourceGroupName,
525
+ Parameters.serverName,
526
+ Parameters.configurationName
527
+ ],
528
+ headerParameters: [Parameters.contentType, Parameters.accept],
529
+ mediaType: "json",
530
+ serializer
531
+ };
374
532
  const updateOperationSpec: coreClient.OperationSpec = {
375
533
  path:
376
534
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}",
@@ -392,7 +550,7 @@ const updateOperationSpec: coreClient.OperationSpec = {
392
550
  bodyMapper: Mappers.CloudError
393
551
  }
394
552
  },
395
- requestBody: Parameters.parameters5,
553
+ requestBody: Parameters.parameters2,
396
554
  queryParameters: [Parameters.apiVersion],
397
555
  urlParameters: [
398
556
  Parameters.$host,
@@ -449,7 +607,7 @@ const batchUpdateOperationSpec: coreClient.OperationSpec = {
449
607
  bodyMapper: Mappers.CloudError
450
608
  }
451
609
  },
452
- requestBody: Parameters.parameters6,
610
+ requestBody: Parameters.parameters3,
453
611
  queryParameters: [Parameters.apiVersion],
454
612
  urlParameters: [
455
613
  Parameters.$host,
@@ -473,7 +631,13 @@ const listByServerOperationSpec: coreClient.OperationSpec = {
473
631
  bodyMapper: Mappers.CloudError
474
632
  }
475
633
  },
476
- queryParameters: [Parameters.apiVersion],
634
+ queryParameters: [
635
+ Parameters.apiVersion,
636
+ Parameters.tags,
637
+ Parameters.keyword,
638
+ Parameters.page,
639
+ Parameters.pageSize
640
+ ],
477
641
  urlParameters: [
478
642
  Parameters.$host,
479
643
  Parameters.subscriptionId,
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
13
13
  import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { MySQLManagementFlexibleServerClient } from "../mySQLManagementFlexibleServerClient";
16
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  Database,
20
24
  DatabasesListByServerNextOptionalParams,
@@ -136,8 +140,8 @@ export class DatabasesImpl implements Databases {
136
140
  parameters: Database,
137
141
  options?: DatabasesCreateOrUpdateOptionalParams
138
142
  ): Promise<
139
- PollerLike<
140
- PollOperationState<DatabasesCreateOrUpdateResponse>,
143
+ SimplePollerLike<
144
+ OperationState<DatabasesCreateOrUpdateResponse>,
141
145
  DatabasesCreateOrUpdateResponse
142
146
  >
143
147
  > {
@@ -147,7 +151,7 @@ export class DatabasesImpl implements Databases {
147
151
  ): Promise<DatabasesCreateOrUpdateResponse> => {
148
152
  return this.client.sendOperationRequest(args, spec);
149
153
  };
150
- const sendOperation = async (
154
+ const sendOperationFn = async (
151
155
  args: coreClient.OperationArguments,
152
156
  spec: coreClient.OperationSpec
153
157
  ) => {
@@ -180,13 +184,22 @@ export class DatabasesImpl implements Databases {
180
184
  };
181
185
  };
182
186
 
183
- const lro = new LroImpl(
184
- sendOperation,
185
- { resourceGroupName, serverName, databaseName, parameters, options },
186
- createOrUpdateOperationSpec
187
- );
188
- const poller = new LroEngine(lro, {
189
- resumeFrom: options?.resumeFrom,
187
+ const lro = createLroSpec({
188
+ sendOperationFn,
189
+ args: {
190
+ resourceGroupName,
191
+ serverName,
192
+ databaseName,
193
+ parameters,
194
+ options
195
+ },
196
+ spec: createOrUpdateOperationSpec
197
+ });
198
+ const poller = await createHttpPoller<
199
+ DatabasesCreateOrUpdateResponse,
200
+ OperationState<DatabasesCreateOrUpdateResponse>
201
+ >(lro, {
202
+ restoreFrom: options?.resumeFrom,
190
203
  intervalInMs: options?.updateIntervalInMs
191
204
  });
192
205
  await poller.poll();
@@ -230,14 +243,14 @@ export class DatabasesImpl implements Databases {
230
243
  serverName: string,
231
244
  databaseName: string,
232
245
  options?: DatabasesDeleteOptionalParams
233
- ): Promise<PollerLike<PollOperationState<void>, void>> {
246
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
234
247
  const directSendOperation = async (
235
248
  args: coreClient.OperationArguments,
236
249
  spec: coreClient.OperationSpec
237
250
  ): Promise<void> => {
238
251
  return this.client.sendOperationRequest(args, spec);
239
252
  };
240
- const sendOperation = async (
253
+ const sendOperationFn = async (
241
254
  args: coreClient.OperationArguments,
242
255
  spec: coreClient.OperationSpec
243
256
  ) => {
@@ -270,13 +283,13 @@ export class DatabasesImpl implements Databases {
270
283
  };
271
284
  };
272
285
 
273
- const lro = new LroImpl(
274
- sendOperation,
275
- { resourceGroupName, serverName, databaseName, options },
276
- deleteOperationSpec
277
- );
278
- const poller = new LroEngine(lro, {
279
- resumeFrom: options?.resumeFrom,
286
+ const lro = createLroSpec({
287
+ sendOperationFn,
288
+ args: { resourceGroupName, serverName, databaseName, options },
289
+ spec: deleteOperationSpec
290
+ });
291
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
292
+ restoreFrom: options?.resumeFrom,
280
293
  intervalInMs: options?.updateIntervalInMs
281
294
  });
282
295
  await poller.poll();
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
13
13
  import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { MySQLManagementFlexibleServerClient } from "../mySQLManagementFlexibleServerClient";
16
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  FirewallRule,
20
24
  FirewallRulesListByServerNextOptionalParams,
@@ -136,8 +140,8 @@ export class FirewallRulesImpl implements FirewallRules {
136
140
  parameters: FirewallRule,
137
141
  options?: FirewallRulesCreateOrUpdateOptionalParams
138
142
  ): Promise<
139
- PollerLike<
140
- PollOperationState<FirewallRulesCreateOrUpdateResponse>,
143
+ SimplePollerLike<
144
+ OperationState<FirewallRulesCreateOrUpdateResponse>,
141
145
  FirewallRulesCreateOrUpdateResponse
142
146
  >
143
147
  > {
@@ -147,7 +151,7 @@ export class FirewallRulesImpl implements FirewallRules {
147
151
  ): Promise<FirewallRulesCreateOrUpdateResponse> => {
148
152
  return this.client.sendOperationRequest(args, spec);
149
153
  };
150
- const sendOperation = async (
154
+ const sendOperationFn = async (
151
155
  args: coreClient.OperationArguments,
152
156
  spec: coreClient.OperationSpec
153
157
  ) => {
@@ -180,13 +184,22 @@ export class FirewallRulesImpl implements FirewallRules {
180
184
  };
181
185
  };
182
186
 
183
- const lro = new LroImpl(
184
- sendOperation,
185
- { resourceGroupName, serverName, firewallRuleName, parameters, options },
186
- createOrUpdateOperationSpec
187
- );
188
- const poller = new LroEngine(lro, {
189
- resumeFrom: options?.resumeFrom,
187
+ const lro = createLroSpec({
188
+ sendOperationFn,
189
+ args: {
190
+ resourceGroupName,
191
+ serverName,
192
+ firewallRuleName,
193
+ parameters,
194
+ options
195
+ },
196
+ spec: createOrUpdateOperationSpec
197
+ });
198
+ const poller = await createHttpPoller<
199
+ FirewallRulesCreateOrUpdateResponse,
200
+ OperationState<FirewallRulesCreateOrUpdateResponse>
201
+ >(lro, {
202
+ restoreFrom: options?.resumeFrom,
190
203
  intervalInMs: options?.updateIntervalInMs
191
204
  });
192
205
  await poller.poll();
@@ -230,14 +243,14 @@ export class FirewallRulesImpl implements FirewallRules {
230
243
  serverName: string,
231
244
  firewallRuleName: string,
232
245
  options?: FirewallRulesDeleteOptionalParams
233
- ): Promise<PollerLike<PollOperationState<void>, void>> {
246
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
234
247
  const directSendOperation = async (
235
248
  args: coreClient.OperationArguments,
236
249
  spec: coreClient.OperationSpec
237
250
  ): Promise<void> => {
238
251
  return this.client.sendOperationRequest(args, spec);
239
252
  };
240
- const sendOperation = async (
253
+ const sendOperationFn = async (
241
254
  args: coreClient.OperationArguments,
242
255
  spec: coreClient.OperationSpec
243
256
  ) => {
@@ -270,13 +283,13 @@ export class FirewallRulesImpl implements FirewallRules {
270
283
  };
271
284
  };
272
285
 
273
- const lro = new LroImpl(
274
- sendOperation,
275
- { resourceGroupName, serverName, firewallRuleName, options },
276
- deleteOperationSpec
277
- );
278
- const poller = new LroEngine(lro, {
279
- resumeFrom: options?.resumeFrom,
286
+ const lro = createLroSpec({
287
+ sendOperationFn,
288
+ args: { resourceGroupName, serverName, firewallRuleName, options },
289
+ spec: deleteOperationSpec
290
+ });
291
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
292
+ restoreFrom: options?.resumeFrom,
280
293
  intervalInMs: options?.updateIntervalInMs
281
294
  });
282
295
  await poller.poll();
@@ -384,7 +397,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
384
397
  bodyMapper: Mappers.CloudError
385
398
  }
386
399
  },
387
- requestBody: Parameters.parameters3,
400
+ requestBody: Parameters.parameters5,
388
401
  queryParameters: [Parameters.apiVersion],
389
402
  urlParameters: [
390
403
  Parameters.$host,