@azure/arm-advisor 3.2.0-alpha.20241218.1 → 3.2.0-alpha.20241220.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 (262) hide show
  1. package/{dist-esm/src → dist/commonjs}/advisorManagementClient.d.ts +2 -2
  2. package/dist/commonjs/advisorManagementClient.d.ts.map +1 -0
  3. package/dist/commonjs/advisorManagementClient.js +103 -0
  4. package/dist/commonjs/advisorManagementClient.js.map +1 -0
  5. package/dist/commonjs/index.d.ts +5 -0
  6. package/{dist-esm/src → dist/commonjs}/index.d.ts.map +1 -1
  7. package/dist/commonjs/index.js +19 -0
  8. package/dist/commonjs/index.js.map +1 -0
  9. package/{dist-esm/src → dist/commonjs}/models/index.d.ts.map +1 -1
  10. package/dist/commonjs/models/index.js +77 -0
  11. package/dist/commonjs/models/index.js.map +1 -0
  12. package/dist/commonjs/models/mappers.js +652 -0
  13. package/dist/commonjs/models/mappers.js.map +1 -0
  14. package/dist/commonjs/models/parameters.js +172 -0
  15. package/dist/commonjs/models/parameters.js.map +1 -0
  16. package/{dist-esm/src → dist/commonjs}/operations/configurations.d.ts +3 -3
  17. package/dist/commonjs/operations/configurations.d.ts.map +1 -0
  18. package/dist/commonjs/operations/configurations.js +271 -0
  19. package/dist/commonjs/operations/configurations.js.map +1 -0
  20. package/dist/commonjs/operations/index.d.ts +6 -0
  21. package/{dist-esm/src → dist/commonjs}/operations/index.d.ts.map +1 -1
  22. package/dist/commonjs/operations/index.js +16 -0
  23. package/dist/commonjs/operations/index.js.map +1 -0
  24. package/{dist-esm/src → dist/commonjs}/operations/operations.d.ts +3 -3
  25. package/dist/commonjs/operations/operations.d.ts.map +1 -0
  26. package/dist/commonjs/operations/operations.js +137 -0
  27. package/dist/commonjs/operations/operations.js.map +1 -0
  28. package/{dist-esm/src → dist/commonjs}/operations/recommendationMetadata.d.ts +3 -3
  29. package/dist/commonjs/operations/recommendationMetadata.d.ts.map +1 -0
  30. package/dist/commonjs/operations/recommendationMetadata.js +165 -0
  31. package/dist/commonjs/operations/recommendationMetadata.js.map +1 -0
  32. package/{dist-esm/src → dist/commonjs}/operations/recommendations.d.ts +3 -3
  33. package/dist/commonjs/operations/recommendations.d.ts.map +1 -0
  34. package/dist/commonjs/operations/recommendations.js +215 -0
  35. package/dist/commonjs/operations/recommendations.js.map +1 -0
  36. package/{dist-esm/src → dist/commonjs}/operations/suppressions.d.ts +3 -3
  37. package/dist/commonjs/operations/suppressions.d.ts.map +1 -0
  38. package/dist/commonjs/operations/suppressions.js +247 -0
  39. package/dist/commonjs/operations/suppressions.js.map +1 -0
  40. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/configurations.d.ts +1 -1
  41. package/dist/commonjs/operationsInterfaces/configurations.d.ts.map +1 -0
  42. package/dist/commonjs/operationsInterfaces/configurations.js +10 -0
  43. package/dist/commonjs/operationsInterfaces/configurations.js.map +1 -0
  44. package/dist/commonjs/operationsInterfaces/index.d.ts +6 -0
  45. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/index.d.ts.map +1 -1
  46. package/dist/commonjs/operationsInterfaces/index.js +16 -0
  47. package/dist/commonjs/operationsInterfaces/index.js.map +1 -0
  48. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/operations.d.ts +1 -1
  49. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/operations.d.ts.map +1 -1
  50. package/dist/commonjs/operationsInterfaces/operations.js +10 -0
  51. package/dist/commonjs/operationsInterfaces/operations.js.map +1 -0
  52. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/recommendationMetadata.d.ts +1 -1
  53. package/dist/commonjs/operationsInterfaces/recommendationMetadata.d.ts.map +1 -0
  54. package/dist/commonjs/operationsInterfaces/recommendationMetadata.js +10 -0
  55. package/dist/commonjs/operationsInterfaces/recommendationMetadata.js.map +1 -0
  56. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/recommendations.d.ts +1 -1
  57. package/dist/commonjs/operationsInterfaces/recommendations.d.ts.map +1 -0
  58. package/dist/commonjs/operationsInterfaces/recommendations.js +10 -0
  59. package/dist/commonjs/operationsInterfaces/recommendations.js.map +1 -0
  60. package/{dist-esm/src → dist/commonjs}/operationsInterfaces/suppressions.d.ts +1 -1
  61. package/dist/commonjs/operationsInterfaces/suppressions.d.ts.map +1 -0
  62. package/dist/commonjs/operationsInterfaces/suppressions.js +10 -0
  63. package/dist/commonjs/operationsInterfaces/suppressions.js.map +1 -0
  64. package/dist/commonjs/package.json +3 -0
  65. package/{dist-esm/src → dist/commonjs}/pagingHelper.d.ts.map +1 -1
  66. package/dist/commonjs/pagingHelper.js +36 -0
  67. package/dist/commonjs/pagingHelper.js.map +1 -0
  68. package/dist/esm/advisorManagementClient.d.ts +25 -0
  69. package/dist/esm/advisorManagementClient.d.ts.map +1 -0
  70. package/{dist-esm/src → dist/esm}/advisorManagementClient.js +22 -26
  71. package/dist/esm/advisorManagementClient.js.map +1 -0
  72. package/dist/esm/index.d.ts +5 -0
  73. package/dist/esm/index.d.ts.map +1 -0
  74. package/{dist-esm/src → dist/esm}/index.js +4 -4
  75. package/dist/esm/index.js.map +1 -0
  76. package/{types/arm-advisor.d.ts → dist/esm/models/index.d.ts} +466 -700
  77. package/dist/esm/models/index.d.ts.map +1 -0
  78. package/dist/esm/models/index.js.map +1 -0
  79. package/dist/esm/models/mappers.d.ts +21 -0
  80. package/dist/esm/models/mappers.d.ts.map +1 -0
  81. package/{dist-esm/src → dist/esm}/models/mappers.js +225 -225
  82. package/dist/esm/models/mappers.js.map +1 -0
  83. package/dist/esm/models/parameters.d.ts +19 -0
  84. package/dist/esm/models/parameters.d.ts.map +1 -0
  85. package/{dist-esm/src → dist/esm}/models/parameters.js +48 -48
  86. package/dist/esm/models/parameters.js.map +1 -0
  87. package/dist/esm/operations/configurations.d.ts +62 -0
  88. package/dist/esm/operations/configurations.d.ts.map +1 -0
  89. package/{dist-esm/src → dist/esm}/operations/configurations.js +29 -41
  90. package/dist/esm/operations/configurations.js.map +1 -0
  91. package/dist/esm/operations/index.d.ts +6 -0
  92. package/dist/esm/operations/index.d.ts.map +1 -0
  93. package/{dist-esm/src/operationsInterfaces → dist/esm/operations}/index.js +5 -5
  94. package/dist/esm/operations/index.js.map +1 -0
  95. package/dist/esm/operations/operations.d.ts +32 -0
  96. package/dist/esm/operations/operations.d.ts.map +1 -0
  97. package/{dist-esm/src → dist/esm}/operations/operations.js +12 -12
  98. package/dist/esm/operations/operations.js.map +1 -0
  99. package/dist/esm/operations/recommendationMetadata.d.ts +38 -0
  100. package/dist/esm/operations/recommendationMetadata.d.ts.map +1 -0
  101. package/{dist-esm/src → dist/esm}/operations/recommendationMetadata.js +17 -17
  102. package/dist/esm/operations/recommendationMetadata.js.map +1 -0
  103. package/dist/esm/operations/recommendations.d.ts +57 -0
  104. package/dist/esm/operations/recommendations.d.ts.map +1 -0
  105. package/{dist-esm/src → dist/esm}/operations/recommendations.js +27 -44
  106. package/dist/esm/operations/recommendations.js.map +1 -0
  107. package/dist/esm/operations/suppressions.d.ts +65 -0
  108. package/dist/esm/operations/suppressions.d.ts.map +1 -0
  109. package/{dist-esm/src → dist/esm}/operations/suppressions.js +30 -38
  110. package/dist/esm/operations/suppressions.js.map +1 -0
  111. package/dist/esm/operationsInterfaces/configurations.d.ts +33 -0
  112. package/dist/esm/operationsInterfaces/configurations.d.ts.map +1 -0
  113. package/dist/esm/operationsInterfaces/configurations.js.map +1 -0
  114. package/dist/esm/operationsInterfaces/index.d.ts +6 -0
  115. package/dist/esm/operationsInterfaces/index.d.ts.map +1 -0
  116. package/{dist-esm/src/operations → dist/esm/operationsInterfaces}/index.js +5 -5
  117. package/dist/esm/operationsInterfaces/index.js.map +1 -0
  118. package/dist/esm/operationsInterfaces/operations.d.ts +11 -0
  119. package/dist/esm/operationsInterfaces/operations.d.ts.map +1 -0
  120. package/dist/esm/operationsInterfaces/operations.js.map +1 -0
  121. package/dist/esm/operationsInterfaces/recommendationMetadata.d.ts +17 -0
  122. package/dist/esm/operationsInterfaces/recommendationMetadata.d.ts.map +1 -0
  123. package/dist/esm/operationsInterfaces/recommendationMetadata.js.map +1 -0
  124. package/dist/esm/operationsInterfaces/recommendations.d.ts +35 -0
  125. package/dist/esm/operationsInterfaces/recommendations.d.ts.map +1 -0
  126. package/dist/esm/operationsInterfaces/recommendations.js.map +1 -0
  127. package/dist/esm/operationsInterfaces/suppressions.d.ts +43 -0
  128. package/dist/esm/operationsInterfaces/suppressions.d.ts.map +1 -0
  129. package/dist/esm/operationsInterfaces/suppressions.js.map +1 -0
  130. package/dist/esm/package.json +3 -0
  131. package/dist/esm/pagingHelper.d.ts +13 -0
  132. package/dist/esm/pagingHelper.d.ts.map +1 -0
  133. package/dist/esm/pagingHelper.js.map +1 -0
  134. package/package.json +51 -35
  135. package/dist/index.js +0 -2102
  136. package/dist/index.js.map +0 -1
  137. package/dist/index.min.js +0 -1
  138. package/dist/index.min.js.map +0 -1
  139. package/dist-esm/samples-dev/configurationsCreateInResourceGroupSample.d.ts +0 -2
  140. package/dist-esm/samples-dev/configurationsCreateInResourceGroupSample.d.ts.map +0 -1
  141. package/dist-esm/samples-dev/configurationsCreateInResourceGroupSample.js +0 -58
  142. package/dist-esm/samples-dev/configurationsCreateInResourceGroupSample.js.map +0 -1
  143. package/dist-esm/samples-dev/configurationsCreateInSubscriptionSample.d.ts +0 -2
  144. package/dist-esm/samples-dev/configurationsCreateInSubscriptionSample.d.ts.map +0 -1
  145. package/dist-esm/samples-dev/configurationsCreateInSubscriptionSample.js +0 -57
  146. package/dist-esm/samples-dev/configurationsCreateInSubscriptionSample.js.map +0 -1
  147. package/dist-esm/samples-dev/configurationsListByResourceGroupSample.d.ts +0 -2
  148. package/dist-esm/samples-dev/configurationsListByResourceGroupSample.d.ts.map +0 -1
  149. package/dist-esm/samples-dev/configurationsListByResourceGroupSample.js +0 -53
  150. package/dist-esm/samples-dev/configurationsListByResourceGroupSample.js.map +0 -1
  151. package/dist-esm/samples-dev/configurationsListBySubscriptionSample.d.ts +0 -2
  152. package/dist-esm/samples-dev/configurationsListBySubscriptionSample.d.ts.map +0 -1
  153. package/dist-esm/samples-dev/configurationsListBySubscriptionSample.js +0 -52
  154. package/dist-esm/samples-dev/configurationsListBySubscriptionSample.js.map +0 -1
  155. package/dist-esm/samples-dev/recommendationMetadataGetSample.d.ts +0 -2
  156. package/dist-esm/samples-dev/recommendationMetadataGetSample.d.ts.map +0 -1
  157. package/dist-esm/samples-dev/recommendationMetadataGetSample.js +0 -36
  158. package/dist-esm/samples-dev/recommendationMetadataGetSample.js.map +0 -1
  159. package/dist-esm/samples-dev/recommendationMetadataListSample.d.ts +0 -2
  160. package/dist-esm/samples-dev/recommendationMetadataListSample.d.ts.map +0 -1
  161. package/dist-esm/samples-dev/recommendationMetadataListSample.js +0 -51
  162. package/dist-esm/samples-dev/recommendationMetadataListSample.js.map +0 -1
  163. package/dist-esm/samples-dev/recommendationsGenerateSample.d.ts +0 -2
  164. package/dist-esm/samples-dev/recommendationsGenerateSample.d.ts.map +0 -1
  165. package/dist-esm/samples-dev/recommendationsGenerateSample.js +0 -36
  166. package/dist-esm/samples-dev/recommendationsGenerateSample.js.map +0 -1
  167. package/dist-esm/samples-dev/recommendationsGetGenerateStatusSample.d.ts +0 -2
  168. package/dist-esm/samples-dev/recommendationsGetGenerateStatusSample.d.ts.map +0 -1
  169. package/dist-esm/samples-dev/recommendationsGetGenerateStatusSample.js +0 -37
  170. package/dist-esm/samples-dev/recommendationsGetGenerateStatusSample.js.map +0 -1
  171. package/dist-esm/samples-dev/recommendationsGetSample.d.ts +0 -2
  172. package/dist-esm/samples-dev/recommendationsGetSample.d.ts.map +0 -1
  173. package/dist-esm/samples-dev/recommendationsGetSample.js +0 -37
  174. package/dist-esm/samples-dev/recommendationsGetSample.js.map +0 -1
  175. package/dist-esm/samples-dev/recommendationsListSample.d.ts +0 -2
  176. package/dist-esm/samples-dev/recommendationsListSample.d.ts.map +0 -1
  177. package/dist-esm/samples-dev/recommendationsListSample.js +0 -54
  178. package/dist-esm/samples-dev/recommendationsListSample.js.map +0 -1
  179. package/dist-esm/samples-dev/suppressionsCreateSample.d.ts +0 -2
  180. package/dist-esm/samples-dev/suppressionsCreateSample.d.ts.map +0 -1
  181. package/dist-esm/samples-dev/suppressionsCreateSample.js +0 -39
  182. package/dist-esm/samples-dev/suppressionsCreateSample.js.map +0 -1
  183. package/dist-esm/samples-dev/suppressionsDeleteSample.d.ts +0 -2
  184. package/dist-esm/samples-dev/suppressionsDeleteSample.d.ts.map +0 -1
  185. package/dist-esm/samples-dev/suppressionsDeleteSample.js +0 -38
  186. package/dist-esm/samples-dev/suppressionsDeleteSample.js.map +0 -1
  187. package/dist-esm/samples-dev/suppressionsGetSample.d.ts +0 -2
  188. package/dist-esm/samples-dev/suppressionsGetSample.d.ts.map +0 -1
  189. package/dist-esm/samples-dev/suppressionsGetSample.js +0 -38
  190. package/dist-esm/samples-dev/suppressionsGetSample.js.map +0 -1
  191. package/dist-esm/samples-dev/suppressionsListSample.d.ts +0 -2
  192. package/dist-esm/samples-dev/suppressionsListSample.d.ts.map +0 -1
  193. package/dist-esm/samples-dev/suppressionsListSample.js +0 -52
  194. package/dist-esm/samples-dev/suppressionsListSample.js.map +0 -1
  195. package/dist-esm/src/advisorManagementClient.d.ts.map +0 -1
  196. package/dist-esm/src/advisorManagementClient.js.map +0 -1
  197. package/dist-esm/src/index.d.ts +0 -5
  198. package/dist-esm/src/index.js.map +0 -1
  199. package/dist-esm/src/models/index.js.map +0 -1
  200. package/dist-esm/src/models/mappers.js.map +0 -1
  201. package/dist-esm/src/models/parameters.js.map +0 -1
  202. package/dist-esm/src/operations/configurations.d.ts.map +0 -1
  203. package/dist-esm/src/operations/configurations.js.map +0 -1
  204. package/dist-esm/src/operations/index.d.ts +0 -6
  205. package/dist-esm/src/operations/index.js.map +0 -1
  206. package/dist-esm/src/operations/operations.d.ts.map +0 -1
  207. package/dist-esm/src/operations/operations.js.map +0 -1
  208. package/dist-esm/src/operations/recommendationMetadata.d.ts.map +0 -1
  209. package/dist-esm/src/operations/recommendationMetadata.js.map +0 -1
  210. package/dist-esm/src/operations/recommendations.d.ts.map +0 -1
  211. package/dist-esm/src/operations/recommendations.js.map +0 -1
  212. package/dist-esm/src/operations/suppressions.d.ts.map +0 -1
  213. package/dist-esm/src/operations/suppressions.js.map +0 -1
  214. package/dist-esm/src/operationsInterfaces/configurations.d.ts.map +0 -1
  215. package/dist-esm/src/operationsInterfaces/configurations.js.map +0 -1
  216. package/dist-esm/src/operationsInterfaces/index.d.ts +0 -6
  217. package/dist-esm/src/operationsInterfaces/index.js.map +0 -1
  218. package/dist-esm/src/operationsInterfaces/operations.js.map +0 -1
  219. package/dist-esm/src/operationsInterfaces/recommendationMetadata.d.ts.map +0 -1
  220. package/dist-esm/src/operationsInterfaces/recommendationMetadata.js.map +0 -1
  221. package/dist-esm/src/operationsInterfaces/recommendations.d.ts.map +0 -1
  222. package/dist-esm/src/operationsInterfaces/recommendations.js.map +0 -1
  223. package/dist-esm/src/operationsInterfaces/suppressions.d.ts.map +0 -1
  224. package/dist-esm/src/operationsInterfaces/suppressions.js.map +0 -1
  225. package/dist-esm/src/pagingHelper.js.map +0 -1
  226. package/dist-esm/test/advisor_operations_test.spec.d.ts +0 -4
  227. package/dist-esm/test/advisor_operations_test.spec.d.ts.map +0 -1
  228. package/dist-esm/test/advisor_operations_test.spec.js +0 -77
  229. package/dist-esm/test/advisor_operations_test.spec.js.map +0 -1
  230. package/src/advisorManagementClient.ts +0 -174
  231. package/src/index.ts +0 -13
  232. package/src/models/index.ts +0 -538
  233. package/src/models/mappers.ts +0 -700
  234. package/src/models/parameters.ts +0 -194
  235. package/src/operations/configurations.ts +0 -336
  236. package/src/operations/index.ts +0 -13
  237. package/src/operations/operations.ts +0 -149
  238. package/src/operations/recommendationMetadata.ts +0 -186
  239. package/src/operations/recommendations.ts +0 -271
  240. package/src/operations/suppressions.ts +0 -304
  241. package/src/operationsInterfaces/configurations.ts +0 -65
  242. package/src/operationsInterfaces/index.ts +0 -13
  243. package/src/operationsInterfaces/operations.ts +0 -22
  244. package/src/operationsInterfaces/recommendationMetadata.ts +0 -36
  245. package/src/operationsInterfaces/recommendations.ts +0 -63
  246. package/src/operationsInterfaces/suppressions.ts +0 -78
  247. package/src/pagingHelper.ts +0 -39
  248. package/tsconfig.json +0 -33
  249. /package/{dist-esm/src → dist/commonjs}/models/index.d.ts +0 -0
  250. /package/{dist-esm/src → dist/commonjs}/models/mappers.d.ts +0 -0
  251. /package/{dist-esm/src → dist/commonjs}/models/mappers.d.ts.map +0 -0
  252. /package/{dist-esm/src → dist/commonjs}/models/parameters.d.ts +0 -0
  253. /package/{dist-esm/src → dist/commonjs}/models/parameters.d.ts.map +0 -0
  254. /package/{dist-esm/src → dist/commonjs}/pagingHelper.d.ts +0 -0
  255. /package/{types → dist/commonjs}/tsdoc-metadata.json +0 -0
  256. /package/{dist-esm/src → dist/esm}/models/index.js +0 -0
  257. /package/{dist-esm/src → dist/esm}/operationsInterfaces/configurations.js +0 -0
  258. /package/{dist-esm/src → dist/esm}/operationsInterfaces/operations.js +0 -0
  259. /package/{dist-esm/src → dist/esm}/operationsInterfaces/recommendationMetadata.js +0 -0
  260. /package/{dist-esm/src → dist/esm}/operationsInterfaces/recommendations.js +0 -0
  261. /package/{dist-esm/src → dist/esm}/operationsInterfaces/suppressions.js +0 -0
  262. /package/{dist-esm/src → dist/esm}/pagingHelper.js +0 -0
package/dist/index.js DELETED
@@ -1,2102 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var tslib = require('tslib');
6
- var coreClient = require('@azure/core-client');
7
- var coreRestPipeline = require('@azure/core-rest-pipeline');
8
-
9
- function _interopNamespaceDefault(e) {
10
- var n = Object.create(null);
11
- if (e) {
12
- Object.keys(e).forEach(function (k) {
13
- if (k !== 'default') {
14
- var d = Object.getOwnPropertyDescriptor(e, k);
15
- Object.defineProperty(n, k, d.get ? d : {
16
- enumerable: true,
17
- get: function () { return e[k]; }
18
- });
19
- }
20
- });
21
- }
22
- n.default = e;
23
- return Object.freeze(n);
24
- }
25
-
26
- var coreClient__namespace = /*#__PURE__*/_interopNamespaceDefault(coreClient);
27
- var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespaceDefault(coreRestPipeline);
28
-
29
- /*
30
- * Copyright (c) Microsoft Corporation.
31
- * Licensed under the MIT License.
32
- *
33
- * Code generated by Microsoft (R) AutoRest Code Generator.
34
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
35
- */
36
- const pageMap = new WeakMap();
37
- /**
38
- * Given the last `.value` produced by the `byPage` iterator,
39
- * returns a continuation token that can be used to begin paging from
40
- * that point later.
41
- * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
42
- * @returns The continuation token that can be passed into byPage() during future calls.
43
- */
44
- function getContinuationToken(page) {
45
- var _a;
46
- if (typeof page !== "object" || page === null) {
47
- return undefined;
48
- }
49
- return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
50
- }
51
- function setContinuationToken(page, continuationToken) {
52
- var _a;
53
- if (typeof page !== "object" || page === null || !continuationToken) {
54
- return;
55
- }
56
- const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
57
- pageInfo.continuationToken = continuationToken;
58
- pageMap.set(page, pageInfo);
59
- }
60
-
61
- /*
62
- * Copyright (c) Microsoft Corporation.
63
- * Licensed under the MIT License.
64
- *
65
- * Code generated by Microsoft (R) AutoRest Code Generator.
66
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
67
- */
68
- /** Known values of {@link Scenario} that the service accepts. */
69
- exports.KnownScenario = void 0;
70
- (function (KnownScenario) {
71
- /** Alerts */
72
- KnownScenario["Alerts"] = "Alerts";
73
- })(exports.KnownScenario || (exports.KnownScenario = {}));
74
- /** Known values of {@link CpuThreshold} that the service accepts. */
75
- exports.KnownCpuThreshold = void 0;
76
- (function (KnownCpuThreshold) {
77
- /** Five */
78
- KnownCpuThreshold["Five"] = "5";
79
- /** Ten */
80
- KnownCpuThreshold["Ten"] = "10";
81
- /** Fifteen */
82
- KnownCpuThreshold["Fifteen"] = "15";
83
- /** Twenty */
84
- KnownCpuThreshold["Twenty"] = "20";
85
- })(exports.KnownCpuThreshold || (exports.KnownCpuThreshold = {}));
86
- /** Known values of {@link Category} that the service accepts. */
87
- exports.KnownCategory = void 0;
88
- (function (KnownCategory) {
89
- /** HighAvailability */
90
- KnownCategory["HighAvailability"] = "HighAvailability";
91
- /** Security */
92
- KnownCategory["Security"] = "Security";
93
- /** Performance */
94
- KnownCategory["Performance"] = "Performance";
95
- /** Cost */
96
- KnownCategory["Cost"] = "Cost";
97
- /** OperationalExcellence */
98
- KnownCategory["OperationalExcellence"] = "OperationalExcellence";
99
- })(exports.KnownCategory || (exports.KnownCategory = {}));
100
- /** Known values of {@link DigestConfigState} that the service accepts. */
101
- exports.KnownDigestConfigState = void 0;
102
- (function (KnownDigestConfigState) {
103
- /** Active */
104
- KnownDigestConfigState["Active"] = "Active";
105
- /** Disabled */
106
- KnownDigestConfigState["Disabled"] = "Disabled";
107
- })(exports.KnownDigestConfigState || (exports.KnownDigestConfigState = {}));
108
- /** Known values of {@link ConfigurationName} that the service accepts. */
109
- exports.KnownConfigurationName = void 0;
110
- (function (KnownConfigurationName) {
111
- /** Default */
112
- KnownConfigurationName["Default"] = "default";
113
- })(exports.KnownConfigurationName || (exports.KnownConfigurationName = {}));
114
- /** Known values of {@link Impact} that the service accepts. */
115
- exports.KnownImpact = void 0;
116
- (function (KnownImpact) {
117
- /** High */
118
- KnownImpact["High"] = "High";
119
- /** Medium */
120
- KnownImpact["Medium"] = "Medium";
121
- /** Low */
122
- KnownImpact["Low"] = "Low";
123
- })(exports.KnownImpact || (exports.KnownImpact = {}));
124
- /** Known values of {@link Risk} that the service accepts. */
125
- exports.KnownRisk = void 0;
126
- (function (KnownRisk) {
127
- /** Error */
128
- KnownRisk["Error"] = "Error";
129
- /** Warning */
130
- KnownRisk["Warning"] = "Warning";
131
- /** None */
132
- KnownRisk["None"] = "None";
133
- })(exports.KnownRisk || (exports.KnownRisk = {}));
134
-
135
- /*
136
- * Copyright (c) Microsoft Corporation.
137
- * Licensed under the MIT License.
138
- *
139
- * Code generated by Microsoft (R) AutoRest Code Generator.
140
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
141
- */
142
- const MetadataEntity = {
143
- type: {
144
- name: "Composite",
145
- className: "MetadataEntity",
146
- modelProperties: {
147
- id: {
148
- serializedName: "id",
149
- type: {
150
- name: "String"
151
- }
152
- },
153
- type: {
154
- serializedName: "type",
155
- type: {
156
- name: "String"
157
- }
158
- },
159
- name: {
160
- serializedName: "name",
161
- type: {
162
- name: "String"
163
- }
164
- },
165
- displayName: {
166
- serializedName: "properties.displayName",
167
- type: {
168
- name: "String"
169
- }
170
- },
171
- dependsOn: {
172
- serializedName: "properties.dependsOn",
173
- type: {
174
- name: "Sequence",
175
- element: {
176
- type: {
177
- name: "String"
178
- }
179
- }
180
- }
181
- },
182
- applicableScenarios: {
183
- serializedName: "properties.applicableScenarios",
184
- type: {
185
- name: "Sequence",
186
- element: {
187
- type: {
188
- name: "String"
189
- }
190
- }
191
- }
192
- },
193
- supportedValues: {
194
- serializedName: "properties.supportedValues",
195
- type: {
196
- name: "Sequence",
197
- element: {
198
- type: {
199
- name: "Composite",
200
- className: "MetadataSupportedValueDetail"
201
- }
202
- }
203
- }
204
- }
205
- }
206
- }
207
- };
208
- const MetadataSupportedValueDetail = {
209
- type: {
210
- name: "Composite",
211
- className: "MetadataSupportedValueDetail",
212
- modelProperties: {
213
- id: {
214
- serializedName: "id",
215
- type: {
216
- name: "String"
217
- }
218
- },
219
- displayName: {
220
- serializedName: "displayName",
221
- type: {
222
- name: "String"
223
- }
224
- }
225
- }
226
- }
227
- };
228
- const ARMErrorResponseBody = {
229
- type: {
230
- name: "Composite",
231
- className: "ARMErrorResponseBody",
232
- modelProperties: {
233
- message: {
234
- serializedName: "message",
235
- type: {
236
- name: "String"
237
- }
238
- },
239
- code: {
240
- serializedName: "code",
241
- type: {
242
- name: "String"
243
- }
244
- }
245
- }
246
- }
247
- };
248
- const ArmErrorResponse = {
249
- type: {
250
- name: "Composite",
251
- className: "ArmErrorResponse",
252
- modelProperties: {
253
- error: {
254
- serializedName: "error",
255
- type: {
256
- name: "Composite",
257
- className: "ARMErrorResponseBody"
258
- }
259
- }
260
- }
261
- }
262
- };
263
- const MetadataEntityListResult = {
264
- type: {
265
- name: "Composite",
266
- className: "MetadataEntityListResult",
267
- modelProperties: {
268
- value: {
269
- serializedName: "value",
270
- type: {
271
- name: "Sequence",
272
- element: {
273
- type: {
274
- name: "Composite",
275
- className: "MetadataEntity"
276
- }
277
- }
278
- }
279
- },
280
- nextLink: {
281
- serializedName: "nextLink",
282
- type: {
283
- name: "String"
284
- }
285
- }
286
- }
287
- }
288
- };
289
- const ConfigurationListResult = {
290
- type: {
291
- name: "Composite",
292
- className: "ConfigurationListResult",
293
- modelProperties: {
294
- value: {
295
- serializedName: "value",
296
- type: {
297
- name: "Sequence",
298
- element: {
299
- type: {
300
- name: "Composite",
301
- className: "ConfigData"
302
- }
303
- }
304
- }
305
- },
306
- nextLink: {
307
- serializedName: "nextLink",
308
- type: {
309
- name: "String"
310
- }
311
- }
312
- }
313
- }
314
- };
315
- const DigestConfig = {
316
- type: {
317
- name: "Composite",
318
- className: "DigestConfig",
319
- modelProperties: {
320
- name: {
321
- serializedName: "name",
322
- type: {
323
- name: "String"
324
- }
325
- },
326
- actionGroupResourceId: {
327
- serializedName: "actionGroupResourceId",
328
- type: {
329
- name: "String"
330
- }
331
- },
332
- frequency: {
333
- serializedName: "frequency",
334
- type: {
335
- name: "Number"
336
- }
337
- },
338
- categories: {
339
- serializedName: "categories",
340
- type: {
341
- name: "Sequence",
342
- element: {
343
- type: {
344
- name: "String"
345
- }
346
- }
347
- }
348
- },
349
- language: {
350
- serializedName: "language",
351
- type: {
352
- name: "String"
353
- }
354
- },
355
- state: {
356
- serializedName: "state",
357
- type: {
358
- name: "String"
359
- }
360
- }
361
- }
362
- }
363
- };
364
- const Resource = {
365
- type: {
366
- name: "Composite",
367
- className: "Resource",
368
- modelProperties: {
369
- id: {
370
- serializedName: "id",
371
- readOnly: true,
372
- type: {
373
- name: "String"
374
- }
375
- },
376
- name: {
377
- serializedName: "name",
378
- readOnly: true,
379
- type: {
380
- name: "String"
381
- }
382
- },
383
- type: {
384
- serializedName: "type",
385
- readOnly: true,
386
- type: {
387
- name: "String"
388
- }
389
- }
390
- }
391
- }
392
- };
393
- const ResourceRecommendationBaseListResult = {
394
- type: {
395
- name: "Composite",
396
- className: "ResourceRecommendationBaseListResult",
397
- modelProperties: {
398
- nextLink: {
399
- serializedName: "nextLink",
400
- type: {
401
- name: "String"
402
- }
403
- },
404
- value: {
405
- serializedName: "value",
406
- type: {
407
- name: "Sequence",
408
- element: {
409
- type: {
410
- name: "Composite",
411
- className: "ResourceRecommendationBase"
412
- }
413
- }
414
- }
415
- }
416
- }
417
- }
418
- };
419
- const ShortDescription = {
420
- type: {
421
- name: "Composite",
422
- className: "ShortDescription",
423
- modelProperties: {
424
- problem: {
425
- serializedName: "problem",
426
- type: {
427
- name: "String"
428
- }
429
- },
430
- solution: {
431
- serializedName: "solution",
432
- type: {
433
- name: "String"
434
- }
435
- }
436
- }
437
- }
438
- };
439
- const ResourceMetadata = {
440
- type: {
441
- name: "Composite",
442
- className: "ResourceMetadata",
443
- modelProperties: {
444
- resourceId: {
445
- serializedName: "resourceId",
446
- type: {
447
- name: "String"
448
- }
449
- },
450
- source: {
451
- serializedName: "source",
452
- type: {
453
- name: "String"
454
- }
455
- },
456
- action: {
457
- serializedName: "action",
458
- type: {
459
- name: "Dictionary",
460
- value: {
461
- type: { name: "Dictionary", value: { type: { name: "any" } } }
462
- }
463
- }
464
- },
465
- singular: {
466
- serializedName: "singular",
467
- type: {
468
- name: "String"
469
- }
470
- },
471
- plural: {
472
- serializedName: "plural",
473
- type: {
474
- name: "String"
475
- }
476
- }
477
- }
478
- }
479
- };
480
- const OperationEntityListResult = {
481
- type: {
482
- name: "Composite",
483
- className: "OperationEntityListResult",
484
- modelProperties: {
485
- nextLink: {
486
- serializedName: "nextLink",
487
- type: {
488
- name: "String"
489
- }
490
- },
491
- value: {
492
- serializedName: "value",
493
- type: {
494
- name: "Sequence",
495
- element: {
496
- type: {
497
- name: "Composite",
498
- className: "OperationEntity"
499
- }
500
- }
501
- }
502
- }
503
- }
504
- }
505
- };
506
- const OperationEntity = {
507
- type: {
508
- name: "Composite",
509
- className: "OperationEntity",
510
- modelProperties: {
511
- name: {
512
- serializedName: "name",
513
- type: {
514
- name: "String"
515
- }
516
- },
517
- display: {
518
- serializedName: "display",
519
- type: {
520
- name: "Composite",
521
- className: "OperationDisplayInfo"
522
- }
523
- }
524
- }
525
- }
526
- };
527
- const OperationDisplayInfo = {
528
- type: {
529
- name: "Composite",
530
- className: "OperationDisplayInfo",
531
- modelProperties: {
532
- description: {
533
- serializedName: "description",
534
- type: {
535
- name: "String"
536
- }
537
- },
538
- operation: {
539
- serializedName: "operation",
540
- type: {
541
- name: "String"
542
- }
543
- },
544
- provider: {
545
- serializedName: "provider",
546
- type: {
547
- name: "String"
548
- }
549
- },
550
- resource: {
551
- serializedName: "resource",
552
- type: {
553
- name: "String"
554
- }
555
- }
556
- }
557
- }
558
- };
559
- const SuppressionContractListResult = {
560
- type: {
561
- name: "Composite",
562
- className: "SuppressionContractListResult",
563
- modelProperties: {
564
- nextLink: {
565
- serializedName: "nextLink",
566
- type: {
567
- name: "String"
568
- }
569
- },
570
- value: {
571
- serializedName: "value",
572
- type: {
573
- name: "Sequence",
574
- element: {
575
- type: {
576
- name: "Composite",
577
- className: "SuppressionContract"
578
- }
579
- }
580
- }
581
- }
582
- }
583
- }
584
- };
585
- const ConfigData = {
586
- type: {
587
- name: "Composite",
588
- className: "ConfigData",
589
- modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { exclude: {
590
- serializedName: "properties.exclude",
591
- type: {
592
- name: "Boolean"
593
- }
594
- }, lowCpuThreshold: {
595
- serializedName: "properties.lowCpuThreshold",
596
- type: {
597
- name: "String"
598
- }
599
- }, digests: {
600
- serializedName: "properties.digests",
601
- type: {
602
- name: "Sequence",
603
- element: {
604
- type: {
605
- name: "Composite",
606
- className: "DigestConfig"
607
- }
608
- }
609
- }
610
- } })
611
- }
612
- };
613
- const ResourceRecommendationBase = {
614
- type: {
615
- name: "Composite",
616
- className: "ResourceRecommendationBase",
617
- modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { category: {
618
- serializedName: "properties.category",
619
- type: {
620
- name: "String"
621
- }
622
- }, impact: {
623
- serializedName: "properties.impact",
624
- type: {
625
- name: "String"
626
- }
627
- }, impactedField: {
628
- serializedName: "properties.impactedField",
629
- type: {
630
- name: "String"
631
- }
632
- }, impactedValue: {
633
- serializedName: "properties.impactedValue",
634
- type: {
635
- name: "String"
636
- }
637
- }, lastUpdated: {
638
- serializedName: "properties.lastUpdated",
639
- type: {
640
- name: "DateTime"
641
- }
642
- }, metadata: {
643
- serializedName: "properties.metadata",
644
- type: {
645
- name: "Dictionary",
646
- value: {
647
- type: { name: "Dictionary", value: { type: { name: "any" } } }
648
- }
649
- }
650
- }, recommendationTypeId: {
651
- serializedName: "properties.recommendationTypeId",
652
- type: {
653
- name: "String"
654
- }
655
- }, risk: {
656
- serializedName: "properties.risk",
657
- type: {
658
- name: "String"
659
- }
660
- }, shortDescription: {
661
- serializedName: "properties.shortDescription",
662
- type: {
663
- name: "Composite",
664
- className: "ShortDescription"
665
- }
666
- }, suppressionIds: {
667
- serializedName: "properties.suppressionIds",
668
- type: {
669
- name: "Sequence",
670
- element: {
671
- type: {
672
- name: "Uuid"
673
- }
674
- }
675
- }
676
- }, extendedProperties: {
677
- serializedName: "properties.extendedProperties",
678
- type: {
679
- name: "Dictionary",
680
- value: { type: { name: "String" } }
681
- }
682
- }, resourceMetadata: {
683
- serializedName: "properties.resourceMetadata",
684
- type: {
685
- name: "Composite",
686
- className: "ResourceMetadata"
687
- }
688
- }, description: {
689
- serializedName: "properties.description",
690
- type: {
691
- name: "String"
692
- }
693
- }, label: {
694
- serializedName: "properties.label",
695
- type: {
696
- name: "String"
697
- }
698
- }, learnMoreLink: {
699
- serializedName: "properties.learnMoreLink",
700
- type: {
701
- name: "String"
702
- }
703
- }, potentialBenefits: {
704
- serializedName: "properties.potentialBenefits",
705
- type: {
706
- name: "String"
707
- }
708
- }, actions: {
709
- serializedName: "properties.actions",
710
- type: {
711
- name: "Sequence",
712
- element: {
713
- type: {
714
- name: "Dictionary",
715
- value: {
716
- type: { name: "Dictionary", value: { type: { name: "any" } } }
717
- }
718
- }
719
- }
720
- }
721
- }, remediation: {
722
- serializedName: "properties.remediation",
723
- type: {
724
- name: "Dictionary",
725
- value: {
726
- type: { name: "Dictionary", value: { type: { name: "any" } } }
727
- }
728
- }
729
- }, exposedMetadataProperties: {
730
- serializedName: "properties.exposedMetadataProperties",
731
- type: {
732
- name: "Dictionary",
733
- value: {
734
- type: { name: "Dictionary", value: { type: { name: "any" } } }
735
- }
736
- }
737
- } })
738
- }
739
- };
740
- const SuppressionContract = {
741
- type: {
742
- name: "Composite",
743
- className: "SuppressionContract",
744
- modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { suppressionId: {
745
- serializedName: "properties.suppressionId",
746
- type: {
747
- name: "String"
748
- }
749
- }, ttl: {
750
- serializedName: "properties.ttl",
751
- type: {
752
- name: "String"
753
- }
754
- }, expirationTimeStamp: {
755
- serializedName: "properties.expirationTimeStamp",
756
- readOnly: true,
757
- type: {
758
- name: "DateTime"
759
- }
760
- } })
761
- }
762
- };
763
- const RecommendationsGenerateHeaders = {
764
- type: {
765
- name: "Composite",
766
- className: "RecommendationsGenerateHeaders",
767
- modelProperties: {
768
- location: {
769
- serializedName: "location",
770
- type: {
771
- name: "String"
772
- }
773
- },
774
- retryAfter: {
775
- serializedName: "retry-after",
776
- type: {
777
- name: "String"
778
- }
779
- }
780
- }
781
- }
782
- };
783
-
784
- var Mappers = /*#__PURE__*/Object.freeze({
785
- __proto__: null,
786
- ARMErrorResponseBody: ARMErrorResponseBody,
787
- ArmErrorResponse: ArmErrorResponse,
788
- ConfigData: ConfigData,
789
- ConfigurationListResult: ConfigurationListResult,
790
- DigestConfig: DigestConfig,
791
- MetadataEntity: MetadataEntity,
792
- MetadataEntityListResult: MetadataEntityListResult,
793
- MetadataSupportedValueDetail: MetadataSupportedValueDetail,
794
- OperationDisplayInfo: OperationDisplayInfo,
795
- OperationEntity: OperationEntity,
796
- OperationEntityListResult: OperationEntityListResult,
797
- RecommendationsGenerateHeaders: RecommendationsGenerateHeaders,
798
- Resource: Resource,
799
- ResourceMetadata: ResourceMetadata,
800
- ResourceRecommendationBase: ResourceRecommendationBase,
801
- ResourceRecommendationBaseListResult: ResourceRecommendationBaseListResult,
802
- ShortDescription: ShortDescription,
803
- SuppressionContract: SuppressionContract,
804
- SuppressionContractListResult: SuppressionContractListResult
805
- });
806
-
807
- /*
808
- * Copyright (c) Microsoft Corporation.
809
- * Licensed under the MIT License.
810
- *
811
- * Code generated by Microsoft (R) AutoRest Code Generator.
812
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
813
- */
814
- const accept = {
815
- parameterPath: "accept",
816
- mapper: {
817
- defaultValue: "application/json",
818
- isConstant: true,
819
- serializedName: "Accept",
820
- type: {
821
- name: "String"
822
- }
823
- }
824
- };
825
- const $host = {
826
- parameterPath: "$host",
827
- mapper: {
828
- serializedName: "$host",
829
- required: true,
830
- type: {
831
- name: "String"
832
- }
833
- },
834
- skipEncoding: true
835
- };
836
- const name = {
837
- parameterPath: "name",
838
- mapper: {
839
- serializedName: "name",
840
- required: true,
841
- type: {
842
- name: "String"
843
- }
844
- }
845
- };
846
- const apiVersion = {
847
- parameterPath: "apiVersion",
848
- mapper: {
849
- defaultValue: "2020-01-01",
850
- isConstant: true,
851
- serializedName: "api-version",
852
- type: {
853
- name: "String"
854
- }
855
- }
856
- };
857
- const nextLink = {
858
- parameterPath: "nextLink",
859
- mapper: {
860
- serializedName: "nextLink",
861
- required: true,
862
- type: {
863
- name: "String"
864
- }
865
- },
866
- skipEncoding: true
867
- };
868
- const subscriptionId = {
869
- parameterPath: "subscriptionId",
870
- mapper: {
871
- serializedName: "subscriptionId",
872
- required: true,
873
- type: {
874
- name: "String"
875
- }
876
- }
877
- };
878
- const contentType = {
879
- parameterPath: ["options", "contentType"],
880
- mapper: {
881
- defaultValue: "application/json",
882
- isConstant: true,
883
- serializedName: "Content-Type",
884
- type: {
885
- name: "String"
886
- }
887
- }
888
- };
889
- const configContract = {
890
- parameterPath: "configContract",
891
- mapper: ConfigData
892
- };
893
- const configurationName = {
894
- parameterPath: "configurationName",
895
- mapper: {
896
- serializedName: "configurationName",
897
- required: true,
898
- type: {
899
- name: "String"
900
- }
901
- }
902
- };
903
- const resourceGroup = {
904
- parameterPath: "resourceGroup",
905
- mapper: {
906
- serializedName: "resourceGroup",
907
- required: true,
908
- type: {
909
- name: "String"
910
- }
911
- }
912
- };
913
- const operationId = {
914
- parameterPath: "operationId",
915
- mapper: {
916
- serializedName: "operationId",
917
- required: true,
918
- type: {
919
- name: "Uuid"
920
- }
921
- }
922
- };
923
- const filter = {
924
- parameterPath: ["options", "filter"],
925
- mapper: {
926
- serializedName: "$filter",
927
- type: {
928
- name: "String"
929
- }
930
- }
931
- };
932
- const top = {
933
- parameterPath: ["options", "top"],
934
- mapper: {
935
- serializedName: "$top",
936
- type: {
937
- name: "Number"
938
- }
939
- }
940
- };
941
- const skipToken = {
942
- parameterPath: ["options", "skipToken"],
943
- mapper: {
944
- serializedName: "$skipToken",
945
- type: {
946
- name: "String"
947
- }
948
- }
949
- };
950
- const resourceUri = {
951
- parameterPath: "resourceUri",
952
- mapper: {
953
- serializedName: "resourceUri",
954
- required: true,
955
- type: {
956
- name: "String"
957
- }
958
- }
959
- };
960
- const recommendationId = {
961
- parameterPath: "recommendationId",
962
- mapper: {
963
- serializedName: "recommendationId",
964
- required: true,
965
- type: {
966
- name: "String"
967
- }
968
- }
969
- };
970
- const suppressionContract = {
971
- parameterPath: "suppressionContract",
972
- mapper: SuppressionContract
973
- };
974
-
975
- /*
976
- * Copyright (c) Microsoft Corporation.
977
- * Licensed under the MIT License.
978
- *
979
- * Code generated by Microsoft (R) AutoRest Code Generator.
980
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
981
- */
982
- /// <reference lib="esnext.asynciterable" />
983
- /** Class containing RecommendationMetadata operations. */
984
- class RecommendationMetadataImpl {
985
- /**
986
- * Initialize a new instance of the class RecommendationMetadata class.
987
- * @param client Reference to the service client
988
- */
989
- constructor(client) {
990
- this.client = client;
991
- }
992
- /**
993
- * Gets the list of metadata entities.
994
- * @param options The options parameters.
995
- */
996
- list(options) {
997
- const iter = this.listPagingAll(options);
998
- return {
999
- next() {
1000
- return iter.next();
1001
- },
1002
- [Symbol.asyncIterator]() {
1003
- return this;
1004
- },
1005
- byPage: (settings) => {
1006
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1007
- throw new Error("maxPageSize is not supported by this operation.");
1008
- }
1009
- return this.listPagingPage(options, settings);
1010
- }
1011
- };
1012
- }
1013
- listPagingPage(options, settings) {
1014
- return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1015
- let result;
1016
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1017
- if (!continuationToken) {
1018
- result = yield tslib.__await(this._list(options));
1019
- let page = result.value || [];
1020
- continuationToken = result.nextLink;
1021
- setContinuationToken(page, continuationToken);
1022
- yield yield tslib.__await(page);
1023
- }
1024
- while (continuationToken) {
1025
- result = yield tslib.__await(this._listNext(continuationToken, options));
1026
- continuationToken = result.nextLink;
1027
- let page = result.value || [];
1028
- setContinuationToken(page, continuationToken);
1029
- yield yield tslib.__await(page);
1030
- }
1031
- });
1032
- }
1033
- listPagingAll(options) {
1034
- return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1035
- var _a, e_1, _b, _c;
1036
- try {
1037
- for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1038
- _c = _f.value;
1039
- _d = false;
1040
- const page = _c;
1041
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1042
- }
1043
- }
1044
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1045
- finally {
1046
- try {
1047
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1048
- }
1049
- finally { if (e_1) throw e_1.error; }
1050
- }
1051
- });
1052
- }
1053
- /**
1054
- * Gets the metadata entity.
1055
- * @param name Name of metadata entity.
1056
- * @param options The options parameters.
1057
- */
1058
- get(name, options) {
1059
- return this.client.sendOperationRequest({ name, options }, getOperationSpec$2);
1060
- }
1061
- /**
1062
- * Gets the list of metadata entities.
1063
- * @param options The options parameters.
1064
- */
1065
- _list(options) {
1066
- return this.client.sendOperationRequest({ options }, listOperationSpec$3);
1067
- }
1068
- /**
1069
- * ListNext
1070
- * @param nextLink The nextLink from the previous successful call to the List method.
1071
- * @param options The options parameters.
1072
- */
1073
- _listNext(nextLink, options) {
1074
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$3);
1075
- }
1076
- }
1077
- // Operation Specifications
1078
- const serializer$4 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1079
- const getOperationSpec$2 = {
1080
- path: "/providers/Microsoft.Advisor/metadata/{name}",
1081
- httpMethod: "GET",
1082
- responses: {
1083
- 200: {
1084
- bodyMapper: MetadataEntity
1085
- },
1086
- 404: {
1087
- bodyMapper: ARMErrorResponseBody,
1088
- isError: true
1089
- },
1090
- default: {
1091
- bodyMapper: ArmErrorResponse
1092
- }
1093
- },
1094
- queryParameters: [apiVersion],
1095
- urlParameters: [$host, name],
1096
- headerParameters: [accept],
1097
- serializer: serializer$4
1098
- };
1099
- const listOperationSpec$3 = {
1100
- path: "/providers/Microsoft.Advisor/metadata",
1101
- httpMethod: "GET",
1102
- responses: {
1103
- 200: {
1104
- bodyMapper: MetadataEntityListResult
1105
- },
1106
- default: {
1107
- bodyMapper: ArmErrorResponse
1108
- }
1109
- },
1110
- queryParameters: [apiVersion],
1111
- urlParameters: [$host],
1112
- headerParameters: [accept],
1113
- serializer: serializer$4
1114
- };
1115
- const listNextOperationSpec$3 = {
1116
- path: "{nextLink}",
1117
- httpMethod: "GET",
1118
- responses: {
1119
- 200: {
1120
- bodyMapper: MetadataEntityListResult
1121
- },
1122
- default: {
1123
- bodyMapper: ArmErrorResponse
1124
- }
1125
- },
1126
- urlParameters: [$host, nextLink],
1127
- headerParameters: [accept],
1128
- serializer: serializer$4
1129
- };
1130
-
1131
- /*
1132
- * Copyright (c) Microsoft Corporation.
1133
- * Licensed under the MIT License.
1134
- *
1135
- * Code generated by Microsoft (R) AutoRest Code Generator.
1136
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1137
- */
1138
- /// <reference lib="esnext.asynciterable" />
1139
- /** Class containing Configurations operations. */
1140
- class ConfigurationsImpl {
1141
- /**
1142
- * Initialize a new instance of the class Configurations class.
1143
- * @param client Reference to the service client
1144
- */
1145
- constructor(client) {
1146
- this.client = client;
1147
- }
1148
- /**
1149
- * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
1150
- * @param options The options parameters.
1151
- */
1152
- listBySubscription(options) {
1153
- const iter = this.listBySubscriptionPagingAll(options);
1154
- return {
1155
- next() {
1156
- return iter.next();
1157
- },
1158
- [Symbol.asyncIterator]() {
1159
- return this;
1160
- },
1161
- byPage: (settings) => {
1162
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1163
- throw new Error("maxPageSize is not supported by this operation.");
1164
- }
1165
- return this.listBySubscriptionPagingPage(options, settings);
1166
- }
1167
- };
1168
- }
1169
- listBySubscriptionPagingPage(options, settings) {
1170
- return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1171
- let result;
1172
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1173
- if (!continuationToken) {
1174
- result = yield tslib.__await(this._listBySubscription(options));
1175
- let page = result.value || [];
1176
- continuationToken = result.nextLink;
1177
- setContinuationToken(page, continuationToken);
1178
- yield yield tslib.__await(page);
1179
- }
1180
- while (continuationToken) {
1181
- result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1182
- continuationToken = result.nextLink;
1183
- let page = result.value || [];
1184
- setContinuationToken(page, continuationToken);
1185
- yield yield tslib.__await(page);
1186
- }
1187
- });
1188
- }
1189
- listBySubscriptionPagingAll(options) {
1190
- return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
1191
- var _a, e_1, _b, _c;
1192
- try {
1193
- for (var _d = true, _e = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1194
- _c = _f.value;
1195
- _d = false;
1196
- const page = _c;
1197
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1198
- }
1199
- }
1200
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1201
- finally {
1202
- try {
1203
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1204
- }
1205
- finally { if (e_1) throw e_1.error; }
1206
- }
1207
- });
1208
- }
1209
- /**
1210
- * Retrieve Azure Advisor configurations.
1211
- * @param resourceGroup The name of the Azure resource group.
1212
- * @param options The options parameters.
1213
- */
1214
- listByResourceGroup(resourceGroup, options) {
1215
- const iter = this.listByResourceGroupPagingAll(resourceGroup, options);
1216
- return {
1217
- next() {
1218
- return iter.next();
1219
- },
1220
- [Symbol.asyncIterator]() {
1221
- return this;
1222
- },
1223
- byPage: (settings) => {
1224
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1225
- throw new Error("maxPageSize is not supported by this operation.");
1226
- }
1227
- return this.listByResourceGroupPagingPage(resourceGroup, options, settings);
1228
- }
1229
- };
1230
- }
1231
- listByResourceGroupPagingPage(resourceGroup, options, _settings) {
1232
- return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1233
- let result;
1234
- result = yield tslib.__await(this._listByResourceGroup(resourceGroup, options));
1235
- yield yield tslib.__await(result.value || []);
1236
- });
1237
- }
1238
- listByResourceGroupPagingAll(resourceGroup, options) {
1239
- return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
1240
- var _a, e_2, _b, _c;
1241
- try {
1242
- for (var _d = true, _e = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroup, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1243
- _c = _f.value;
1244
- _d = false;
1245
- const page = _c;
1246
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1247
- }
1248
- }
1249
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1250
- finally {
1251
- try {
1252
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1253
- }
1254
- finally { if (e_2) throw e_2.error; }
1255
- }
1256
- });
1257
- }
1258
- /**
1259
- * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
1260
- * @param options The options parameters.
1261
- */
1262
- _listBySubscription(options) {
1263
- return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
1264
- }
1265
- /**
1266
- * Create/Overwrite Azure Advisor configuration and also delete all configurations of contained
1267
- * resource groups.
1268
- * @param configurationName Advisor configuration name. Value must be 'default'
1269
- * @param configContract The Azure Advisor configuration data structure.
1270
- * @param options The options parameters.
1271
- */
1272
- createInSubscription(configurationName, configContract, options) {
1273
- return this.client.sendOperationRequest({ configurationName, configContract, options }, createInSubscriptionOperationSpec);
1274
- }
1275
- /**
1276
- * Retrieve Azure Advisor configurations.
1277
- * @param resourceGroup The name of the Azure resource group.
1278
- * @param options The options parameters.
1279
- */
1280
- _listByResourceGroup(resourceGroup, options) {
1281
- return this.client.sendOperationRequest({ resourceGroup, options }, listByResourceGroupOperationSpec);
1282
- }
1283
- /**
1284
- * Create/Overwrite Azure Advisor configuration.
1285
- * @param configurationName Advisor configuration name. Value must be 'default'
1286
- * @param resourceGroup The name of the Azure resource group.
1287
- * @param configContract The Azure Advisor configuration data structure.
1288
- * @param options The options parameters.
1289
- */
1290
- createInResourceGroup(configurationName, resourceGroup, configContract, options) {
1291
- return this.client.sendOperationRequest({ configurationName, resourceGroup, configContract, options }, createInResourceGroupOperationSpec);
1292
- }
1293
- /**
1294
- * ListBySubscriptionNext
1295
- * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
1296
- * @param options The options parameters.
1297
- */
1298
- _listBySubscriptionNext(nextLink, options) {
1299
- return this.client.sendOperationRequest({ nextLink, options }, listBySubscriptionNextOperationSpec);
1300
- }
1301
- }
1302
- // Operation Specifications
1303
- const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1304
- const listBySubscriptionOperationSpec = {
1305
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations",
1306
- httpMethod: "GET",
1307
- responses: {
1308
- 200: {
1309
- bodyMapper: ConfigurationListResult
1310
- },
1311
- default: {
1312
- bodyMapper: ArmErrorResponse
1313
- }
1314
- },
1315
- queryParameters: [apiVersion],
1316
- urlParameters: [$host, subscriptionId],
1317
- headerParameters: [accept],
1318
- serializer: serializer$3
1319
- };
1320
- const createInSubscriptionOperationSpec = {
1321
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}",
1322
- httpMethod: "PUT",
1323
- responses: {
1324
- 200: {
1325
- bodyMapper: ConfigData
1326
- },
1327
- default: {
1328
- bodyMapper: ArmErrorResponse
1329
- }
1330
- },
1331
- requestBody: configContract,
1332
- queryParameters: [apiVersion],
1333
- urlParameters: [
1334
- $host,
1335
- subscriptionId,
1336
- configurationName
1337
- ],
1338
- headerParameters: [accept, contentType],
1339
- mediaType: "json",
1340
- serializer: serializer$3
1341
- };
1342
- const listByResourceGroupOperationSpec = {
1343
- path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations",
1344
- httpMethod: "GET",
1345
- responses: {
1346
- 200: {
1347
- bodyMapper: ConfigurationListResult
1348
- },
1349
- default: {
1350
- bodyMapper: ArmErrorResponse
1351
- }
1352
- },
1353
- queryParameters: [apiVersion],
1354
- urlParameters: [
1355
- $host,
1356
- subscriptionId,
1357
- resourceGroup
1358
- ],
1359
- headerParameters: [accept],
1360
- serializer: serializer$3
1361
- };
1362
- const createInResourceGroupOperationSpec = {
1363
- path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations/{configurationName}",
1364
- httpMethod: "PUT",
1365
- responses: {
1366
- 200: {
1367
- bodyMapper: ConfigData
1368
- },
1369
- default: {
1370
- bodyMapper: ArmErrorResponse
1371
- }
1372
- },
1373
- requestBody: configContract,
1374
- queryParameters: [apiVersion],
1375
- urlParameters: [
1376
- $host,
1377
- subscriptionId,
1378
- configurationName,
1379
- resourceGroup
1380
- ],
1381
- headerParameters: [accept, contentType],
1382
- mediaType: "json",
1383
- serializer: serializer$3
1384
- };
1385
- const listBySubscriptionNextOperationSpec = {
1386
- path: "{nextLink}",
1387
- httpMethod: "GET",
1388
- responses: {
1389
- 200: {
1390
- bodyMapper: ConfigurationListResult
1391
- },
1392
- default: {
1393
- bodyMapper: ArmErrorResponse
1394
- }
1395
- },
1396
- urlParameters: [
1397
- $host,
1398
- nextLink,
1399
- subscriptionId
1400
- ],
1401
- headerParameters: [accept],
1402
- serializer: serializer$3
1403
- };
1404
-
1405
- /*
1406
- * Copyright (c) Microsoft Corporation.
1407
- * Licensed under the MIT License.
1408
- *
1409
- * Code generated by Microsoft (R) AutoRest Code Generator.
1410
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1411
- */
1412
- /// <reference lib="esnext.asynciterable" />
1413
- /** Class containing Recommendations operations. */
1414
- class RecommendationsImpl {
1415
- /**
1416
- * Initialize a new instance of the class Recommendations class.
1417
- * @param client Reference to the service client
1418
- */
1419
- constructor(client) {
1420
- this.client = client;
1421
- }
1422
- /**
1423
- * Obtains cached recommendations for a subscription. The recommendations are generated or computed by
1424
- * invoking generateRecommendations.
1425
- * @param options The options parameters.
1426
- */
1427
- list(options) {
1428
- const iter = this.listPagingAll(options);
1429
- return {
1430
- next() {
1431
- return iter.next();
1432
- },
1433
- [Symbol.asyncIterator]() {
1434
- return this;
1435
- },
1436
- byPage: (settings) => {
1437
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1438
- throw new Error("maxPageSize is not supported by this operation.");
1439
- }
1440
- return this.listPagingPage(options, settings);
1441
- }
1442
- };
1443
- }
1444
- listPagingPage(options, settings) {
1445
- return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1446
- let result;
1447
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1448
- if (!continuationToken) {
1449
- result = yield tslib.__await(this._list(options));
1450
- let page = result.value || [];
1451
- continuationToken = result.nextLink;
1452
- setContinuationToken(page, continuationToken);
1453
- yield yield tslib.__await(page);
1454
- }
1455
- while (continuationToken) {
1456
- result = yield tslib.__await(this._listNext(continuationToken, options));
1457
- continuationToken = result.nextLink;
1458
- let page = result.value || [];
1459
- setContinuationToken(page, continuationToken);
1460
- yield yield tslib.__await(page);
1461
- }
1462
- });
1463
- }
1464
- listPagingAll(options) {
1465
- return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1466
- var _a, e_1, _b, _c;
1467
- try {
1468
- for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1469
- _c = _f.value;
1470
- _d = false;
1471
- const page = _c;
1472
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1473
- }
1474
- }
1475
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1476
- finally {
1477
- try {
1478
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1479
- }
1480
- finally { if (e_1) throw e_1.error; }
1481
- }
1482
- });
1483
- }
1484
- /**
1485
- * Initiates the recommendation generation or computation process for a subscription. This operation is
1486
- * asynchronous. The generated recommendations are stored in a cache in the Advisor service.
1487
- * @param options The options parameters.
1488
- */
1489
- generate(options) {
1490
- return this.client.sendOperationRequest({ options }, generateOperationSpec);
1491
- }
1492
- /**
1493
- * Retrieves the status of the recommendation computation or generation process. Invoke this API after
1494
- * calling the generation recommendation. The URI of this API is returned in the Location field of the
1495
- * response header.
1496
- * @param operationId The operation ID, which can be found from the Location field in the generate
1497
- * recommendation response header.
1498
- * @param options The options parameters.
1499
- */
1500
- getGenerateStatus(operationId, options) {
1501
- return this.client.sendOperationRequest({ operationId, options }, getGenerateStatusOperationSpec);
1502
- }
1503
- /**
1504
- * Obtains cached recommendations for a subscription. The recommendations are generated or computed by
1505
- * invoking generateRecommendations.
1506
- * @param options The options parameters.
1507
- */
1508
- _list(options) {
1509
- return this.client.sendOperationRequest({ options }, listOperationSpec$2);
1510
- }
1511
- /**
1512
- * Obtains details of a cached recommendation.
1513
- * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which
1514
- * the recommendation applies.
1515
- * @param recommendationId The recommendation ID.
1516
- * @param options The options parameters.
1517
- */
1518
- get(resourceUri, recommendationId, options) {
1519
- return this.client.sendOperationRequest({ resourceUri, recommendationId, options }, getOperationSpec$1);
1520
- }
1521
- /**
1522
- * ListNext
1523
- * @param nextLink The nextLink from the previous successful call to the List method.
1524
- * @param options The options parameters.
1525
- */
1526
- _listNext(nextLink, options) {
1527
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
1528
- }
1529
- }
1530
- // Operation Specifications
1531
- const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1532
- const generateOperationSpec = {
1533
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations",
1534
- httpMethod: "POST",
1535
- responses: {
1536
- 202: {
1537
- headersMapper: RecommendationsGenerateHeaders
1538
- },
1539
- default: {
1540
- bodyMapper: ArmErrorResponse
1541
- }
1542
- },
1543
- queryParameters: [apiVersion],
1544
- urlParameters: [$host, subscriptionId],
1545
- headerParameters: [accept],
1546
- serializer: serializer$2
1547
- };
1548
- const getGenerateStatusOperationSpec = {
1549
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}",
1550
- httpMethod: "GET",
1551
- responses: {
1552
- 202: {},
1553
- 204: {},
1554
- default: {
1555
- bodyMapper: ArmErrorResponse
1556
- }
1557
- },
1558
- queryParameters: [apiVersion],
1559
- urlParameters: [
1560
- $host,
1561
- subscriptionId,
1562
- operationId
1563
- ],
1564
- headerParameters: [accept],
1565
- serializer: serializer$2
1566
- };
1567
- const listOperationSpec$2 = {
1568
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations",
1569
- httpMethod: "GET",
1570
- responses: {
1571
- 200: {
1572
- bodyMapper: ResourceRecommendationBaseListResult
1573
- },
1574
- default: {
1575
- bodyMapper: ArmErrorResponse
1576
- }
1577
- },
1578
- queryParameters: [
1579
- apiVersion,
1580
- filter,
1581
- top,
1582
- skipToken
1583
- ],
1584
- urlParameters: [$host, subscriptionId],
1585
- headerParameters: [accept],
1586
- serializer: serializer$2
1587
- };
1588
- const getOperationSpec$1 = {
1589
- path: "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}",
1590
- httpMethod: "GET",
1591
- responses: {
1592
- 200: {
1593
- bodyMapper: ResourceRecommendationBase
1594
- },
1595
- default: {
1596
- bodyMapper: ArmErrorResponse
1597
- }
1598
- },
1599
- queryParameters: [apiVersion],
1600
- urlParameters: [
1601
- $host,
1602
- resourceUri,
1603
- recommendationId
1604
- ],
1605
- headerParameters: [accept],
1606
- serializer: serializer$2
1607
- };
1608
- const listNextOperationSpec$2 = {
1609
- path: "{nextLink}",
1610
- httpMethod: "GET",
1611
- responses: {
1612
- 200: {
1613
- bodyMapper: ResourceRecommendationBaseListResult
1614
- },
1615
- default: {
1616
- bodyMapper: ArmErrorResponse
1617
- }
1618
- },
1619
- urlParameters: [
1620
- $host,
1621
- nextLink,
1622
- subscriptionId
1623
- ],
1624
- headerParameters: [accept],
1625
- serializer: serializer$2
1626
- };
1627
-
1628
- /*
1629
- * Copyright (c) Microsoft Corporation.
1630
- * Licensed under the MIT License.
1631
- *
1632
- * Code generated by Microsoft (R) AutoRest Code Generator.
1633
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1634
- */
1635
- /// <reference lib="esnext.asynciterable" />
1636
- /** Class containing Operations operations. */
1637
- class OperationsImpl {
1638
- /**
1639
- * Initialize a new instance of the class Operations class.
1640
- * @param client Reference to the service client
1641
- */
1642
- constructor(client) {
1643
- this.client = client;
1644
- }
1645
- /**
1646
- * Lists all the available Advisor REST API operations.
1647
- * @param options The options parameters.
1648
- */
1649
- list(options) {
1650
- const iter = this.listPagingAll(options);
1651
- return {
1652
- next() {
1653
- return iter.next();
1654
- },
1655
- [Symbol.asyncIterator]() {
1656
- return this;
1657
- },
1658
- byPage: (settings) => {
1659
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1660
- throw new Error("maxPageSize is not supported by this operation.");
1661
- }
1662
- return this.listPagingPage(options, settings);
1663
- }
1664
- };
1665
- }
1666
- listPagingPage(options, settings) {
1667
- return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1668
- let result;
1669
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1670
- if (!continuationToken) {
1671
- result = yield tslib.__await(this._list(options));
1672
- let page = result.value || [];
1673
- continuationToken = result.nextLink;
1674
- setContinuationToken(page, continuationToken);
1675
- yield yield tslib.__await(page);
1676
- }
1677
- while (continuationToken) {
1678
- result = yield tslib.__await(this._listNext(continuationToken, options));
1679
- continuationToken = result.nextLink;
1680
- let page = result.value || [];
1681
- setContinuationToken(page, continuationToken);
1682
- yield yield tslib.__await(page);
1683
- }
1684
- });
1685
- }
1686
- listPagingAll(options) {
1687
- return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1688
- var _a, e_1, _b, _c;
1689
- try {
1690
- for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1691
- _c = _f.value;
1692
- _d = false;
1693
- const page = _c;
1694
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1695
- }
1696
- }
1697
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1698
- finally {
1699
- try {
1700
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1701
- }
1702
- finally { if (e_1) throw e_1.error; }
1703
- }
1704
- });
1705
- }
1706
- /**
1707
- * Lists all the available Advisor REST API operations.
1708
- * @param options The options parameters.
1709
- */
1710
- _list(options) {
1711
- return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1712
- }
1713
- /**
1714
- * ListNext
1715
- * @param nextLink The nextLink from the previous successful call to the List method.
1716
- * @param options The options parameters.
1717
- */
1718
- _listNext(nextLink, options) {
1719
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
1720
- }
1721
- }
1722
- // Operation Specifications
1723
- const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1724
- const listOperationSpec$1 = {
1725
- path: "/providers/Microsoft.Advisor/operations",
1726
- httpMethod: "GET",
1727
- responses: {
1728
- 200: {
1729
- bodyMapper: OperationEntityListResult
1730
- },
1731
- default: {
1732
- bodyMapper: ArmErrorResponse
1733
- }
1734
- },
1735
- queryParameters: [apiVersion],
1736
- urlParameters: [$host],
1737
- headerParameters: [accept],
1738
- serializer: serializer$1
1739
- };
1740
- const listNextOperationSpec$1 = {
1741
- path: "{nextLink}",
1742
- httpMethod: "GET",
1743
- responses: {
1744
- 200: {
1745
- bodyMapper: OperationEntityListResult
1746
- },
1747
- default: {
1748
- bodyMapper: ArmErrorResponse
1749
- }
1750
- },
1751
- urlParameters: [$host, nextLink],
1752
- headerParameters: [accept],
1753
- serializer: serializer$1
1754
- };
1755
-
1756
- /*
1757
- * Copyright (c) Microsoft Corporation.
1758
- * Licensed under the MIT License.
1759
- *
1760
- * Code generated by Microsoft (R) AutoRest Code Generator.
1761
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1762
- */
1763
- /// <reference lib="esnext.asynciterable" />
1764
- /** Class containing Suppressions operations. */
1765
- class SuppressionsImpl {
1766
- /**
1767
- * Initialize a new instance of the class Suppressions class.
1768
- * @param client Reference to the service client
1769
- */
1770
- constructor(client) {
1771
- this.client = client;
1772
- }
1773
- /**
1774
- * Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or dismissed
1775
- * attribute of a recommendation is referred to as a suppression.
1776
- * @param options The options parameters.
1777
- */
1778
- list(options) {
1779
- const iter = this.listPagingAll(options);
1780
- return {
1781
- next() {
1782
- return iter.next();
1783
- },
1784
- [Symbol.asyncIterator]() {
1785
- return this;
1786
- },
1787
- byPage: (settings) => {
1788
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1789
- throw new Error("maxPageSize is not supported by this operation.");
1790
- }
1791
- return this.listPagingPage(options, settings);
1792
- }
1793
- };
1794
- }
1795
- listPagingPage(options, settings) {
1796
- return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1797
- let result;
1798
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1799
- if (!continuationToken) {
1800
- result = yield tslib.__await(this._list(options));
1801
- let page = result.value || [];
1802
- continuationToken = result.nextLink;
1803
- setContinuationToken(page, continuationToken);
1804
- yield yield tslib.__await(page);
1805
- }
1806
- while (continuationToken) {
1807
- result = yield tslib.__await(this._listNext(continuationToken, options));
1808
- continuationToken = result.nextLink;
1809
- let page = result.value || [];
1810
- setContinuationToken(page, continuationToken);
1811
- yield yield tslib.__await(page);
1812
- }
1813
- });
1814
- }
1815
- listPagingAll(options) {
1816
- return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1817
- var _a, e_1, _b, _c;
1818
- try {
1819
- for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1820
- _c = _f.value;
1821
- _d = false;
1822
- const page = _c;
1823
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1824
- }
1825
- }
1826
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1827
- finally {
1828
- try {
1829
- if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1830
- }
1831
- finally { if (e_1) throw e_1.error; }
1832
- }
1833
- });
1834
- }
1835
- /**
1836
- * Obtains the details of a suppression.
1837
- * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which
1838
- * the recommendation applies.
1839
- * @param recommendationId The recommendation ID.
1840
- * @param name The name of the suppression.
1841
- * @param options The options parameters.
1842
- */
1843
- get(resourceUri, recommendationId, name, options) {
1844
- return this.client.sendOperationRequest({ resourceUri, recommendationId, name, options }, getOperationSpec);
1845
- }
1846
- /**
1847
- * Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed attribute
1848
- * is referred to as a suppression. Use this API to create or update the snoozed or dismissed status of
1849
- * a recommendation.
1850
- * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which
1851
- * the recommendation applies.
1852
- * @param recommendationId The recommendation ID.
1853
- * @param name The name of the suppression.
1854
- * @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration.
1855
- * @param options The options parameters.
1856
- */
1857
- create(resourceUri, recommendationId, name, suppressionContract, options) {
1858
- return this.client.sendOperationRequest({ resourceUri, recommendationId, name, suppressionContract, options }, createOperationSpec);
1859
- }
1860
- /**
1861
- * Enables the activation of a snoozed or dismissed recommendation. The snoozed or dismissed attribute
1862
- * of a recommendation is referred to as a suppression.
1863
- * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which
1864
- * the recommendation applies.
1865
- * @param recommendationId The recommendation ID.
1866
- * @param name The name of the suppression.
1867
- * @param options The options parameters.
1868
- */
1869
- delete(resourceUri, recommendationId, name, options) {
1870
- return this.client.sendOperationRequest({ resourceUri, recommendationId, name, options }, deleteOperationSpec);
1871
- }
1872
- /**
1873
- * Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or dismissed
1874
- * attribute of a recommendation is referred to as a suppression.
1875
- * @param options The options parameters.
1876
- */
1877
- _list(options) {
1878
- return this.client.sendOperationRequest({ options }, listOperationSpec);
1879
- }
1880
- /**
1881
- * ListNext
1882
- * @param nextLink The nextLink from the previous successful call to the List method.
1883
- * @param options The options parameters.
1884
- */
1885
- _listNext(nextLink, options) {
1886
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1887
- }
1888
- }
1889
- // Operation Specifications
1890
- const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1891
- const getOperationSpec = {
1892
- path: "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}",
1893
- httpMethod: "GET",
1894
- responses: {
1895
- 200: {
1896
- bodyMapper: SuppressionContract
1897
- },
1898
- 404: {
1899
- bodyMapper: ArmErrorResponse,
1900
- isError: true
1901
- },
1902
- default: {
1903
- bodyMapper: ArmErrorResponse
1904
- }
1905
- },
1906
- queryParameters: [apiVersion],
1907
- urlParameters: [
1908
- $host,
1909
- name,
1910
- resourceUri,
1911
- recommendationId
1912
- ],
1913
- headerParameters: [accept],
1914
- serializer
1915
- };
1916
- const createOperationSpec = {
1917
- path: "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}",
1918
- httpMethod: "PUT",
1919
- responses: {
1920
- 200: {
1921
- bodyMapper: SuppressionContract
1922
- },
1923
- 404: {
1924
- bodyMapper: ArmErrorResponse,
1925
- isError: true
1926
- },
1927
- default: {
1928
- bodyMapper: ArmErrorResponse
1929
- }
1930
- },
1931
- requestBody: suppressionContract,
1932
- queryParameters: [apiVersion],
1933
- urlParameters: [
1934
- $host,
1935
- name,
1936
- resourceUri,
1937
- recommendationId
1938
- ],
1939
- headerParameters: [accept, contentType],
1940
- mediaType: "json",
1941
- serializer
1942
- };
1943
- const deleteOperationSpec = {
1944
- path: "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}",
1945
- httpMethod: "DELETE",
1946
- responses: {
1947
- 204: {},
1948
- default: {
1949
- bodyMapper: ArmErrorResponse
1950
- }
1951
- },
1952
- queryParameters: [apiVersion],
1953
- urlParameters: [
1954
- $host,
1955
- name,
1956
- resourceUri,
1957
- recommendationId
1958
- ],
1959
- headerParameters: [accept],
1960
- serializer
1961
- };
1962
- const listOperationSpec = {
1963
- path: "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions",
1964
- httpMethod: "GET",
1965
- responses: {
1966
- 200: {
1967
- bodyMapper: SuppressionContractListResult
1968
- },
1969
- default: {
1970
- bodyMapper: ArmErrorResponse
1971
- }
1972
- },
1973
- queryParameters: [
1974
- apiVersion,
1975
- top,
1976
- skipToken
1977
- ],
1978
- urlParameters: [$host, subscriptionId],
1979
- headerParameters: [accept],
1980
- serializer
1981
- };
1982
- const listNextOperationSpec = {
1983
- path: "{nextLink}",
1984
- httpMethod: "GET",
1985
- responses: {
1986
- 200: {
1987
- bodyMapper: SuppressionContractListResult
1988
- },
1989
- default: {
1990
- bodyMapper: ArmErrorResponse
1991
- }
1992
- },
1993
- urlParameters: [
1994
- $host,
1995
- nextLink,
1996
- subscriptionId
1997
- ],
1998
- headerParameters: [accept],
1999
- serializer
2000
- };
2001
-
2002
- /*
2003
- * Copyright (c) Microsoft Corporation.
2004
- * Licensed under the MIT License.
2005
- *
2006
- * Code generated by Microsoft (R) AutoRest Code Generator.
2007
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2008
- */
2009
- class AdvisorManagementClient extends coreClient__namespace.ServiceClient {
2010
- constructor(credentials, subscriptionIdOrOptions, options) {
2011
- var _a, _b, _c;
2012
- if (credentials === undefined) {
2013
- throw new Error("'credentials' cannot be null");
2014
- }
2015
- let subscriptionId;
2016
- if (typeof subscriptionIdOrOptions === "string") {
2017
- subscriptionId = subscriptionIdOrOptions;
2018
- }
2019
- else if (typeof subscriptionIdOrOptions === "object") {
2020
- options = subscriptionIdOrOptions;
2021
- }
2022
- // Initializing default values for options
2023
- if (!options) {
2024
- options = {};
2025
- }
2026
- const defaults = {
2027
- requestContentType: "application/json; charset=utf-8",
2028
- credential: credentials
2029
- };
2030
- const packageDetails = `azsdk-js-arm-advisor/3.2.0`;
2031
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2032
- ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2033
- : `${packageDetails}`;
2034
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2035
- userAgentPrefix
2036
- }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2037
- super(optionsWithDefaults);
2038
- let bearerTokenAuthenticationPolicyFound = false;
2039
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2040
- const pipelinePolicies = options.pipeline.getOrderedPolicies();
2041
- bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2042
- coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2043
- }
2044
- if (!options ||
2045
- !options.pipeline ||
2046
- options.pipeline.getOrderedPolicies().length == 0 ||
2047
- !bearerTokenAuthenticationPolicyFound) {
2048
- this.pipeline.removePolicy({
2049
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2050
- });
2051
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2052
- credential: credentials,
2053
- scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2054
- challengeCallbacks: {
2055
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2056
- }
2057
- }));
2058
- }
2059
- // Parameter assignments
2060
- this.subscriptionId = subscriptionId;
2061
- // Assigning values to Constant parameters
2062
- this.$host = options.$host || "https://management.azure.com";
2063
- this.apiVersion = options.apiVersion || "2020-01-01";
2064
- this.recommendationMetadata = new RecommendationMetadataImpl(this);
2065
- this.configurations = new ConfigurationsImpl(this);
2066
- this.recommendations = new RecommendationsImpl(this);
2067
- this.operations = new OperationsImpl(this);
2068
- this.suppressions = new SuppressionsImpl(this);
2069
- this.addCustomApiVersionPolicy(options.apiVersion);
2070
- }
2071
- /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2072
- addCustomApiVersionPolicy(apiVersion) {
2073
- if (!apiVersion) {
2074
- return;
2075
- }
2076
- const apiVersionPolicy = {
2077
- name: "CustomApiVersionPolicy",
2078
- sendRequest(request, next) {
2079
- return tslib.__awaiter(this, void 0, void 0, function* () {
2080
- const param = request.url.split("?");
2081
- if (param.length > 1) {
2082
- const newParams = param[1].split("&").map((item) => {
2083
- if (item.indexOf("api-version") > -1) {
2084
- return "api-version=" + apiVersion;
2085
- }
2086
- else {
2087
- return item;
2088
- }
2089
- });
2090
- request.url = param[0] + "?" + newParams.join("&");
2091
- }
2092
- return next(request);
2093
- });
2094
- }
2095
- };
2096
- this.pipeline.addPolicy(apiVersionPolicy);
2097
- }
2098
- }
2099
-
2100
- exports.AdvisorManagementClient = AdvisorManagementClient;
2101
- exports.getContinuationToken = getContinuationToken;
2102
- //# sourceMappingURL=index.js.map