@azure/arm-mysql 5.1.1-alpha.20250618.1 → 5.1.1-alpha.20250718.2

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 (235) hide show
  1. package/dist/browser/lroImpl.js +11 -3
  2. package/dist/browser/lroImpl.js.map +1 -1
  3. package/dist/browser/models/mappers.js +265 -121
  4. package/dist/browser/models/mappers.js.map +1 -1
  5. package/dist/browser/mySQLManagementClient.js +48 -11
  6. package/dist/browser/mySQLManagementClient.js.map +1 -1
  7. package/dist/browser/operations/advisors.js +23 -40
  8. package/dist/browser/operations/advisors.js.map +1 -1
  9. package/dist/browser/operations/checkNameAvailability.js +1 -0
  10. package/dist/browser/operations/checkNameAvailability.js.map +1 -1
  11. package/dist/browser/operations/configurations.js +21 -33
  12. package/dist/browser/operations/configurations.js.map +1 -1
  13. package/dist/browser/operations/databases.js +32 -39
  14. package/dist/browser/operations/databases.js.map +1 -1
  15. package/dist/browser/operations/firewallRules.js +32 -39
  16. package/dist/browser/operations/firewallRules.js.map +1 -1
  17. package/dist/browser/operations/locationBasedPerformanceTier.js +10 -27
  18. package/dist/browser/operations/locationBasedPerformanceTier.js.map +1 -1
  19. package/dist/browser/operations/locationBasedRecommendedActionSessionsOperationStatus.js +1 -0
  20. package/dist/browser/operations/locationBasedRecommendedActionSessionsOperationStatus.js.map +1 -1
  21. package/dist/browser/operations/locationBasedRecommendedActionSessionsResult.js +23 -40
  22. package/dist/browser/operations/locationBasedRecommendedActionSessionsResult.js.map +1 -1
  23. package/dist/browser/operations/logFiles.js +10 -27
  24. package/dist/browser/operations/logFiles.js.map +1 -1
  25. package/dist/browser/operations/operations.js +1 -0
  26. package/dist/browser/operations/operations.js.map +1 -1
  27. package/dist/browser/operations/privateEndpointConnections.js +56 -58
  28. package/dist/browser/operations/privateEndpointConnections.js.map +1 -1
  29. package/dist/browser/operations/privateLinkResources.js +23 -40
  30. package/dist/browser/operations/privateLinkResources.js.map +1 -1
  31. package/dist/browser/operations/queryTexts.js +23 -40
  32. package/dist/browser/operations/queryTexts.js.map +1 -1
  33. package/dist/browser/operations/recommendedActions.js +23 -40
  34. package/dist/browser/operations/recommendedActions.js.map +1 -1
  35. package/dist/browser/operations/recoverableServers.js +1 -0
  36. package/dist/browser/operations/recoverableServers.js.map +1 -1
  37. package/dist/browser/operations/replicas.js +10 -27
  38. package/dist/browser/operations/replicas.js.map +1 -1
  39. package/dist/browser/operations/serverAdministrators.js +32 -39
  40. package/dist/browser/operations/serverAdministrators.js.map +1 -1
  41. package/dist/browser/operations/serverBasedPerformanceTier.js +10 -27
  42. package/dist/browser/operations/serverBasedPerformanceTier.js.map +1 -1
  43. package/dist/browser/operations/serverKeys.js +45 -52
  44. package/dist/browser/operations/serverKeys.js.map +1 -1
  45. package/dist/browser/operations/serverParameters.js +12 -6
  46. package/dist/browser/operations/serverParameters.js.map +1 -1
  47. package/dist/browser/operations/serverSecurityAlertPolicies.js +34 -46
  48. package/dist/browser/operations/serverSecurityAlertPolicies.js.map +1 -1
  49. package/dist/browser/operations/servers.js +96 -95
  50. package/dist/browser/operations/servers.js.map +1 -1
  51. package/dist/browser/operations/topQueryStatistics.js +23 -40
  52. package/dist/browser/operations/topQueryStatistics.js.map +1 -1
  53. package/dist/browser/operations/virtualNetworkRules.js +45 -52
  54. package/dist/browser/operations/virtualNetworkRules.js.map +1 -1
  55. package/dist/browser/operations/waitStatistics.js +23 -40
  56. package/dist/browser/operations/waitStatistics.js.map +1 -1
  57. package/dist/browser/pagingHelper.js +2 -4
  58. package/dist/browser/pagingHelper.js.map +1 -1
  59. package/dist/commonjs/lroImpl.js +11 -3
  60. package/dist/commonjs/lroImpl.js.map +1 -1
  61. package/dist/commonjs/models/mappers.js +265 -121
  62. package/dist/commonjs/models/mappers.js.map +1 -1
  63. package/dist/commonjs/mySQLManagementClient.js +48 -11
  64. package/dist/commonjs/mySQLManagementClient.js.map +1 -1
  65. package/dist/commonjs/operations/advisors.js +23 -39
  66. package/dist/commonjs/operations/advisors.js.map +1 -1
  67. package/dist/commonjs/operations/checkNameAvailability.js +1 -0
  68. package/dist/commonjs/operations/checkNameAvailability.js.map +1 -1
  69. package/dist/commonjs/operations/configurations.js +21 -32
  70. package/dist/commonjs/operations/configurations.js.map +1 -1
  71. package/dist/commonjs/operations/databases.js +32 -38
  72. package/dist/commonjs/operations/databases.js.map +1 -1
  73. package/dist/commonjs/operations/firewallRules.js +32 -38
  74. package/dist/commonjs/operations/firewallRules.js.map +1 -1
  75. package/dist/commonjs/operations/locationBasedPerformanceTier.js +10 -26
  76. package/dist/commonjs/operations/locationBasedPerformanceTier.js.map +1 -1
  77. package/dist/commonjs/operations/locationBasedRecommendedActionSessionsOperationStatus.js +1 -0
  78. package/dist/commonjs/operations/locationBasedRecommendedActionSessionsOperationStatus.js.map +1 -1
  79. package/dist/commonjs/operations/locationBasedRecommendedActionSessionsResult.js +23 -39
  80. package/dist/commonjs/operations/locationBasedRecommendedActionSessionsResult.js.map +1 -1
  81. package/dist/commonjs/operations/logFiles.js +10 -26
  82. package/dist/commonjs/operations/logFiles.js.map +1 -1
  83. package/dist/commonjs/operations/operations.js +1 -0
  84. package/dist/commonjs/operations/operations.js.map +1 -1
  85. package/dist/commonjs/operations/privateEndpointConnections.js +56 -57
  86. package/dist/commonjs/operations/privateEndpointConnections.js.map +1 -1
  87. package/dist/commonjs/operations/privateLinkResources.js +23 -39
  88. package/dist/commonjs/operations/privateLinkResources.js.map +1 -1
  89. package/dist/commonjs/operations/queryTexts.js +23 -39
  90. package/dist/commonjs/operations/queryTexts.js.map +1 -1
  91. package/dist/commonjs/operations/recommendedActions.js +23 -39
  92. package/dist/commonjs/operations/recommendedActions.js.map +1 -1
  93. package/dist/commonjs/operations/recoverableServers.js +1 -0
  94. package/dist/commonjs/operations/recoverableServers.js.map +1 -1
  95. package/dist/commonjs/operations/replicas.js +10 -26
  96. package/dist/commonjs/operations/replicas.js.map +1 -1
  97. package/dist/commonjs/operations/serverAdministrators.js +32 -38
  98. package/dist/commonjs/operations/serverAdministrators.js.map +1 -1
  99. package/dist/commonjs/operations/serverBasedPerformanceTier.js +10 -26
  100. package/dist/commonjs/operations/serverBasedPerformanceTier.js.map +1 -1
  101. package/dist/commonjs/operations/serverKeys.js +45 -51
  102. package/dist/commonjs/operations/serverKeys.js.map +1 -1
  103. package/dist/commonjs/operations/serverParameters.js +12 -6
  104. package/dist/commonjs/operations/serverParameters.js.map +1 -1
  105. package/dist/commonjs/operations/serverSecurityAlertPolicies.js +34 -45
  106. package/dist/commonjs/operations/serverSecurityAlertPolicies.js.map +1 -1
  107. package/dist/commonjs/operations/servers.js +96 -94
  108. package/dist/commonjs/operations/servers.js.map +1 -1
  109. package/dist/commonjs/operations/topQueryStatistics.js +23 -39
  110. package/dist/commonjs/operations/topQueryStatistics.js.map +1 -1
  111. package/dist/commonjs/operations/virtualNetworkRules.js +45 -51
  112. package/dist/commonjs/operations/virtualNetworkRules.js.map +1 -1
  113. package/dist/commonjs/operations/waitStatistics.js +23 -39
  114. package/dist/commonjs/operations/waitStatistics.js.map +1 -1
  115. package/dist/commonjs/pagingHelper.js +2 -4
  116. package/dist/commonjs/pagingHelper.js.map +1 -1
  117. package/dist/commonjs/tsdoc-metadata.json +11 -11
  118. package/dist/esm/lroImpl.js +11 -3
  119. package/dist/esm/lroImpl.js.map +1 -1
  120. package/dist/esm/models/mappers.js +265 -121
  121. package/dist/esm/models/mappers.js.map +1 -1
  122. package/dist/esm/mySQLManagementClient.js +48 -11
  123. package/dist/esm/mySQLManagementClient.js.map +1 -1
  124. package/dist/esm/operations/advisors.js +23 -40
  125. package/dist/esm/operations/advisors.js.map +1 -1
  126. package/dist/esm/operations/checkNameAvailability.js +1 -0
  127. package/dist/esm/operations/checkNameAvailability.js.map +1 -1
  128. package/dist/esm/operations/configurations.js +21 -33
  129. package/dist/esm/operations/configurations.js.map +1 -1
  130. package/dist/esm/operations/databases.js +32 -39
  131. package/dist/esm/operations/databases.js.map +1 -1
  132. package/dist/esm/operations/firewallRules.js +32 -39
  133. package/dist/esm/operations/firewallRules.js.map +1 -1
  134. package/dist/esm/operations/locationBasedPerformanceTier.js +10 -27
  135. package/dist/esm/operations/locationBasedPerformanceTier.js.map +1 -1
  136. package/dist/esm/operations/locationBasedRecommendedActionSessionsOperationStatus.js +1 -0
  137. package/dist/esm/operations/locationBasedRecommendedActionSessionsOperationStatus.js.map +1 -1
  138. package/dist/esm/operations/locationBasedRecommendedActionSessionsResult.js +23 -40
  139. package/dist/esm/operations/locationBasedRecommendedActionSessionsResult.js.map +1 -1
  140. package/dist/esm/operations/logFiles.js +10 -27
  141. package/dist/esm/operations/logFiles.js.map +1 -1
  142. package/dist/esm/operations/operations.js +1 -0
  143. package/dist/esm/operations/operations.js.map +1 -1
  144. package/dist/esm/operations/privateEndpointConnections.js +56 -58
  145. package/dist/esm/operations/privateEndpointConnections.js.map +1 -1
  146. package/dist/esm/operations/privateLinkResources.js +23 -40
  147. package/dist/esm/operations/privateLinkResources.js.map +1 -1
  148. package/dist/esm/operations/queryTexts.js +23 -40
  149. package/dist/esm/operations/queryTexts.js.map +1 -1
  150. package/dist/esm/operations/recommendedActions.js +23 -40
  151. package/dist/esm/operations/recommendedActions.js.map +1 -1
  152. package/dist/esm/operations/recoverableServers.js +1 -0
  153. package/dist/esm/operations/recoverableServers.js.map +1 -1
  154. package/dist/esm/operations/replicas.js +10 -27
  155. package/dist/esm/operations/replicas.js.map +1 -1
  156. package/dist/esm/operations/serverAdministrators.js +32 -39
  157. package/dist/esm/operations/serverAdministrators.js.map +1 -1
  158. package/dist/esm/operations/serverBasedPerformanceTier.js +10 -27
  159. package/dist/esm/operations/serverBasedPerformanceTier.js.map +1 -1
  160. package/dist/esm/operations/serverKeys.js +45 -52
  161. package/dist/esm/operations/serverKeys.js.map +1 -1
  162. package/dist/esm/operations/serverParameters.js +12 -6
  163. package/dist/esm/operations/serverParameters.js.map +1 -1
  164. package/dist/esm/operations/serverSecurityAlertPolicies.js +34 -46
  165. package/dist/esm/operations/serverSecurityAlertPolicies.js.map +1 -1
  166. package/dist/esm/operations/servers.js +96 -95
  167. package/dist/esm/operations/servers.js.map +1 -1
  168. package/dist/esm/operations/topQueryStatistics.js +23 -40
  169. package/dist/esm/operations/topQueryStatistics.js.map +1 -1
  170. package/dist/esm/operations/virtualNetworkRules.js +45 -52
  171. package/dist/esm/operations/virtualNetworkRules.js.map +1 -1
  172. package/dist/esm/operations/waitStatistics.js +23 -40
  173. package/dist/esm/operations/waitStatistics.js.map +1 -1
  174. package/dist/esm/pagingHelper.js +2 -4
  175. package/dist/esm/pagingHelper.js.map +1 -1
  176. package/dist/react-native/lroImpl.js +11 -3
  177. package/dist/react-native/lroImpl.js.map +1 -1
  178. package/dist/react-native/models/mappers.js +265 -121
  179. package/dist/react-native/models/mappers.js.map +1 -1
  180. package/dist/react-native/mySQLManagementClient.js +48 -11
  181. package/dist/react-native/mySQLManagementClient.js.map +1 -1
  182. package/dist/react-native/operations/advisors.js +23 -40
  183. package/dist/react-native/operations/advisors.js.map +1 -1
  184. package/dist/react-native/operations/checkNameAvailability.js +1 -0
  185. package/dist/react-native/operations/checkNameAvailability.js.map +1 -1
  186. package/dist/react-native/operations/configurations.js +21 -33
  187. package/dist/react-native/operations/configurations.js.map +1 -1
  188. package/dist/react-native/operations/databases.js +32 -39
  189. package/dist/react-native/operations/databases.js.map +1 -1
  190. package/dist/react-native/operations/firewallRules.js +32 -39
  191. package/dist/react-native/operations/firewallRules.js.map +1 -1
  192. package/dist/react-native/operations/locationBasedPerformanceTier.js +10 -27
  193. package/dist/react-native/operations/locationBasedPerformanceTier.js.map +1 -1
  194. package/dist/react-native/operations/locationBasedRecommendedActionSessionsOperationStatus.js +1 -0
  195. package/dist/react-native/operations/locationBasedRecommendedActionSessionsOperationStatus.js.map +1 -1
  196. package/dist/react-native/operations/locationBasedRecommendedActionSessionsResult.js +23 -40
  197. package/dist/react-native/operations/locationBasedRecommendedActionSessionsResult.js.map +1 -1
  198. package/dist/react-native/operations/logFiles.js +10 -27
  199. package/dist/react-native/operations/logFiles.js.map +1 -1
  200. package/dist/react-native/operations/operations.js +1 -0
  201. package/dist/react-native/operations/operations.js.map +1 -1
  202. package/dist/react-native/operations/privateEndpointConnections.js +56 -58
  203. package/dist/react-native/operations/privateEndpointConnections.js.map +1 -1
  204. package/dist/react-native/operations/privateLinkResources.js +23 -40
  205. package/dist/react-native/operations/privateLinkResources.js.map +1 -1
  206. package/dist/react-native/operations/queryTexts.js +23 -40
  207. package/dist/react-native/operations/queryTexts.js.map +1 -1
  208. package/dist/react-native/operations/recommendedActions.js +23 -40
  209. package/dist/react-native/operations/recommendedActions.js.map +1 -1
  210. package/dist/react-native/operations/recoverableServers.js +1 -0
  211. package/dist/react-native/operations/recoverableServers.js.map +1 -1
  212. package/dist/react-native/operations/replicas.js +10 -27
  213. package/dist/react-native/operations/replicas.js.map +1 -1
  214. package/dist/react-native/operations/serverAdministrators.js +32 -39
  215. package/dist/react-native/operations/serverAdministrators.js.map +1 -1
  216. package/dist/react-native/operations/serverBasedPerformanceTier.js +10 -27
  217. package/dist/react-native/operations/serverBasedPerformanceTier.js.map +1 -1
  218. package/dist/react-native/operations/serverKeys.js +45 -52
  219. package/dist/react-native/operations/serverKeys.js.map +1 -1
  220. package/dist/react-native/operations/serverParameters.js +12 -6
  221. package/dist/react-native/operations/serverParameters.js.map +1 -1
  222. package/dist/react-native/operations/serverSecurityAlertPolicies.js +34 -46
  223. package/dist/react-native/operations/serverSecurityAlertPolicies.js.map +1 -1
  224. package/dist/react-native/operations/servers.js +96 -95
  225. package/dist/react-native/operations/servers.js.map +1 -1
  226. package/dist/react-native/operations/topQueryStatistics.js +23 -40
  227. package/dist/react-native/operations/topQueryStatistics.js.map +1 -1
  228. package/dist/react-native/operations/virtualNetworkRules.js +45 -52
  229. package/dist/react-native/operations/virtualNetworkRules.js.map +1 -1
  230. package/dist/react-native/operations/waitStatistics.js +23 -40
  231. package/dist/react-native/operations/waitStatistics.js.map +1 -1
  232. package/dist/react-native/pagingHelper.js +2 -4
  233. package/dist/react-native/pagingHelper.js.map +1 -1
  234. package/package.json +2 -2
  235. /package/review/{arm-mysql.api.md → arm-mysql-node.api.md} +0 -0
@@ -18,6 +18,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
18
18
  /// <reference lib="esnext.asynciterable" />
19
19
  /** Class containing ServerSecurityAlertPolicies operations. */
20
20
  class ServerSecurityAlertPoliciesImpl {
21
+ client;
21
22
  /**
22
23
  * Initialize a new instance of the class ServerSecurityAlertPolicies class.
23
24
  * @param client Reference to the service client
@@ -41,52 +42,35 @@ class ServerSecurityAlertPoliciesImpl {
41
42
  return this;
42
43
  },
43
44
  byPage: (settings) => {
44
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
45
+ if (settings?.maxPageSize) {
45
46
  throw new Error("maxPageSize is not supported by this operation.");
46
47
  }
47
48
  return this.listByServerPagingPage(resourceGroupName, serverName, options, settings);
48
49
  }
49
50
  };
50
51
  }
51
- listByServerPagingPage(resourceGroupName, serverName, options, settings) {
52
- return tslib_1.__asyncGenerator(this, arguments, function* listByServerPagingPage_1() {
53
- let result;
54
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
55
- if (!continuationToken) {
56
- result = yield tslib_1.__await(this._listByServer(resourceGroupName, serverName, options));
57
- let page = result.value || [];
58
- continuationToken = result.nextLink;
59
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
- yield yield tslib_1.__await(page);
61
- }
62
- while (continuationToken) {
63
- result = yield tslib_1.__await(this._listByServerNext(resourceGroupName, serverName, continuationToken, options));
64
- continuationToken = result.nextLink;
65
- let page = result.value || [];
66
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
- yield yield tslib_1.__await(page);
68
- }
69
- });
52
+ async *listByServerPagingPage(resourceGroupName, serverName, options, settings) {
53
+ let result;
54
+ let continuationToken = settings?.continuationToken;
55
+ if (!continuationToken) {
56
+ result = await this._listByServer(resourceGroupName, serverName, options);
57
+ let page = result.value || [];
58
+ continuationToken = result.nextLink;
59
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
+ yield page;
61
+ }
62
+ while (continuationToken) {
63
+ result = await this._listByServerNext(resourceGroupName, serverName, continuationToken, options);
64
+ continuationToken = result.nextLink;
65
+ let page = result.value || [];
66
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
+ yield page;
68
+ }
70
69
  }
71
- listByServerPagingAll(resourceGroupName, serverName, options) {
72
- return tslib_1.__asyncGenerator(this, arguments, function* listByServerPagingAll_1() {
73
- var _a, e_1, _b, _c;
74
- try {
75
- for (var _d = true, _e = tslib_1.__asyncValues(this.listByServerPagingPage(resourceGroupName, serverName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
76
- _c = _f.value;
77
- _d = false;
78
- const page = _c;
79
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
80
- }
81
- }
82
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
83
- finally {
84
- try {
85
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
86
- }
87
- finally { if (e_1) throw e_1.error; }
88
- }
89
- });
70
+ async *listByServerPagingAll(resourceGroupName, serverName, options) {
71
+ for await (const page of this.listByServerPagingPage(resourceGroupName, serverName, options)) {
72
+ yield* page;
73
+ }
90
74
  }
91
75
  /**
92
76
  * Get a server's security alert policy.
@@ -111,14 +95,19 @@ class ServerSecurityAlertPoliciesImpl {
111
95
  return this.client.sendOperationRequest(args, spec);
112
96
  };
113
97
  const sendOperation = async (args, spec) => {
114
- var _a;
115
98
  let currentRawResponse = undefined;
116
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
99
+ const providedCallback = args.options?.onResponse;
117
100
  const callback = (rawResponse, flatResponse) => {
118
101
  currentRawResponse = rawResponse;
119
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
102
+ providedCallback?.(rawResponse, flatResponse);
103
+ };
104
+ const updatedArgs = {
105
+ ...args,
106
+ options: {
107
+ ...args.options,
108
+ onResponse: callback
109
+ }
120
110
  };
121
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
122
111
  const flatResponse = await directSendOperation(updatedArgs, spec);
123
112
  return {
124
113
  flatResponse,
@@ -137,8 +126,8 @@ class ServerSecurityAlertPoliciesImpl {
137
126
  options
138
127
  }, createOrUpdateOperationSpec);
139
128
  const poller = new core_lro_1.LroEngine(lro, {
140
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
141
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
129
+ resumeFrom: options?.resumeFrom,
130
+ intervalInMs: options?.updateIntervalInMs
142
131
  });
143
132
  await poller.poll();
144
133
  return poller;
@@ -1 +1 @@
1
- {"version":3,"file":"serverSecurityAlertPolicies.js","sourceRoot":"","sources":["../../../src/operations/serverSecurityAlertPolicies.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAA4E;AAC5E,8CAAwC;AAcxC,4CAA4C;AAC5C,+DAA+D;AAC/D,MAAa,+BAA+B;IAI1C;;;OAGG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,YAAY,CACjB,iBAAyB,EACzB,UAAkB,EAClB,OAA+D;QAE/D,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,CACrC,iBAAiB,EACjB,UAAU,EACV,OAAO,CACR,CAAC;QACF,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;Y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,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { ServerSecurityAlertPolicies } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { MySQLManagementClient } from \"../mySQLManagementClient.js\";\nimport { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"../lroImpl.js\";\nimport {\n ServerSecurityAlertPolicy,\n ServerSecurityAlertPoliciesListByServerNextOptionalParams,\n ServerSecurityAlertPoliciesListByServerOptionalParams,\n ServerSecurityAlertPoliciesListByServerResponse,\n SecurityAlertPolicyName,\n ServerSecurityAlertPoliciesGetOptionalParams,\n ServerSecurityAlertPoliciesGetResponse,\n ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams,\n ServerSecurityAlertPoliciesCreateOrUpdateResponse,\n ServerSecurityAlertPoliciesListByServerNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing ServerSecurityAlertPolicies operations. */\nexport class ServerSecurityAlertPoliciesImpl\n implements ServerSecurityAlertPolicies {\n private readonly client: MySQLManagementClient;\n\n /**\n * Initialize a new instance of the class ServerSecurityAlertPolicies class.\n * @param client Reference to the service client\n */\n constructor(client: MySQLManagementClient) {\n this.client = client;\n }\n\n /**\n * Get the server's threat detection policies.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param options The options parameters.\n */\n public listByServer(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): PagedAsyncIterableIterator<ServerSecurityAlertPolicy> {\n const iter = this.listByServerPagingAll(\n resourceGroupName,\n serverName,\n options\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listByServerPagingPage(\n resourceGroupName,\n serverName,\n options,\n settings\n );\n }\n };\n }\n\n private async *listByServerPagingPage(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<ServerSecurityAlertPolicy[]> {\n let result: ServerSecurityAlertPoliciesListByServerResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._listByServer(resourceGroupName, serverName, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listByServerNext(\n resourceGroupName,\n serverName,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listByServerPagingAll(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): AsyncIterableIterator<ServerSecurityAlertPolicy> {\n for await (const page of this.listByServerPagingPage(\n resourceGroupName,\n serverName,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * Get a server's security alert policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the security alert policy.\n * @param options The options parameters.\n */\n get(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n options?: ServerSecurityAlertPoliciesGetOptionalParams\n ): Promise<ServerSecurityAlertPoliciesGetResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, securityAlertPolicyName, options },\n getOperationSpec\n );\n }\n\n /**\n * Creates or updates a threat detection policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the threat detection policy.\n * @param parameters The server security alert policy.\n * @param options The options parameters.\n */\n async beginCreateOrUpdate(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n parameters: ServerSecurityAlertPolicy,\n options?: ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams\n ): Promise<\n PollerLike<\n PollOperationState<ServerSecurityAlertPoliciesCreateOrUpdateResponse>,\n ServerSecurityAlertPoliciesCreateOrUpdateResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ServerSecurityAlertPoliciesCreateOrUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n {\n resourceGroupName,\n serverName,\n securityAlertPolicyName,\n parameters,\n options\n },\n createOrUpdateOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Creates or updates a threat detection policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the threat detection policy.\n * @param parameters The server security alert policy.\n * @param options The options parameters.\n */\n async beginCreateOrUpdateAndWait(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n parameters: ServerSecurityAlertPolicy,\n options?: ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams\n ): Promise<ServerSecurityAlertPoliciesCreateOrUpdateResponse> {\n const poller = await this.beginCreateOrUpdate(\n resourceGroupName,\n serverName,\n securityAlertPolicyName,\n parameters,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Get the server's threat detection policies.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param options The options parameters.\n */\n private _listByServer(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): Promise<ServerSecurityAlertPoliciesListByServerResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, options },\n listByServerOperationSpec\n );\n }\n\n /**\n * ListByServerNext\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param nextLink The nextLink from the previous successful call to the ListByServer method.\n * @param options The options parameters.\n */\n private _listByServerNext(\n resourceGroupName: string,\n serverName: string,\n nextLink: string,\n options?: ServerSecurityAlertPoliciesListByServerNextOptionalParams\n ): Promise<ServerSecurityAlertPoliciesListByServerNextResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, nextLink, options },\n listByServerNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.securityAlertPolicyName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 201: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 202: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 204: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n default: {}\n },\n requestBody: Parameters.parameters7,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.securityAlertPolicyName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst listByServerOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicyListResult\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listByServerNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicyListResult\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.nextLink\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"serverSecurityAlertPolicies.js","sourceRoot":"","sources":["../../../src/operations/serverSecurityAlertPolicies.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAA4E;AAC5E,8CAAwC;AAcxC,4CAA4C;AAC5C,+DAA+D;AAC/D,MAAa,+BAA+B;IAEzB,MAAM,CAAwB;IAE/C;;;OAGG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,YAAY,CACjB,iBAAyB,EACzB,UAAkB,EAClB,OAA+D;QAE/D,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,CACrC,iBAAiB,EACjB,UAAU,EACV,OAAO,CACR,CAAC;QACF,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,sBAAsB,CAChC,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,QAAQ,CACT,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,sBAAsB,CACnC,iBAAyB,EACzB,UAAkB,EAClB,OAA+D,EAC/D,QAAuB;QAEvB,IAAI,MAAuD,CAAC;QAC5D,IAAI,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAC;QACpD,IAAI,CAAC,i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AAiB;QAC5B,UAAU,CAAC,UAAU;KACtB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,6BAA6B,GAA6B;IAC9D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,mCAAmC;SACxD;QACD,OAAO,EAAE,EAAE;KACZ;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { ServerSecurityAlertPolicies } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { MySQLManagementClient } from \"../mySQLManagementClient.js\";\nimport { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"../lroImpl.js\";\nimport {\n ServerSecurityAlertPolicy,\n ServerSecurityAlertPoliciesListByServerNextOptionalParams,\n ServerSecurityAlertPoliciesListByServerOptionalParams,\n ServerSecurityAlertPoliciesListByServerResponse,\n SecurityAlertPolicyName,\n ServerSecurityAlertPoliciesGetOptionalParams,\n ServerSecurityAlertPoliciesGetResponse,\n ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams,\n ServerSecurityAlertPoliciesCreateOrUpdateResponse,\n ServerSecurityAlertPoliciesListByServerNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing ServerSecurityAlertPolicies operations. */\nexport class ServerSecurityAlertPoliciesImpl\n implements ServerSecurityAlertPolicies {\n private readonly client: MySQLManagementClient;\n\n /**\n * Initialize a new instance of the class ServerSecurityAlertPolicies class.\n * @param client Reference to the service client\n */\n constructor(client: MySQLManagementClient) {\n this.client = client;\n }\n\n /**\n * Get the server's threat detection policies.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param options The options parameters.\n */\n public listByServer(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): PagedAsyncIterableIterator<ServerSecurityAlertPolicy> {\n const iter = this.listByServerPagingAll(\n resourceGroupName,\n serverName,\n options\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listByServerPagingPage(\n resourceGroupName,\n serverName,\n options,\n settings\n );\n }\n };\n }\n\n private async *listByServerPagingPage(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<ServerSecurityAlertPolicy[]> {\n let result: ServerSecurityAlertPoliciesListByServerResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._listByServer(resourceGroupName, serverName, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listByServerNext(\n resourceGroupName,\n serverName,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listByServerPagingAll(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): AsyncIterableIterator<ServerSecurityAlertPolicy> {\n for await (const page of this.listByServerPagingPage(\n resourceGroupName,\n serverName,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * Get a server's security alert policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the security alert policy.\n * @param options The options parameters.\n */\n get(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n options?: ServerSecurityAlertPoliciesGetOptionalParams\n ): Promise<ServerSecurityAlertPoliciesGetResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, securityAlertPolicyName, options },\n getOperationSpec\n );\n }\n\n /**\n * Creates or updates a threat detection policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the threat detection policy.\n * @param parameters The server security alert policy.\n * @param options The options parameters.\n */\n async beginCreateOrUpdate(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n parameters: ServerSecurityAlertPolicy,\n options?: ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams\n ): Promise<\n PollerLike<\n PollOperationState<ServerSecurityAlertPoliciesCreateOrUpdateResponse>,\n ServerSecurityAlertPoliciesCreateOrUpdateResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ServerSecurityAlertPoliciesCreateOrUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n {\n resourceGroupName,\n serverName,\n securityAlertPolicyName,\n parameters,\n options\n },\n createOrUpdateOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Creates or updates a threat detection policy.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param securityAlertPolicyName The name of the threat detection policy.\n * @param parameters The server security alert policy.\n * @param options The options parameters.\n */\n async beginCreateOrUpdateAndWait(\n resourceGroupName: string,\n serverName: string,\n securityAlertPolicyName: SecurityAlertPolicyName,\n parameters: ServerSecurityAlertPolicy,\n options?: ServerSecurityAlertPoliciesCreateOrUpdateOptionalParams\n ): Promise<ServerSecurityAlertPoliciesCreateOrUpdateResponse> {\n const poller = await this.beginCreateOrUpdate(\n resourceGroupName,\n serverName,\n securityAlertPolicyName,\n parameters,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Get the server's threat detection policies.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param options The options parameters.\n */\n private _listByServer(\n resourceGroupName: string,\n serverName: string,\n options?: ServerSecurityAlertPoliciesListByServerOptionalParams\n ): Promise<ServerSecurityAlertPoliciesListByServerResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, options },\n listByServerOperationSpec\n );\n }\n\n /**\n * ListByServerNext\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param serverName The name of the server.\n * @param nextLink The nextLink from the previous successful call to the ListByServer method.\n * @param options The options parameters.\n */\n private _listByServerNext(\n resourceGroupName: string,\n serverName: string,\n nextLink: string,\n options?: ServerSecurityAlertPoliciesListByServerNextOptionalParams\n ): Promise<ServerSecurityAlertPoliciesListByServerNextResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, serverName, nextLink, options },\n listByServerNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.securityAlertPolicyName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 201: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 202: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n 204: {\n bodyMapper: Mappers.ServerSecurityAlertPolicy\n },\n default: {}\n },\n requestBody: Parameters.parameters7,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.securityAlertPolicyName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst listByServerOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/securityAlertPolicies\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicyListResult\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listByServerNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServerSecurityAlertPolicyListResult\n },\n default: {}\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.serverName,\n Parameters.nextLink\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -17,6 +17,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /// <reference lib="esnext.asynciterable" />
18
18
  /** Class containing Servers operations. */
19
19
  class ServersImpl {
20
+ client;
20
21
  /**
21
22
  * Initialize a new instance of the class Servers class.
22
23
  * @param client Reference to the service client
@@ -39,39 +40,22 @@ class ServersImpl {
39
40
  return this;
40
41
  },
41
42
  byPage: (settings) => {
42
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
43
+ if (settings?.maxPageSize) {
43
44
  throw new Error("maxPageSize is not supported by this operation.");
44
45
  }
45
46
  return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
46
47
  }
47
48
  };
48
49
  }
49
- listByResourceGroupPagingPage(resourceGroupName, options, _settings) {
50
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
51
- let result;
52
- result = yield tslib_1.__await(this._listByResourceGroup(resourceGroupName, options));
53
- yield yield tslib_1.__await(result.value || []);
54
- });
50
+ async *listByResourceGroupPagingPage(resourceGroupName, options, _settings) {
51
+ let result;
52
+ result = await this._listByResourceGroup(resourceGroupName, options);
53
+ yield result.value || [];
55
54
  }
56
- listByResourceGroupPagingAll(resourceGroupName, options) {
57
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
58
- var _a, e_1, _b, _c;
59
- try {
60
- for (var _d = true, _e = tslib_1.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
61
- _c = _f.value;
62
- _d = false;
63
- const page = _c;
64
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
65
- }
66
- }
67
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
68
- finally {
69
- try {
70
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
71
- }
72
- finally { if (e_1) throw e_1.error; }
73
- }
74
- });
55
+ async *listByResourceGroupPagingAll(resourceGroupName, options) {
56
+ for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
57
+ yield* page;
58
+ }
75
59
  }
76
60
  /**
77
61
  * List all the servers in a given subscription.
@@ -87,39 +71,22 @@ class ServersImpl {
87
71
  return this;
88
72
  },
89
73
  byPage: (settings) => {
90
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
74
+ if (settings?.maxPageSize) {
91
75
  throw new Error("maxPageSize is not supported by this operation.");
92
76
  }
93
77
  return this.listPagingPage(options, settings);
94
78
  }
95
79
  };
96
80
  }
97
- listPagingPage(options, _settings) {
98
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
99
- let result;
100
- result = yield tslib_1.__await(this._list(options));
101
- yield yield tslib_1.__await(result.value || []);
102
- });
81
+ async *listPagingPage(options, _settings) {
82
+ let result;
83
+ result = await this._list(options);
84
+ yield result.value || [];
103
85
  }
104
- listPagingAll(options) {
105
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
106
- var _a, e_2, _b, _c;
107
- try {
108
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
109
- _c = _f.value;
110
- _d = false;
111
- const page = _c;
112
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
113
- }
114
- }
115
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
116
- finally {
117
- try {
118
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
119
- }
120
- finally { if (e_2) throw e_2.error; }
121
- }
122
- });
86
+ async *listPagingAll(options) {
87
+ for await (const page of this.listPagingPage(options)) {
88
+ yield* page;
89
+ }
123
90
  }
124
91
  /**
125
92
  * Creates a new server or updates an existing server. The update action will overwrite the existing
@@ -134,14 +101,19 @@ class ServersImpl {
134
101
  return this.client.sendOperationRequest(args, spec);
135
102
  };
136
103
  const sendOperation = async (args, spec) => {
137
- var _a;
138
104
  let currentRawResponse = undefined;
139
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
105
+ const providedCallback = args.options?.onResponse;
140
106
  const callback = (rawResponse, flatResponse) => {
141
107
  currentRawResponse = rawResponse;
142
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
108
+ providedCallback?.(rawResponse, flatResponse);
109
+ };
110
+ const updatedArgs = {
111
+ ...args,
112
+ options: {
113
+ ...args.options,
114
+ onResponse: callback
115
+ }
143
116
  };
144
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
145
117
  const flatResponse = await directSendOperation(updatedArgs, spec);
146
118
  return {
147
119
  flatResponse,
@@ -154,8 +126,8 @@ class ServersImpl {
154
126
  };
155
127
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, parameters, options }, createOperationSpec);
156
128
  const poller = new core_lro_1.LroEngine(lro, {
157
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
158
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
129
+ resumeFrom: options?.resumeFrom,
130
+ intervalInMs: options?.updateIntervalInMs
159
131
  });
160
132
  await poller.poll();
161
133
  return poller;
@@ -185,14 +157,19 @@ class ServersImpl {
185
157
  return this.client.sendOperationRequest(args, spec);
186
158
  };
187
159
  const sendOperation = async (args, spec) => {
188
- var _a;
189
160
  let currentRawResponse = undefined;
190
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
161
+ const providedCallback = args.options?.onResponse;
191
162
  const callback = (rawResponse, flatResponse) => {
192
163
  currentRawResponse = rawResponse;
193
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
164
+ providedCallback?.(rawResponse, flatResponse);
165
+ };
166
+ const updatedArgs = {
167
+ ...args,
168
+ options: {
169
+ ...args.options,
170
+ onResponse: callback
171
+ }
194
172
  };
195
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
196
173
  const flatResponse = await directSendOperation(updatedArgs, spec);
197
174
  return {
198
175
  flatResponse,
@@ -205,8 +182,8 @@ class ServersImpl {
205
182
  };
206
183
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, parameters, options }, updateOperationSpec);
207
184
  const poller = new core_lro_1.LroEngine(lro, {
208
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
209
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
185
+ resumeFrom: options?.resumeFrom,
186
+ intervalInMs: options?.updateIntervalInMs
210
187
  });
211
188
  await poller.poll();
212
189
  return poller;
@@ -234,14 +211,19 @@ class ServersImpl {
234
211
  return this.client.sendOperationRequest(args, spec);
235
212
  };
236
213
  const sendOperation = async (args, spec) => {
237
- var _a;
238
214
  let currentRawResponse = undefined;
239
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
215
+ const providedCallback = args.options?.onResponse;
240
216
  const callback = (rawResponse, flatResponse) => {
241
217
  currentRawResponse = rawResponse;
242
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
218
+ providedCallback?.(rawResponse, flatResponse);
219
+ };
220
+ const updatedArgs = {
221
+ ...args,
222
+ options: {
223
+ ...args.options,
224
+ onResponse: callback
225
+ }
243
226
  };
244
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
245
227
  const flatResponse = await directSendOperation(updatedArgs, spec);
246
228
  return {
247
229
  flatResponse,
@@ -254,8 +236,8 @@ class ServersImpl {
254
236
  };
255
237
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, options }, deleteOperationSpec);
256
238
  const poller = new core_lro_1.LroEngine(lro, {
257
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
258
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
239
+ resumeFrom: options?.resumeFrom,
240
+ intervalInMs: options?.updateIntervalInMs
259
241
  });
260
242
  await poller.poll();
261
243
  return poller;
@@ -305,14 +287,19 @@ class ServersImpl {
305
287
  return this.client.sendOperationRequest(args, spec);
306
288
  };
307
289
  const sendOperation = async (args, spec) => {
308
- var _a;
309
290
  let currentRawResponse = undefined;
310
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
291
+ const providedCallback = args.options?.onResponse;
311
292
  const callback = (rawResponse, flatResponse) => {
312
293
  currentRawResponse = rawResponse;
313
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
294
+ providedCallback?.(rawResponse, flatResponse);
295
+ };
296
+ const updatedArgs = {
297
+ ...args,
298
+ options: {
299
+ ...args.options,
300
+ onResponse: callback
301
+ }
314
302
  };
315
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
316
303
  const flatResponse = await directSendOperation(updatedArgs, spec);
317
304
  return {
318
305
  flatResponse,
@@ -325,8 +312,8 @@ class ServersImpl {
325
312
  };
326
313
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, options }, restartOperationSpec);
327
314
  const poller = new core_lro_1.LroEngine(lro, {
328
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
329
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
315
+ resumeFrom: options?.resumeFrom,
316
+ intervalInMs: options?.updateIntervalInMs
330
317
  });
331
318
  await poller.poll();
332
319
  return poller;
@@ -352,14 +339,19 @@ class ServersImpl {
352
339
  return this.client.sendOperationRequest(args, spec);
353
340
  };
354
341
  const sendOperation = async (args, spec) => {
355
- var _a;
356
342
  let currentRawResponse = undefined;
357
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
343
+ const providedCallback = args.options?.onResponse;
358
344
  const callback = (rawResponse, flatResponse) => {
359
345
  currentRawResponse = rawResponse;
360
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
346
+ providedCallback?.(rawResponse, flatResponse);
347
+ };
348
+ const updatedArgs = {
349
+ ...args,
350
+ options: {
351
+ ...args.options,
352
+ onResponse: callback
353
+ }
361
354
  };
362
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
363
355
  const flatResponse = await directSendOperation(updatedArgs, spec);
364
356
  return {
365
357
  flatResponse,
@@ -372,8 +364,8 @@ class ServersImpl {
372
364
  };
373
365
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, options }, startOperationSpec);
374
366
  const poller = new core_lro_1.LroEngine(lro, {
375
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
376
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
367
+ resumeFrom: options?.resumeFrom,
368
+ intervalInMs: options?.updateIntervalInMs
377
369
  });
378
370
  await poller.poll();
379
371
  return poller;
@@ -399,14 +391,19 @@ class ServersImpl {
399
391
  return this.client.sendOperationRequest(args, spec);
400
392
  };
401
393
  const sendOperation = async (args, spec) => {
402
- var _a;
403
394
  let currentRawResponse = undefined;
404
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
395
+ const providedCallback = args.options?.onResponse;
405
396
  const callback = (rawResponse, flatResponse) => {
406
397
  currentRawResponse = rawResponse;
407
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
398
+ providedCallback?.(rawResponse, flatResponse);
399
+ };
400
+ const updatedArgs = {
401
+ ...args,
402
+ options: {
403
+ ...args.options,
404
+ onResponse: callback
405
+ }
408
406
  };
409
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
410
407
  const flatResponse = await directSendOperation(updatedArgs, spec);
411
408
  return {
412
409
  flatResponse,
@@ -419,8 +416,8 @@ class ServersImpl {
419
416
  };
420
417
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, options }, stopOperationSpec);
421
418
  const poller = new core_lro_1.LroEngine(lro, {
422
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
423
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
419
+ resumeFrom: options?.resumeFrom,
420
+ intervalInMs: options?.updateIntervalInMs
424
421
  });
425
422
  await poller.poll();
426
423
  return poller;
@@ -447,14 +444,19 @@ class ServersImpl {
447
444
  return this.client.sendOperationRequest(args, spec);
448
445
  };
449
446
  const sendOperation = async (args, spec) => {
450
- var _a;
451
447
  let currentRawResponse = undefined;
452
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
448
+ const providedCallback = args.options?.onResponse;
453
449
  const callback = (rawResponse, flatResponse) => {
454
450
  currentRawResponse = rawResponse;
455
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
451
+ providedCallback?.(rawResponse, flatResponse);
452
+ };
453
+ const updatedArgs = {
454
+ ...args,
455
+ options: {
456
+ ...args.options,
457
+ onResponse: callback
458
+ }
456
459
  };
457
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
458
460
  const flatResponse = await directSendOperation(updatedArgs, spec);
459
461
  return {
460
462
  flatResponse,
@@ -467,8 +469,8 @@ class ServersImpl {
467
469
  };
468
470
  const lro = new lroImpl_js_1.LroImpl(sendOperation, { resourceGroupName, serverName, parameters, options }, upgradeOperationSpec);
469
471
  const poller = new core_lro_1.LroEngine(lro, {
470
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
471
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
472
+ resumeFrom: options?.resumeFrom,
473
+ intervalInMs: options?.updateIntervalInMs
472
474
  });
473
475
  await poller.poll();
474
476
  return poller;