@azure/arm-monitor 8.0.0-alpha.20250619.1 → 8.0.0-alpha.20250729.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 (291) hide show
  1. package/dist/browser/lroImpl.js +7 -3
  2. package/dist/browser/lroImpl.js.map +1 -1
  3. package/dist/browser/models/mappers.js +449 -195
  4. package/dist/browser/models/mappers.js.map +1 -1
  5. package/dist/browser/monitorClient.js +55 -11
  6. package/dist/browser/monitorClient.js.map +1 -1
  7. package/dist/browser/operations/actionGroups.js +30 -59
  8. package/dist/browser/operations/actionGroups.js.map +1 -1
  9. package/dist/browser/operations/activityLogAlerts.js +45 -79
  10. package/dist/browser/operations/activityLogAlerts.js.map +1 -1
  11. package/dist/browser/operations/activityLogs.js +23 -40
  12. package/dist/browser/operations/activityLogs.js.map +1 -1
  13. package/dist/browser/operations/alertRuleIncidents.js +10 -27
  14. package/dist/browser/operations/alertRuleIncidents.js.map +1 -1
  15. package/dist/browser/operations/alertRules.js +19 -53
  16. package/dist/browser/operations/alertRules.js.map +1 -1
  17. package/dist/browser/operations/autoscaleSettings.js +45 -79
  18. package/dist/browser/operations/autoscaleSettings.js.map +1 -1
  19. package/dist/browser/operations/azureMonitorWorkspaces.js +56 -85
  20. package/dist/browser/operations/azureMonitorWorkspaces.js.map +1 -1
  21. package/dist/browser/operations/baselines.js +10 -27
  22. package/dist/browser/operations/baselines.js.map +1 -1
  23. package/dist/browser/operations/dataCollectionEndpoints.js +45 -79
  24. package/dist/browser/operations/dataCollectionEndpoints.js.map +1 -1
  25. package/dist/browser/operations/dataCollectionRuleAssociations.js +67 -118
  26. package/dist/browser/operations/dataCollectionRuleAssociations.js.map +1 -1
  27. package/dist/browser/operations/dataCollectionRules.js +45 -79
  28. package/dist/browser/operations/dataCollectionRules.js.map +1 -1
  29. package/dist/browser/operations/diagnosticSettings.js +10 -27
  30. package/dist/browser/operations/diagnosticSettings.js.map +1 -1
  31. package/dist/browser/operations/diagnosticSettingsCategory.js +10 -27
  32. package/dist/browser/operations/diagnosticSettingsCategory.js.map +1 -1
  33. package/dist/browser/operations/eventCategories.js +10 -27
  34. package/dist/browser/operations/eventCategories.js.map +1 -1
  35. package/dist/browser/operations/logProfiles.js +10 -27
  36. package/dist/browser/operations/logProfiles.js.map +1 -1
  37. package/dist/browser/operations/metricAlerts.js +19 -53
  38. package/dist/browser/operations/metricAlerts.js.map +1 -1
  39. package/dist/browser/operations/metricAlertsStatus.js +1 -0
  40. package/dist/browser/operations/metricAlertsStatus.js.map +1 -1
  41. package/dist/browser/operations/metricDefinitions.js +19 -53
  42. package/dist/browser/operations/metricDefinitions.js.map +1 -1
  43. package/dist/browser/operations/metricNamespaces.js +10 -27
  44. package/dist/browser/operations/metricNamespaces.js.map +1 -1
  45. package/dist/browser/operations/metricsOperations.js +1 -0
  46. package/dist/browser/operations/metricsOperations.js.map +1 -1
  47. package/dist/browser/operations/monitorOperations.js +23 -40
  48. package/dist/browser/operations/monitorOperations.js.map +1 -1
  49. package/dist/browser/operations/operations.js +1 -0
  50. package/dist/browser/operations/operations.js.map +1 -1
  51. package/dist/browser/operations/predictiveMetric.js +1 -0
  52. package/dist/browser/operations/predictiveMetric.js.map +1 -1
  53. package/dist/browser/operations/privateEndpointConnections.js +23 -12
  54. package/dist/browser/operations/privateEndpointConnections.js.map +1 -1
  55. package/dist/browser/operations/privateLinkResources.js +1 -0
  56. package/dist/browser/operations/privateLinkResources.js.map +1 -1
  57. package/dist/browser/operations/privateLinkScopeOperationStatus.js +1 -0
  58. package/dist/browser/operations/privateLinkScopeOperationStatus.js.map +1 -1
  59. package/dist/browser/operations/privateLinkScopedResources.js +45 -52
  60. package/dist/browser/operations/privateLinkScopedResources.js.map +1 -1
  61. package/dist/browser/operations/privateLinkScopes.js +56 -85
  62. package/dist/browser/operations/privateLinkScopes.js.map +1 -1
  63. package/dist/browser/operations/scheduledQueryRules.js +45 -79
  64. package/dist/browser/operations/scheduledQueryRules.js.map +1 -1
  65. package/dist/browser/operations/tenantActionGroups.js +10 -27
  66. package/dist/browser/operations/tenantActionGroups.js.map +1 -1
  67. package/dist/browser/operations/tenantActivityLogs.js +23 -40
  68. package/dist/browser/operations/tenantActivityLogs.js.map +1 -1
  69. package/dist/browser/operations/vMInsights.js +1 -0
  70. package/dist/browser/operations/vMInsights.js.map +1 -1
  71. package/dist/browser/pagingHelper.js +2 -4
  72. package/dist/browser/pagingHelper.js.map +1 -1
  73. package/dist/commonjs/lroImpl.js +7 -3
  74. package/dist/commonjs/lroImpl.js.map +1 -1
  75. package/dist/commonjs/models/mappers.js +449 -195
  76. package/dist/commonjs/models/mappers.js.map +1 -1
  77. package/dist/commonjs/monitorClient.js +55 -11
  78. package/dist/commonjs/monitorClient.js.map +1 -1
  79. package/dist/commonjs/operations/actionGroups.js +30 -58
  80. package/dist/commonjs/operations/actionGroups.js.map +1 -1
  81. package/dist/commonjs/operations/activityLogAlerts.js +45 -78
  82. package/dist/commonjs/operations/activityLogAlerts.js.map +1 -1
  83. package/dist/commonjs/operations/activityLogs.js +23 -39
  84. package/dist/commonjs/operations/activityLogs.js.map +1 -1
  85. package/dist/commonjs/operations/alertRuleIncidents.js +10 -26
  86. package/dist/commonjs/operations/alertRuleIncidents.js.map +1 -1
  87. package/dist/commonjs/operations/alertRules.js +19 -52
  88. package/dist/commonjs/operations/alertRules.js.map +1 -1
  89. package/dist/commonjs/operations/autoscaleSettings.js +45 -78
  90. package/dist/commonjs/operations/autoscaleSettings.js.map +1 -1
  91. package/dist/commonjs/operations/azureMonitorWorkspaces.js +56 -84
  92. package/dist/commonjs/operations/azureMonitorWorkspaces.js.map +1 -1
  93. package/dist/commonjs/operations/baselines.js +10 -26
  94. package/dist/commonjs/operations/baselines.js.map +1 -1
  95. package/dist/commonjs/operations/dataCollectionEndpoints.js +45 -78
  96. package/dist/commonjs/operations/dataCollectionEndpoints.js.map +1 -1
  97. package/dist/commonjs/operations/dataCollectionRuleAssociations.js +67 -117
  98. package/dist/commonjs/operations/dataCollectionRuleAssociations.js.map +1 -1
  99. package/dist/commonjs/operations/dataCollectionRules.js +45 -78
  100. package/dist/commonjs/operations/dataCollectionRules.js.map +1 -1
  101. package/dist/commonjs/operations/diagnosticSettings.js +10 -26
  102. package/dist/commonjs/operations/diagnosticSettings.js.map +1 -1
  103. package/dist/commonjs/operations/diagnosticSettingsCategory.js +10 -26
  104. package/dist/commonjs/operations/diagnosticSettingsCategory.js.map +1 -1
  105. package/dist/commonjs/operations/eventCategories.js +10 -26
  106. package/dist/commonjs/operations/eventCategories.js.map +1 -1
  107. package/dist/commonjs/operations/logProfiles.js +10 -26
  108. package/dist/commonjs/operations/logProfiles.js.map +1 -1
  109. package/dist/commonjs/operations/metricAlerts.js +19 -52
  110. package/dist/commonjs/operations/metricAlerts.js.map +1 -1
  111. package/dist/commonjs/operations/metricAlertsStatus.js +1 -0
  112. package/dist/commonjs/operations/metricAlertsStatus.js.map +1 -1
  113. package/dist/commonjs/operations/metricDefinitions.js +19 -52
  114. package/dist/commonjs/operations/metricDefinitions.js.map +1 -1
  115. package/dist/commonjs/operations/metricNamespaces.js +10 -26
  116. package/dist/commonjs/operations/metricNamespaces.js.map +1 -1
  117. package/dist/commonjs/operations/metricsOperations.js +1 -0
  118. package/dist/commonjs/operations/metricsOperations.js.map +1 -1
  119. package/dist/commonjs/operations/monitorOperations.js +23 -39
  120. package/dist/commonjs/operations/monitorOperations.js.map +1 -1
  121. package/dist/commonjs/operations/operations.js +1 -0
  122. package/dist/commonjs/operations/operations.js.map +1 -1
  123. package/dist/commonjs/operations/predictiveMetric.js +1 -0
  124. package/dist/commonjs/operations/predictiveMetric.js.map +1 -1
  125. package/dist/commonjs/operations/privateEndpointConnections.js +23 -12
  126. package/dist/commonjs/operations/privateEndpointConnections.js.map +1 -1
  127. package/dist/commonjs/operations/privateLinkResources.js +1 -0
  128. package/dist/commonjs/operations/privateLinkResources.js.map +1 -1
  129. package/dist/commonjs/operations/privateLinkScopeOperationStatus.js +1 -0
  130. package/dist/commonjs/operations/privateLinkScopeOperationStatus.js.map +1 -1
  131. package/dist/commonjs/operations/privateLinkScopedResources.js +45 -51
  132. package/dist/commonjs/operations/privateLinkScopedResources.js.map +1 -1
  133. package/dist/commonjs/operations/privateLinkScopes.js +56 -84
  134. package/dist/commonjs/operations/privateLinkScopes.js.map +1 -1
  135. package/dist/commonjs/operations/scheduledQueryRules.js +45 -78
  136. package/dist/commonjs/operations/scheduledQueryRules.js.map +1 -1
  137. package/dist/commonjs/operations/tenantActionGroups.js +10 -26
  138. package/dist/commonjs/operations/tenantActionGroups.js.map +1 -1
  139. package/dist/commonjs/operations/tenantActivityLogs.js +23 -39
  140. package/dist/commonjs/operations/tenantActivityLogs.js.map +1 -1
  141. package/dist/commonjs/operations/vMInsights.js +1 -0
  142. package/dist/commonjs/operations/vMInsights.js.map +1 -1
  143. package/dist/commonjs/pagingHelper.js +2 -4
  144. package/dist/commonjs/pagingHelper.js.map +1 -1
  145. package/dist/commonjs/tsdoc-metadata.json +11 -11
  146. package/dist/esm/lroImpl.js +7 -3
  147. package/dist/esm/lroImpl.js.map +1 -1
  148. package/dist/esm/models/mappers.js +449 -195
  149. package/dist/esm/models/mappers.js.map +1 -1
  150. package/dist/esm/monitorClient.js +55 -11
  151. package/dist/esm/monitorClient.js.map +1 -1
  152. package/dist/esm/operations/actionGroups.js +30 -59
  153. package/dist/esm/operations/actionGroups.js.map +1 -1
  154. package/dist/esm/operations/activityLogAlerts.js +45 -79
  155. package/dist/esm/operations/activityLogAlerts.js.map +1 -1
  156. package/dist/esm/operations/activityLogs.js +23 -40
  157. package/dist/esm/operations/activityLogs.js.map +1 -1
  158. package/dist/esm/operations/alertRuleIncidents.js +10 -27
  159. package/dist/esm/operations/alertRuleIncidents.js.map +1 -1
  160. package/dist/esm/operations/alertRules.js +19 -53
  161. package/dist/esm/operations/alertRules.js.map +1 -1
  162. package/dist/esm/operations/autoscaleSettings.js +45 -79
  163. package/dist/esm/operations/autoscaleSettings.js.map +1 -1
  164. package/dist/esm/operations/azureMonitorWorkspaces.js +56 -85
  165. package/dist/esm/operations/azureMonitorWorkspaces.js.map +1 -1
  166. package/dist/esm/operations/baselines.js +10 -27
  167. package/dist/esm/operations/baselines.js.map +1 -1
  168. package/dist/esm/operations/dataCollectionEndpoints.js +45 -79
  169. package/dist/esm/operations/dataCollectionEndpoints.js.map +1 -1
  170. package/dist/esm/operations/dataCollectionRuleAssociations.js +67 -118
  171. package/dist/esm/operations/dataCollectionRuleAssociations.js.map +1 -1
  172. package/dist/esm/operations/dataCollectionRules.js +45 -79
  173. package/dist/esm/operations/dataCollectionRules.js.map +1 -1
  174. package/dist/esm/operations/diagnosticSettings.js +10 -27
  175. package/dist/esm/operations/diagnosticSettings.js.map +1 -1
  176. package/dist/esm/operations/diagnosticSettingsCategory.js +10 -27
  177. package/dist/esm/operations/diagnosticSettingsCategory.js.map +1 -1
  178. package/dist/esm/operations/eventCategories.js +10 -27
  179. package/dist/esm/operations/eventCategories.js.map +1 -1
  180. package/dist/esm/operations/logProfiles.js +10 -27
  181. package/dist/esm/operations/logProfiles.js.map +1 -1
  182. package/dist/esm/operations/metricAlerts.js +19 -53
  183. package/dist/esm/operations/metricAlerts.js.map +1 -1
  184. package/dist/esm/operations/metricAlertsStatus.js +1 -0
  185. package/dist/esm/operations/metricAlertsStatus.js.map +1 -1
  186. package/dist/esm/operations/metricDefinitions.js +19 -53
  187. package/dist/esm/operations/metricDefinitions.js.map +1 -1
  188. package/dist/esm/operations/metricNamespaces.js +10 -27
  189. package/dist/esm/operations/metricNamespaces.js.map +1 -1
  190. package/dist/esm/operations/metricsOperations.js +1 -0
  191. package/dist/esm/operations/metricsOperations.js.map +1 -1
  192. package/dist/esm/operations/monitorOperations.js +23 -40
  193. package/dist/esm/operations/monitorOperations.js.map +1 -1
  194. package/dist/esm/operations/operations.js +1 -0
  195. package/dist/esm/operations/operations.js.map +1 -1
  196. package/dist/esm/operations/predictiveMetric.js +1 -0
  197. package/dist/esm/operations/predictiveMetric.js.map +1 -1
  198. package/dist/esm/operations/privateEndpointConnections.js +23 -12
  199. package/dist/esm/operations/privateEndpointConnections.js.map +1 -1
  200. package/dist/esm/operations/privateLinkResources.js +1 -0
  201. package/dist/esm/operations/privateLinkResources.js.map +1 -1
  202. package/dist/esm/operations/privateLinkScopeOperationStatus.js +1 -0
  203. package/dist/esm/operations/privateLinkScopeOperationStatus.js.map +1 -1
  204. package/dist/esm/operations/privateLinkScopedResources.js +45 -52
  205. package/dist/esm/operations/privateLinkScopedResources.js.map +1 -1
  206. package/dist/esm/operations/privateLinkScopes.js +56 -85
  207. package/dist/esm/operations/privateLinkScopes.js.map +1 -1
  208. package/dist/esm/operations/scheduledQueryRules.js +45 -79
  209. package/dist/esm/operations/scheduledQueryRules.js.map +1 -1
  210. package/dist/esm/operations/tenantActionGroups.js +10 -27
  211. package/dist/esm/operations/tenantActionGroups.js.map +1 -1
  212. package/dist/esm/operations/tenantActivityLogs.js +23 -40
  213. package/dist/esm/operations/tenantActivityLogs.js.map +1 -1
  214. package/dist/esm/operations/vMInsights.js +1 -0
  215. package/dist/esm/operations/vMInsights.js.map +1 -1
  216. package/dist/esm/pagingHelper.js +2 -4
  217. package/dist/esm/pagingHelper.js.map +1 -1
  218. package/dist/react-native/lroImpl.js +7 -3
  219. package/dist/react-native/lroImpl.js.map +1 -1
  220. package/dist/react-native/models/mappers.js +449 -195
  221. package/dist/react-native/models/mappers.js.map +1 -1
  222. package/dist/react-native/monitorClient.js +55 -11
  223. package/dist/react-native/monitorClient.js.map +1 -1
  224. package/dist/react-native/operations/actionGroups.js +30 -59
  225. package/dist/react-native/operations/actionGroups.js.map +1 -1
  226. package/dist/react-native/operations/activityLogAlerts.js +45 -79
  227. package/dist/react-native/operations/activityLogAlerts.js.map +1 -1
  228. package/dist/react-native/operations/activityLogs.js +23 -40
  229. package/dist/react-native/operations/activityLogs.js.map +1 -1
  230. package/dist/react-native/operations/alertRuleIncidents.js +10 -27
  231. package/dist/react-native/operations/alertRuleIncidents.js.map +1 -1
  232. package/dist/react-native/operations/alertRules.js +19 -53
  233. package/dist/react-native/operations/alertRules.js.map +1 -1
  234. package/dist/react-native/operations/autoscaleSettings.js +45 -79
  235. package/dist/react-native/operations/autoscaleSettings.js.map +1 -1
  236. package/dist/react-native/operations/azureMonitorWorkspaces.js +56 -85
  237. package/dist/react-native/operations/azureMonitorWorkspaces.js.map +1 -1
  238. package/dist/react-native/operations/baselines.js +10 -27
  239. package/dist/react-native/operations/baselines.js.map +1 -1
  240. package/dist/react-native/operations/dataCollectionEndpoints.js +45 -79
  241. package/dist/react-native/operations/dataCollectionEndpoints.js.map +1 -1
  242. package/dist/react-native/operations/dataCollectionRuleAssociations.js +67 -118
  243. package/dist/react-native/operations/dataCollectionRuleAssociations.js.map +1 -1
  244. package/dist/react-native/operations/dataCollectionRules.js +45 -79
  245. package/dist/react-native/operations/dataCollectionRules.js.map +1 -1
  246. package/dist/react-native/operations/diagnosticSettings.js +10 -27
  247. package/dist/react-native/operations/diagnosticSettings.js.map +1 -1
  248. package/dist/react-native/operations/diagnosticSettingsCategory.js +10 -27
  249. package/dist/react-native/operations/diagnosticSettingsCategory.js.map +1 -1
  250. package/dist/react-native/operations/eventCategories.js +10 -27
  251. package/dist/react-native/operations/eventCategories.js.map +1 -1
  252. package/dist/react-native/operations/logProfiles.js +10 -27
  253. package/dist/react-native/operations/logProfiles.js.map +1 -1
  254. package/dist/react-native/operations/metricAlerts.js +19 -53
  255. package/dist/react-native/operations/metricAlerts.js.map +1 -1
  256. package/dist/react-native/operations/metricAlertsStatus.js +1 -0
  257. package/dist/react-native/operations/metricAlertsStatus.js.map +1 -1
  258. package/dist/react-native/operations/metricDefinitions.js +19 -53
  259. package/dist/react-native/operations/metricDefinitions.js.map +1 -1
  260. package/dist/react-native/operations/metricNamespaces.js +10 -27
  261. package/dist/react-native/operations/metricNamespaces.js.map +1 -1
  262. package/dist/react-native/operations/metricsOperations.js +1 -0
  263. package/dist/react-native/operations/metricsOperations.js.map +1 -1
  264. package/dist/react-native/operations/monitorOperations.js +23 -40
  265. package/dist/react-native/operations/monitorOperations.js.map +1 -1
  266. package/dist/react-native/operations/operations.js +1 -0
  267. package/dist/react-native/operations/operations.js.map +1 -1
  268. package/dist/react-native/operations/predictiveMetric.js +1 -0
  269. package/dist/react-native/operations/predictiveMetric.js.map +1 -1
  270. package/dist/react-native/operations/privateEndpointConnections.js +23 -12
  271. package/dist/react-native/operations/privateEndpointConnections.js.map +1 -1
  272. package/dist/react-native/operations/privateLinkResources.js +1 -0
  273. package/dist/react-native/operations/privateLinkResources.js.map +1 -1
  274. package/dist/react-native/operations/privateLinkScopeOperationStatus.js +1 -0
  275. package/dist/react-native/operations/privateLinkScopeOperationStatus.js.map +1 -1
  276. package/dist/react-native/operations/privateLinkScopedResources.js +45 -52
  277. package/dist/react-native/operations/privateLinkScopedResources.js.map +1 -1
  278. package/dist/react-native/operations/privateLinkScopes.js +56 -85
  279. package/dist/react-native/operations/privateLinkScopes.js.map +1 -1
  280. package/dist/react-native/operations/scheduledQueryRules.js +45 -79
  281. package/dist/react-native/operations/scheduledQueryRules.js.map +1 -1
  282. package/dist/react-native/operations/tenantActionGroups.js +10 -27
  283. package/dist/react-native/operations/tenantActionGroups.js.map +1 -1
  284. package/dist/react-native/operations/tenantActivityLogs.js +23 -40
  285. package/dist/react-native/operations/tenantActivityLogs.js.map +1 -1
  286. package/dist/react-native/operations/vMInsights.js +1 -0
  287. package/dist/react-native/operations/vMInsights.js.map +1 -1
  288. package/dist/react-native/pagingHelper.js +2 -4
  289. package/dist/react-native/pagingHelper.js.map +1 -1
  290. package/package.json +2 -2
  291. /package/review/{arm-monitor.api.md → arm-monitor-node.api.md} +0 -0
@@ -15,6 +15,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /// <reference lib="esnext.asynciterable" />
16
16
  /** Class containing MetricAlerts operations. */
17
17
  class MetricAlertsImpl {
18
+ client;
18
19
  /**
19
20
  * Initialize a new instance of the class MetricAlerts class.
20
21
  * @param client Reference to the service client
@@ -36,39 +37,22 @@ class MetricAlertsImpl {
36
37
  return this;
37
38
  },
38
39
  byPage: (settings) => {
39
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
40
+ if (settings?.maxPageSize) {
40
41
  throw new Error("maxPageSize is not supported by this operation.");
41
42
  }
42
43
  return this.listBySubscriptionPagingPage(options, settings);
43
44
  },
44
45
  };
45
46
  }
46
- listBySubscriptionPagingPage(options, _settings) {
47
- return tslib_1.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
48
- let result;
49
- result = yield tslib_1.__await(this._listBySubscription(options));
50
- yield yield tslib_1.__await(result.value || []);
51
- });
47
+ async *listBySubscriptionPagingPage(options, _settings) {
48
+ let result;
49
+ result = await this._listBySubscription(options);
50
+ yield result.value || [];
52
51
  }
53
- listBySubscriptionPagingAll(options) {
54
- return tslib_1.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
55
- var _a, e_1, _b, _c;
56
- try {
57
- for (var _d = true, _e = tslib_1.__asyncValues(this.listBySubscriptionPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
58
- _c = _f.value;
59
- _d = false;
60
- const page = _c;
61
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
62
- }
63
- }
64
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
65
- finally {
66
- try {
67
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
68
- }
69
- finally { if (e_1) throw e_1.error; }
70
- }
71
- });
52
+ async *listBySubscriptionPagingAll(options) {
53
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
54
+ yield* page;
55
+ }
72
56
  }
73
57
  /**
74
58
  * Retrieve alert rule definitions in a resource group.
@@ -85,39 +69,22 @@ class MetricAlertsImpl {
85
69
  return this;
86
70
  },
87
71
  byPage: (settings) => {
88
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
72
+ if (settings?.maxPageSize) {
89
73
  throw new Error("maxPageSize is not supported by this operation.");
90
74
  }
91
75
  return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
92
76
  },
93
77
  };
94
78
  }
95
- listByResourceGroupPagingPage(resourceGroupName, options, _settings) {
96
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
97
- let result;
98
- result = yield tslib_1.__await(this._listByResourceGroup(resourceGroupName, options));
99
- yield yield tslib_1.__await(result.value || []);
100
- });
79
+ async *listByResourceGroupPagingPage(resourceGroupName, options, _settings) {
80
+ let result;
81
+ result = await this._listByResourceGroup(resourceGroupName, options);
82
+ yield result.value || [];
101
83
  }
102
- listByResourceGroupPagingAll(resourceGroupName, options) {
103
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
104
- var _a, e_2, _b, _c;
105
- try {
106
- 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) {
107
- _c = _f.value;
108
- _d = false;
109
- const page = _c;
110
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
111
- }
112
- }
113
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
114
- finally {
115
- try {
116
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
117
- }
118
- finally { if (e_2) throw e_2.error; }
119
- }
120
- });
84
+ async *listByResourceGroupPagingAll(resourceGroupName, options) {
85
+ for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
86
+ yield* page;
87
+ }
121
88
  }
122
89
  /**
123
90
  * Retrieve alert rule definitions in a subscription.
@@ -1 +1 @@
1
- {"version":3,"file":"metricAlerts.js","sourceRoot":"","sources":["../../../src/operations/metricAlerts.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uEAAiD;AACjD,sEA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D,IAAI,EAAE,yHAAyH;IAC/H,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE;QACT,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,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 { MetricAlerts } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricAlertResource,\n MetricAlertsListBySubscriptionOptionalParams,\n MetricAlertsListBySubscriptionResponse,\n MetricAlertsListByResourceGroupOptionalParams,\n MetricAlertsListByResourceGroupResponse,\n MetricAlertsGetOptionalParams,\n MetricAlertsGetResponse,\n MetricAlertsCreateOrUpdateOptionalParams,\n MetricAlertsCreateOrUpdateResponse,\n MetricAlertResourcePatch,\n MetricAlertsUpdateOptionalParams,\n MetricAlertsUpdateResponse,\n MetricAlertsDeleteOptionalParams,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricAlerts operations. */\nexport class MetricAlertsImpl implements MetricAlerts {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricAlerts class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Retrieve alert rule definitions in a subscription.\n * @param options The options parameters.\n */\n public listBySubscription(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): PagedAsyncIterableIterator<MetricAlertResource> {\n const iter = this.listBySubscriptionPagingAll(options);\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.listBySubscriptionPagingPage(options, settings);\n },\n };\n }\n\n private async *listBySubscriptionPagingPage(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricAlertResource[]> {\n let result: MetricAlertsListBySubscriptionResponse;\n result = await this._listBySubscription(options);\n yield result.value || [];\n }\n\n private async *listBySubscriptionPagingAll(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): AsyncIterableIterator<MetricAlertResource> {\n for await (const page of this.listBySubscriptionPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieve alert rule definitions in a resource group.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param options The options parameters.\n */\n public listByResourceGroup(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): PagedAsyncIterableIterator<MetricAlertResource> {\n const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);\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.listByResourceGroupPagingPage(\n resourceGroupName,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listByResourceGroupPagingPage(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricAlertResource[]> {\n let result: MetricAlertsListByResourceGroupResponse;\n result = await this._listByResourceGroup(resourceGroupName, options);\n yield result.value || [];\n }\n\n private async *listByResourceGroupPagingAll(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): AsyncIterableIterator<MetricAlertResource> {\n for await (const page of this.listByResourceGroupPagingPage(\n resourceGroupName,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieve alert rule definitions in a subscription.\n * @param options The options parameters.\n */\n private _listBySubscription(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): Promise<MetricAlertsListBySubscriptionResponse> {\n return this.client.sendOperationRequest(\n { options },\n listBySubscriptionOperationSpec,\n );\n }\n\n /**\n * Retrieve alert rule definitions in a resource group.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param options The options parameters.\n */\n private _listByResourceGroup(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): Promise<MetricAlertsListByResourceGroupResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, options },\n listByResourceGroupOperationSpec,\n );\n }\n\n /**\n * Retrieve an alert rule definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n get(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsGetOptionalParams,\n ): Promise<MetricAlertsGetResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n getOperationSpec,\n );\n }\n\n /**\n * Create or update an metric alert definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param parameters The parameters of the rule to create or update.\n * @param options The options parameters.\n */\n createOrUpdate(\n resourceGroupName: string,\n ruleName: string,\n parameters: MetricAlertResource,\n options?: MetricAlertsCreateOrUpdateOptionalParams,\n ): Promise<MetricAlertsCreateOrUpdateResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, parameters, options },\n createOrUpdateOperationSpec,\n );\n }\n\n /**\n * Update an metric alert definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param parameters The parameters of the rule to update.\n * @param options The options parameters.\n */\n update(\n resourceGroupName: string,\n ruleName: string,\n parameters: MetricAlertResourcePatch,\n options?: MetricAlertsUpdateOptionalParams,\n ): Promise<MetricAlertsUpdateResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, parameters, options },\n updateOperationSpec,\n );\n }\n\n /**\n * Delete an alert rule definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n delete(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsDeleteOptionalParams,\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n deleteOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listBySubscriptionOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResourceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listByResourceGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResourceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: Parameters.parameters4,\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst updateOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: Parameters.parameters5,\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {},\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"metricAlerts.js","sourceRoot":"","sources":["../../../src/operations/metricAlerts.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAkBtD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAa,gBAAgB;IACV,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,kBAAkB,CACvB,OAAsD;QAEtD,MAAM,IAAI,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QACvD,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,4BAA4B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC9D,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,4BAA4B,CACzC,OAAsD,EACtD,SAAwB;QAExB,IAAI,MAA8C,CAAC;QACnD,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEO,KA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AAU;CACX,CAAC;AACF,MAAM,mBAAmB,GAA6B;IACpD,IAAI,EAAE,yHAAyH;IAC/H,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE;QACT,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,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 { MetricAlerts } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricAlertResource,\n MetricAlertsListBySubscriptionOptionalParams,\n MetricAlertsListBySubscriptionResponse,\n MetricAlertsListByResourceGroupOptionalParams,\n MetricAlertsListByResourceGroupResponse,\n MetricAlertsGetOptionalParams,\n MetricAlertsGetResponse,\n MetricAlertsCreateOrUpdateOptionalParams,\n MetricAlertsCreateOrUpdateResponse,\n MetricAlertResourcePatch,\n MetricAlertsUpdateOptionalParams,\n MetricAlertsUpdateResponse,\n MetricAlertsDeleteOptionalParams,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricAlerts operations. */\nexport class MetricAlertsImpl implements MetricAlerts {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricAlerts class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Retrieve alert rule definitions in a subscription.\n * @param options The options parameters.\n */\n public listBySubscription(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): PagedAsyncIterableIterator<MetricAlertResource> {\n const iter = this.listBySubscriptionPagingAll(options);\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.listBySubscriptionPagingPage(options, settings);\n },\n };\n }\n\n private async *listBySubscriptionPagingPage(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricAlertResource[]> {\n let result: MetricAlertsListBySubscriptionResponse;\n result = await this._listBySubscription(options);\n yield result.value || [];\n }\n\n private async *listBySubscriptionPagingAll(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): AsyncIterableIterator<MetricAlertResource> {\n for await (const page of this.listBySubscriptionPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieve alert rule definitions in a resource group.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param options The options parameters.\n */\n public listByResourceGroup(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): PagedAsyncIterableIterator<MetricAlertResource> {\n const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);\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.listByResourceGroupPagingPage(\n resourceGroupName,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listByResourceGroupPagingPage(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricAlertResource[]> {\n let result: MetricAlertsListByResourceGroupResponse;\n result = await this._listByResourceGroup(resourceGroupName, options);\n yield result.value || [];\n }\n\n private async *listByResourceGroupPagingAll(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): AsyncIterableIterator<MetricAlertResource> {\n for await (const page of this.listByResourceGroupPagingPage(\n resourceGroupName,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieve alert rule definitions in a subscription.\n * @param options The options parameters.\n */\n private _listBySubscription(\n options?: MetricAlertsListBySubscriptionOptionalParams,\n ): Promise<MetricAlertsListBySubscriptionResponse> {\n return this.client.sendOperationRequest(\n { options },\n listBySubscriptionOperationSpec,\n );\n }\n\n /**\n * Retrieve alert rule definitions in a resource group.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param options The options parameters.\n */\n private _listByResourceGroup(\n resourceGroupName: string,\n options?: MetricAlertsListByResourceGroupOptionalParams,\n ): Promise<MetricAlertsListByResourceGroupResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, options },\n listByResourceGroupOperationSpec,\n );\n }\n\n /**\n * Retrieve an alert rule definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n get(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsGetOptionalParams,\n ): Promise<MetricAlertsGetResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n getOperationSpec,\n );\n }\n\n /**\n * Create or update an metric alert definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param parameters The parameters of the rule to create or update.\n * @param options The options parameters.\n */\n createOrUpdate(\n resourceGroupName: string,\n ruleName: string,\n parameters: MetricAlertResource,\n options?: MetricAlertsCreateOrUpdateOptionalParams,\n ): Promise<MetricAlertsCreateOrUpdateResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, parameters, options },\n createOrUpdateOperationSpec,\n );\n }\n\n /**\n * Update an metric alert definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param parameters The parameters of the rule to update.\n * @param options The options parameters.\n */\n update(\n resourceGroupName: string,\n ruleName: string,\n parameters: MetricAlertResourcePatch,\n options?: MetricAlertsUpdateOptionalParams,\n ): Promise<MetricAlertsUpdateResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, parameters, options },\n updateOperationSpec,\n );\n }\n\n /**\n * Delete an alert rule definition.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n delete(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsDeleteOptionalParams,\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n deleteOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listBySubscriptionOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResourceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listByResourceGroupOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResourceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: Parameters.parameters4,\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst updateOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertResource,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: Parameters.parameters5,\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst deleteOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {},\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing MetricAlertsStatus operations. */
16
16
  class MetricAlertsStatusImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class MetricAlertsStatus class.
19
20
  * @param client Reference to the service client
@@ -1 +1 @@
1
- {"version":3,"file":"metricAlertsStatus.js","sourceRoot":"","sources":["../../../src/operations/metricAlertsStatus.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAStD,sDAAsD;AACtD,MAAa,sBAAsB;IAGjC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,iBAAyB,EACzB,QAAgB,EAChB,OAA8C;QAE9C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,EACxC,iBAAiB,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CACR,iBAAyB,EACzB,QAAgB,EAChB,UAAkB,EAClB,OAAoD;QAEpD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,EACpD,uBAAuB,CACxB,CAAC;IACJ,CAAC;CACF;AA9CD,wDA8CC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,gIAAgI;IACtI,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,uBAAuB,GAA6B;IACxD,IAAI,EAAE,6IAA6I;IACnJ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,UAAU;KACtB;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 { MetricAlertsStatus } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricAlertsStatusListOptionalParams,\n MetricAlertsStatusListResponse,\n MetricAlertsStatusListByNameOptionalParams,\n MetricAlertsStatusListByNameResponse,\n} from \"../models/index.js\";\n\n/** Class containing MetricAlertsStatus operations. */\nexport class MetricAlertsStatusImpl implements MetricAlertsStatus {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricAlertsStatus class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Retrieve an alert rule status.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n list(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsStatusListOptionalParams,\n ): Promise<MetricAlertsStatusListResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n listOperationSpec,\n );\n }\n\n /**\n * Retrieve an alert rule status.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param statusName The name of the status.\n * @param options The options parameters.\n */\n listByName(\n resourceGroupName: string,\n ruleName: string,\n statusName: string,\n options?: MetricAlertsStatusListByNameOptionalParams,\n ): Promise<MetricAlertsStatusListByNameResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, statusName, options },\n listByNameOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertStatusCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertStatusCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n Parameters.statusName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"metricAlertsStatus.js","sourceRoot":"","sources":["../../../src/operations/metricAlertsStatus.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAStD,sDAAsD;AACtD,MAAa,sBAAsB;IAChB,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,iBAAyB,EACzB,QAAgB,EAChB,OAA8C;QAE9C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,EACxC,iBAAiB,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CACR,iBAAyB,EACzB,QAAgB,EAChB,UAAkB,EAClB,OAAoD;QAEpD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,EACpD,uBAAuB,CACxB,CAAC;IACJ,CAAC;CACF;AA9CD,wDA8CC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,gIAAgI;IACtI,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,uBAAuB,GAA6B;IACxD,IAAI,EAAE,6IAA6I;IACnJ,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,UAAU;KACtB;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 { MetricAlertsStatus } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricAlertsStatusListOptionalParams,\n MetricAlertsStatusListResponse,\n MetricAlertsStatusListByNameOptionalParams,\n MetricAlertsStatusListByNameResponse,\n} from \"../models/index.js\";\n\n/** Class containing MetricAlertsStatus operations. */\nexport class MetricAlertsStatusImpl implements MetricAlertsStatus {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricAlertsStatus class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Retrieve an alert rule status.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param options The options parameters.\n */\n list(\n resourceGroupName: string,\n ruleName: string,\n options?: MetricAlertsStatusListOptionalParams,\n ): Promise<MetricAlertsStatusListResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, options },\n listOperationSpec,\n );\n }\n\n /**\n * Retrieve an alert rule status.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param ruleName The name of the rule.\n * @param statusName The name of the status.\n * @param options The options parameters.\n */\n listByName(\n resourceGroupName: string,\n ruleName: string,\n statusName: string,\n options?: MetricAlertsStatusListByNameOptionalParams,\n ): Promise<MetricAlertsStatusListByNameResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, ruleName, statusName, options },\n listByNameOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertStatusCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricAlertStatusCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion9],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.ruleName,\n Parameters.statusName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -15,6 +15,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /// <reference lib="esnext.asynciterable" />
16
16
  /** Class containing MetricDefinitions operations. */
17
17
  class MetricDefinitionsImpl {
18
+ client;
18
19
  /**
19
20
  * Initialize a new instance of the class MetricDefinitions class.
20
21
  * @param client Reference to the service client
@@ -37,39 +38,22 @@ class MetricDefinitionsImpl {
37
38
  return this;
38
39
  },
39
40
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
41
+ if (settings?.maxPageSize) {
41
42
  throw new Error("maxPageSize is not supported by this operation.");
42
43
  }
43
44
  return this.listAtSubscriptionScopePagingPage(region, options, settings);
44
45
  },
45
46
  };
46
47
  }
47
- listAtSubscriptionScopePagingPage(region, options, _settings) {
48
- return tslib_1.__asyncGenerator(this, arguments, function* listAtSubscriptionScopePagingPage_1() {
49
- let result;
50
- result = yield tslib_1.__await(this._listAtSubscriptionScope(region, options));
51
- yield yield tslib_1.__await(result.value || []);
52
- });
48
+ async *listAtSubscriptionScopePagingPage(region, options, _settings) {
49
+ let result;
50
+ result = await this._listAtSubscriptionScope(region, options);
51
+ yield result.value || [];
53
52
  }
54
- listAtSubscriptionScopePagingAll(region, options) {
55
- return tslib_1.__asyncGenerator(this, arguments, function* listAtSubscriptionScopePagingAll_1() {
56
- var _a, e_1, _b, _c;
57
- try {
58
- for (var _d = true, _e = tslib_1.__asyncValues(this.listAtSubscriptionScopePagingPage(region, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
59
- _c = _f.value;
60
- _d = false;
61
- const page = _c;
62
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
63
- }
64
- }
65
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
66
- finally {
67
- try {
68
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
69
- }
70
- finally { if (e_1) throw e_1.error; }
71
- }
72
- });
53
+ async *listAtSubscriptionScopePagingAll(region, options) {
54
+ for await (const page of this.listAtSubscriptionScopePagingPage(region, options)) {
55
+ yield* page;
56
+ }
73
57
  }
74
58
  /**
75
59
  * Lists the metric definitions for the resource.
@@ -86,39 +70,22 @@ class MetricDefinitionsImpl {
86
70
  return this;
87
71
  },
88
72
  byPage: (settings) => {
89
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
73
+ if (settings?.maxPageSize) {
90
74
  throw new Error("maxPageSize is not supported by this operation.");
91
75
  }
92
76
  return this.listPagingPage(resourceUri, options, settings);
93
77
  },
94
78
  };
95
79
  }
96
- listPagingPage(resourceUri, options, _settings) {
97
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
98
- let result;
99
- result = yield tslib_1.__await(this._list(resourceUri, options));
100
- yield yield tslib_1.__await(result.value || []);
101
- });
80
+ async *listPagingPage(resourceUri, options, _settings) {
81
+ let result;
82
+ result = await this._list(resourceUri, options);
83
+ yield result.value || [];
102
84
  }
103
- listPagingAll(resourceUri, options) {
104
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
105
- var _a, e_2, _b, _c;
106
- try {
107
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(resourceUri, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
108
- _c = _f.value;
109
- _d = false;
110
- const page = _c;
111
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
112
- }
113
- }
114
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
115
- finally {
116
- try {
117
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
118
- }
119
- finally { if (e_2) throw e_2.error; }
120
- }
121
- });
85
+ async *listPagingAll(resourceUri, options) {
86
+ for await (const page of this.listPagingPage(resourceUri, options)) {
87
+ yield* page;
88
+ }
122
89
  }
123
90
  /**
124
91
  * Lists the metric definitions for the subscription.
@@ -1 +1 @@
1
- {"version":3,"file":"metricDefinitions.js","sourceRoot":"","sources":["../../../src/operations/metricDefinitions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAWtD,4CAA4C;AAC5C,qDAAqD;AACrD,MAAa,qBAAqB;IAGhC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAC5B,MAAc,EACd,OAAgE;QAEhE,MAAM,IAAI,GAAG,IAAI,CAAC,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpE,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,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,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AAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,eAAe;KAC3B;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,+DAA+D;IACrE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC;IACpE,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;IACzD,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 { MetricDefinitions } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n SubscriptionScopeMetricDefinition,\n MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n MetricDefinitionsListAtSubscriptionScopeResponse,\n MetricDefinition,\n MetricDefinitionsListOptionalParams,\n MetricDefinitionsListResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricDefinitions operations. */\nexport class MetricDefinitionsImpl implements MetricDefinitions {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricDefinitions class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Lists the metric definitions for the subscription.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n public listAtSubscriptionScope(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): PagedAsyncIterableIterator<SubscriptionScopeMetricDefinition> {\n const iter = this.listAtSubscriptionScopePagingAll(region, options);\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.listAtSubscriptionScopePagingPage(\n region,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listAtSubscriptionScopePagingPage(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<SubscriptionScopeMetricDefinition[]> {\n let result: MetricDefinitionsListAtSubscriptionScopeResponse;\n result = await this._listAtSubscriptionScope(region, options);\n yield result.value || [];\n }\n\n private async *listAtSubscriptionScopePagingAll(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): AsyncIterableIterator<SubscriptionScopeMetricDefinition> {\n for await (const page of this.listAtSubscriptionScopePagingPage(\n region,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric definitions for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n public list(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): PagedAsyncIterableIterator<MetricDefinition> {\n const iter = this.listPagingAll(resourceUri, options);\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.listPagingPage(resourceUri, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricDefinition[]> {\n let result: MetricDefinitionsListResponse;\n result = await this._list(resourceUri, options);\n yield result.value || [];\n }\n\n private async *listPagingAll(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): AsyncIterableIterator<MetricDefinition> {\n for await (const page of this.listPagingPage(resourceUri, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric definitions for the subscription.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n private _listAtSubscriptionScope(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): Promise<MetricDefinitionsListAtSubscriptionScopeResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopeOperationSpec,\n );\n }\n\n /**\n * Lists the metric definitions for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n private _list(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): Promise<MetricDefinitionsListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SubscriptionScopeMetricDefinitionCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/Microsoft.Insights/metricDefinitions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricDefinitionCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponseAutoGenerated,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.metricnamespace],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"metricDefinitions.js","sourceRoot":"","sources":["../../../src/operations/metricDefinitions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAWtD,4CAA4C;AAC5C,qDAAqD;AACrD,MAAa,qBAAqB;IACf,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAC5B,MAAc,EACd,OAAgE;QAEhE,MAAM,IAAI,GAAG,IAAI,CAAC,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpE,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,iCAAiC,CAC3C,MAAM,EACN,OAAO,EACP,QAAQ,CACT,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,iCAAiC,CAC9C,MAAc,EACd,OAAgE,EAChE,SAAwB;QAExB,IAAI,MAAwD,C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OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC;IACpE,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;IACzD,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 { MetricDefinitions } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n SubscriptionScopeMetricDefinition,\n MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n MetricDefinitionsListAtSubscriptionScopeResponse,\n MetricDefinition,\n MetricDefinitionsListOptionalParams,\n MetricDefinitionsListResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricDefinitions operations. */\nexport class MetricDefinitionsImpl implements MetricDefinitions {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricDefinitions class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Lists the metric definitions for the subscription.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n public listAtSubscriptionScope(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): PagedAsyncIterableIterator<SubscriptionScopeMetricDefinition> {\n const iter = this.listAtSubscriptionScopePagingAll(region, options);\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.listAtSubscriptionScopePagingPage(\n region,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listAtSubscriptionScopePagingPage(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<SubscriptionScopeMetricDefinition[]> {\n let result: MetricDefinitionsListAtSubscriptionScopeResponse;\n result = await this._listAtSubscriptionScope(region, options);\n yield result.value || [];\n }\n\n private async *listAtSubscriptionScopePagingAll(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): AsyncIterableIterator<SubscriptionScopeMetricDefinition> {\n for await (const page of this.listAtSubscriptionScopePagingPage(\n region,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric definitions for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n public list(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): PagedAsyncIterableIterator<MetricDefinition> {\n const iter = this.listPagingAll(resourceUri, options);\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.listPagingPage(resourceUri, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricDefinition[]> {\n let result: MetricDefinitionsListResponse;\n result = await this._list(resourceUri, options);\n yield result.value || [];\n }\n\n private async *listPagingAll(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): AsyncIterableIterator<MetricDefinition> {\n for await (const page of this.listPagingPage(resourceUri, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric definitions for the subscription.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n private _listAtSubscriptionScope(\n region: string,\n options?: MetricDefinitionsListAtSubscriptionScopeOptionalParams,\n ): Promise<MetricDefinitionsListAtSubscriptionScopeResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopeOperationSpec,\n );\n }\n\n /**\n * Lists the metric definitions for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n private _list(\n resourceUri: string,\n options?: MetricDefinitionsListOptionalParams,\n ): Promise<MetricDefinitionsListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SubscriptionScopeMetricDefinitionCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/Microsoft.Insights/metricDefinitions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricDefinitionCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponseAutoGenerated,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.metricnamespace],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -15,6 +15,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /// <reference lib="esnext.asynciterable" />
16
16
  /** Class containing MetricNamespaces operations. */
17
17
  class MetricNamespacesImpl {
18
+ client;
18
19
  /**
19
20
  * Initialize a new instance of the class MetricNamespaces class.
20
21
  * @param client Reference to the service client
@@ -37,39 +38,22 @@ class MetricNamespacesImpl {
37
38
  return this;
38
39
  },
39
40
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
41
+ if (settings?.maxPageSize) {
41
42
  throw new Error("maxPageSize is not supported by this operation.");
42
43
  }
43
44
  return this.listPagingPage(resourceUri, options, settings);
44
45
  },
45
46
  };
46
47
  }
47
- listPagingPage(resourceUri, options, _settings) {
48
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
49
- let result;
50
- result = yield tslib_1.__await(this._list(resourceUri, options));
51
- yield yield tslib_1.__await(result.value || []);
52
- });
48
+ async *listPagingPage(resourceUri, options, _settings) {
49
+ let result;
50
+ result = await this._list(resourceUri, options);
51
+ yield result.value || [];
53
52
  }
54
- listPagingAll(resourceUri, options) {
55
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
56
- var _a, e_1, _b, _c;
57
- try {
58
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(resourceUri, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
59
- _c = _f.value;
60
- _d = false;
61
- const page = _c;
62
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
63
- }
64
- }
65
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
66
- finally {
67
- try {
68
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
69
- }
70
- finally { if (e_1) throw e_1.error; }
71
- }
72
- });
53
+ async *listPagingAll(resourceUri, options) {
54
+ for await (const page of this.listPagingPage(resourceUri, options)) {
55
+ yield* page;
56
+ }
73
57
  }
74
58
  /**
75
59
  * Lists the metric namespaces for the resource.
@@ -1 +1 @@
1
- {"version":3,"file":"metricNamespaces.js","sourceRoot":"","sources":["../../../src/operations/metricNamespaces.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uE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CAAC,yBAAA,sBAAA,IAAI,CAAA,CAAA,CAAA,CAAC;gBACd,CAAC;;;;;;;;;QACH,CAAC;KAAA;IAED;;;;OAIG;IACK,KAAK,CACX,WAAmB,EACnB,OAA4C;QAE5C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,OAAO,EAAE,EACxB,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF;AAtED,oDAsEC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,8DAA8D;IACpE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yBAAyB;SAC9C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC;IAC9D,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;IACzD,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 { MetricNamespaces } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricNamespace,\n MetricNamespacesListOptionalParams,\n MetricNamespacesListResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricNamespaces operations. */\nexport class MetricNamespacesImpl implements MetricNamespaces {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricNamespaces class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Lists the metric namespaces for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n public list(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): PagedAsyncIterableIterator<MetricNamespace> {\n const iter = this.listPagingAll(resourceUri, options);\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.listPagingPage(resourceUri, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricNamespace[]> {\n let result: MetricNamespacesListResponse;\n result = await this._list(resourceUri, options);\n yield result.value || [];\n }\n\n private async *listPagingAll(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): AsyncIterableIterator<MetricNamespace> {\n for await (const page of this.listPagingPage(resourceUri, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric namespaces for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n private _list(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): Promise<MetricNamespacesListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/microsoft.insights/metricNamespaces\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricNamespaceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.startTime],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"metricNamespaces.js","sourceRoot":"","sources":["../../../src/operations/metricNamespaces.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAQtD,4CAA4C;AAC5C,oDAAoD;AACpD,MAAa,oBAAoB;IACd,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,IAAI,CACT,WAAmB,EACnB,OAA4C;QAE5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACtD,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,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC7D,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,cAAc,CAC3B,WAAmB,EACnB,OAA4C,EAC5C,SAAwB;QAExB,IAAI,MAAoC,CAAC;QACzC,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEO,KAAK,CAAC,CAAC,aAAa,CAC1B,WAAmB,EACnB,OAA4C;QAE5C,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;YACnE,KAAK,CAAC,CAAC,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,KAAK,CACX,WAAmB,EACnB,OAA4C;QAE5C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,OAAO,EAAE,EACxB,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF;AAtED,oDAsEC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,8DAA8D;IACpE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yBAAyB;SAC9C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC;IAC9D,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;IACzD,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 { MetricNamespaces } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricNamespace,\n MetricNamespacesListOptionalParams,\n MetricNamespacesListResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing MetricNamespaces operations. */\nexport class MetricNamespacesImpl implements MetricNamespaces {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricNamespaces class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * Lists the metric namespaces for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n public list(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): PagedAsyncIterableIterator<MetricNamespace> {\n const iter = this.listPagingAll(resourceUri, options);\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.listPagingPage(resourceUri, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<MetricNamespace[]> {\n let result: MetricNamespacesListResponse;\n result = await this._list(resourceUri, options);\n yield result.value || [];\n }\n\n private async *listPagingAll(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): AsyncIterableIterator<MetricNamespace> {\n for await (const page of this.listPagingPage(resourceUri, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the metric namespaces for the resource.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n private _list(\n resourceUri: string,\n options?: MetricNamespacesListOptionalParams,\n ): Promise<MetricNamespacesListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/microsoft.insights/metricNamespaces\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MetricNamespaceCollection,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.startTime],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing MetricsOperations operations. */
16
16
  class MetricsOperationsImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class MetricsOperations class.
19
20
  * @param client Reference to the service client
@@ -1 +1 @@
1
- {"version":3,"file":"metricsOperations.js","sourceRoot":"","sources":["../../../src/operations/metricsOperations.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAWtD,qDAAqD;AACrD,MAAa,qBAAqB;IAGhC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CACrB,MAAc,EACd,OAAsD;QAEtD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,MAAM,EAAE,OAAO,EAAE,EACnB,oCAAoC,CACrC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,2BAA2B,CACzB,MAAc,EACd,OAA0D;QAE1D,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,MAAM,EAAE,OAAO,EAAE,EACnB,wCAAwC,CACzC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,WAAmB,EACnB,OAAmC;QAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,OAAO,EAAE,EACxB,iBAAiB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ensed 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 { MetricsOperations } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricsListAtSubscriptionScopeOptionalParams,\n MetricsListAtSubscriptionScopeResponse,\n MetricsListAtSubscriptionScopePostOptionalParams,\n MetricsListAtSubscriptionScopePostResponse,\n MetricsListOptionalParams,\n MetricsListResponse,\n} from \"../models/index.js\";\n\n/** Class containing MetricsOperations operations. */\nexport class MetricsOperationsImpl implements MetricsOperations {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricsOperations class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * **Lists the metric data for a subscription**.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n listAtSubscriptionScope(\n region: string,\n options?: MetricsListAtSubscriptionScopeOptionalParams,\n ): Promise<MetricsListAtSubscriptionScopeResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopeOperationSpec,\n );\n }\n\n /**\n * **Lists the metric data for a subscription**. Parameters can be specified on either query params or\n * the body.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n listAtSubscriptionScopePost(\n region: string,\n options?: MetricsListAtSubscriptionScopePostOptionalParams,\n ): Promise<MetricsListAtSubscriptionScopePostResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopePostOperationSpec,\n );\n }\n\n /**\n * **Lists the metric values for a resource**.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n list(\n resourceUri: string,\n options?: MetricsListOptionalParams,\n ): Promise<MetricsListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.resultType,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listAtSubscriptionScopePostOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n requestBody: Parameters.body,\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.resultType,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorResponseAutoGenerated,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n Parameters.resultType1,\n ],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"metricsOperations.js","sourceRoot":"","sources":["../../../src/operations/metricsOperations.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAWtD,qDAAqD;AACrD,MAAa,qBAAqB;IACf,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CACrB,MAAc,EACd,OAAsD;QAEtD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,MAAM,EAAE,OAAO,EAAE,EACnB,oCAAoC,CACrC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,2BAA2B,CACzB,MAAc,EACd,OAA0D;QAE1D,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,MAAM,EAAE,OAAO,EAAE,EACnB,wCAAwC,CACzC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,WAAmB,EACnB,OAAmC;QAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,OAAO,EAAE,EACxB,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF;AAxDD,sDAwDC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAA6B;IACrE,IAAI,EAAE,sEAAsE;I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AAC,mBAAmB;QAC9B,UAAU,CAAC,kBAAkB;QAC7B,UAAU,CAAC,QAAQ;KACpB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,qDAAqD;IAC3D,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,QAAQ;SAC7B;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,eAAe;QAC1B,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,mBAAmB;QAC9B,UAAU,CAAC,kBAAkB;QAC7B,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,WAAW;KACvB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC;IACzD,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 { MetricsOperations } 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 { MonitorClient } from \"../monitorClient.js\";\nimport {\n MetricsListAtSubscriptionScopeOptionalParams,\n MetricsListAtSubscriptionScopeResponse,\n MetricsListAtSubscriptionScopePostOptionalParams,\n MetricsListAtSubscriptionScopePostResponse,\n MetricsListOptionalParams,\n MetricsListResponse,\n} from \"../models/index.js\";\n\n/** Class containing MetricsOperations operations. */\nexport class MetricsOperationsImpl implements MetricsOperations {\n private readonly client: MonitorClient;\n\n /**\n * Initialize a new instance of the class MetricsOperations class.\n * @param client Reference to the service client\n */\n constructor(client: MonitorClient) {\n this.client = client;\n }\n\n /**\n * **Lists the metric data for a subscription**.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n listAtSubscriptionScope(\n region: string,\n options?: MetricsListAtSubscriptionScopeOptionalParams,\n ): Promise<MetricsListAtSubscriptionScopeResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopeOperationSpec,\n );\n }\n\n /**\n * **Lists the metric data for a subscription**. Parameters can be specified on either query params or\n * the body.\n * @param region The region where the metrics you want reside.\n * @param options The options parameters.\n */\n listAtSubscriptionScopePost(\n region: string,\n options?: MetricsListAtSubscriptionScopePostOptionalParams,\n ): Promise<MetricsListAtSubscriptionScopePostResponse> {\n return this.client.sendOperationRequest(\n { region, options },\n listAtSubscriptionScopePostOperationSpec,\n );\n }\n\n /**\n * **Lists the metric values for a resource**.\n * @param resourceUri The identifier of the resource.\n * @param options The options parameters.\n */\n list(\n resourceUri: string,\n options?: MetricsListOptionalParams,\n ): Promise<MetricsListResponse> {\n return this.client.sendOperationRequest(\n { resourceUri, options },\n listOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.resultType,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listAtSubscriptionScopePostOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorContract,\n },\n },\n requestBody: Parameters.body,\n queryParameters: [\n Parameters.apiVersion,\n Parameters.region,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.resultType,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{resourceUri}/providers/Microsoft.Insights/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Response,\n },\n default: {\n bodyMapper: Mappers.ErrorResponseAutoGenerated,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.metricnamespace,\n Parameters.timespan,\n Parameters.interval,\n Parameters.metricnames,\n Parameters.aggregation,\n Parameters.top,\n Parameters.orderby,\n Parameters.filter,\n Parameters.autoAdjustTimegrain,\n Parameters.validateDimensions,\n Parameters.rollupby,\n Parameters.resultType1,\n ],\n urlParameters: [Parameters.$host, Parameters.resourceUri],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -16,6 +16,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
16
16
  /// <reference lib="esnext.asynciterable" />
17
17
  /** Class containing MonitorOperations operations. */
18
18
  class MonitorOperationsImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class MonitorOperations class.
21
22
  * @param client Reference to the service client
@@ -37,52 +38,35 @@ class MonitorOperationsImpl {
37
38
  return this;
38
39
  },
39
40
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
41
+ if (settings?.maxPageSize) {
41
42
  throw new Error("maxPageSize is not supported by this operation.");
42
43
  }
43
44
  return this.listPagingPage(options, settings);
44
45
  },
45
46
  };
46
47
  }
47
- listPagingPage(options, settings) {
48
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
49
- let result;
50
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
51
- if (!continuationToken) {
52
- result = yield tslib_1.__await(this._list(options));
53
- let page = result.value || [];
54
- continuationToken = result.nextLink;
55
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
- yield yield tslib_1.__await(page);
57
- }
58
- while (continuationToken) {
59
- result = yield tslib_1.__await(this._listNext(continuationToken, options));
60
- continuationToken = result.nextLink;
61
- let page = result.value || [];
62
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
- yield yield tslib_1.__await(page);
64
- }
65
- });
48
+ async *listPagingPage(options, settings) {
49
+ let result;
50
+ let continuationToken = settings?.continuationToken;
51
+ if (!continuationToken) {
52
+ result = await this._list(options);
53
+ let page = result.value || [];
54
+ continuationToken = result.nextLink;
55
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
+ yield page;
57
+ }
58
+ while (continuationToken) {
59
+ result = await this._listNext(continuationToken, options);
60
+ continuationToken = result.nextLink;
61
+ let page = result.value || [];
62
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
+ yield page;
64
+ }
66
65
  }
67
- listPagingAll(options) {
68
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
69
- var _a, e_1, _b, _c;
70
- try {
71
- 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) {
72
- _c = _f.value;
73
- _d = false;
74
- const page = _c;
75
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- });
66
+ async *listPagingAll(options) {
67
+ for await (const page of this.listPagingPage(options)) {
68
+ yield* page;
69
+ }
86
70
  }
87
71
  /**
88
72
  * Lists available Operations for this Resource Provider