@azure/arm-resourcehealth 3.2.1-alpha.20230522.1 → 4.0.1-alpha.20230524.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/CHANGELOG.md +114 -1
  2. package/dist/index.js +2621 -386
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/samples-dev/availabilityStatusesGetByResourceSample.js +1 -1
  7. package/dist-esm/samples-dev/availabilityStatusesListByResourceGroupSample.js +3 -3
  8. package/dist-esm/samples-dev/availabilityStatusesListBySubscriptionIdSample.js +3 -3
  9. package/dist-esm/samples-dev/availabilityStatusesListSample.js +3 -3
  10. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js +4 -4
  11. package/dist-esm/samples-dev/childAvailabilityStatusesGetByResourceSample.js.map +1 -1
  12. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js +4 -4
  13. package/dist-esm/samples-dev/childAvailabilityStatusesListSample.js.map +1 -1
  14. package/dist-esm/samples-dev/childResourcesListSample.js +3 -3
  15. package/dist-esm/samples-dev/childResourcesListSample.js.map +1 -1
  16. package/dist-esm/samples-dev/emergingIssuesGetSample.js +3 -2
  17. package/dist-esm/samples-dev/emergingIssuesGetSample.js.map +1 -1
  18. package/dist-esm/samples-dev/emergingIssuesListSample.js +1 -1
  19. package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.js +37 -0
  22. package/dist-esm/samples-dev/eventFetchDetailsBySubscriptionIdAndTrackingIdSample.js.map +1 -0
  23. package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.js +38 -0
  26. package/dist-esm/samples-dev/eventFetchDetailsByTenantIdAndTrackingIdSample.js.map +1 -0
  27. package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.d.ts +2 -0
  28. package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.d.ts.map +1 -0
  29. package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.js +43 -0
  30. package/dist-esm/samples-dev/eventGetBySubscriptionIdAndTrackingIdSample.js.map +1 -0
  31. package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.js +44 -0
  34. package/dist-esm/samples-dev/eventGetByTenantIdAndTrackingIdSample.js.map +1 -0
  35. package/dist-esm/samples-dev/eventsListBySingleResourceSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/eventsListBySingleResourceSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/eventsListBySingleResourceSample.js +59 -0
  38. package/dist-esm/samples-dev/eventsListBySingleResourceSample.js.map +1 -0
  39. package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.js +63 -0
  42. package/dist-esm/samples-dev/eventsListBySubscriptionIdSample.js.map +1 -0
  43. package/dist-esm/samples-dev/eventsListByTenantIdSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/eventsListByTenantIdSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/eventsListByTenantIdSample.js +64 -0
  46. package/dist-esm/samples-dev/eventsListByTenantIdSample.js.map +1 -0
  47. package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.d.ts +2 -0
  48. package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.d.ts.map +1 -0
  49. package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.js +39 -0
  50. package/dist-esm/samples-dev/impactedResourcesGetByTenantIdSample.js.map +1 -0
  51. package/dist-esm/samples-dev/impactedResourcesGetSample.d.ts +2 -0
  52. package/dist-esm/samples-dev/impactedResourcesGetSample.d.ts.map +1 -0
  53. package/dist-esm/samples-dev/impactedResourcesGetSample.js +38 -0
  54. package/dist-esm/samples-dev/impactedResourcesGetSample.js.map +1 -0
  55. package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.d.ts +2 -0
  56. package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.d.ts.map +1 -0
  57. package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.js +62 -0
  58. package/dist-esm/samples-dev/impactedResourcesListBySubscriptionIdAndEventIdSample.js.map +1 -0
  59. package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.d.ts +2 -0
  60. package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.d.ts.map +1 -0
  61. package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.js +63 -0
  62. package/dist-esm/samples-dev/impactedResourcesListByTenantIdAndEventIdSample.js.map +1 -0
  63. package/dist-esm/samples-dev/metadataGetEntitySample.d.ts +2 -0
  64. package/dist-esm/samples-dev/metadataGetEntitySample.d.ts.map +1 -0
  65. package/dist-esm/samples-dev/metadataGetEntitySample.js +38 -0
  66. package/dist-esm/samples-dev/metadataGetEntitySample.js.map +1 -0
  67. package/dist-esm/samples-dev/metadataListSample.d.ts +2 -0
  68. package/dist-esm/samples-dev/metadataListSample.d.ts.map +1 -0
  69. package/dist-esm/samples-dev/metadataListSample.js +58 -0
  70. package/dist-esm/samples-dev/metadataListSample.js.map +1 -0
  71. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  72. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  73. package/dist-esm/samples-dev/operationsListSample.js +37 -0
  74. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  75. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.d.ts +2 -0
  76. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.d.ts.map +1 -0
  77. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js +58 -0
  78. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdSample.js.map +1 -0
  79. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.d.ts +2 -0
  80. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.d.ts.map +1 -0
  81. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js +59 -0
  82. package/dist-esm/samples-dev/securityAdvisoryImpactedResourcesListByTenantIdAndEventIdSample.js.map +1 -0
  83. package/dist-esm/src/microsoftResourceHealth.d.ts +8 -4
  84. package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -1
  85. package/dist-esm/src/microsoftResourceHealth.js +10 -6
  86. package/dist-esm/src/microsoftResourceHealth.js.map +1 -1
  87. package/dist-esm/src/models/index.d.ts +657 -34
  88. package/dist-esm/src/models/index.d.ts.map +1 -1
  89. package/dist-esm/src/models/index.js +114 -0
  90. package/dist-esm/src/models/index.js.map +1 -1
  91. package/dist-esm/src/models/mappers.d.ts +24 -3
  92. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  93. package/dist-esm/src/models/mappers.js +883 -100
  94. package/dist-esm/src/models/mappers.js.map +1 -1
  95. package/dist-esm/src/models/parameters.d.ts +4 -0
  96. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  97. package/dist-esm/src/models/parameters.js +51 -3
  98. package/dist-esm/src/models/parameters.js.map +1 -1
  99. package/dist-esm/src/operations/availabilityStatuses.d.ts +9 -15
  100. package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -1
  101. package/dist-esm/src/operations/availabilityStatuses.js +9 -15
  102. package/dist-esm/src/operations/availabilityStatuses.js.map +1 -1
  103. package/dist-esm/src/operations/emergingIssues.d.ts +6 -5
  104. package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -1
  105. package/dist-esm/src/operations/emergingIssues.js +15 -14
  106. package/dist-esm/src/operations/emergingIssues.js.map +1 -1
  107. package/dist-esm/src/operations/eventOperations.d.ts +39 -0
  108. package/dist-esm/src/operations/eventOperations.d.ts.map +1 -0
  109. package/dist-esm/src/operations/eventOperations.js +137 -0
  110. package/dist-esm/src/operations/eventOperations.js.map +1 -0
  111. package/dist-esm/src/operations/eventsOperations.d.ts +83 -0
  112. package/dist-esm/src/operations/eventsOperations.d.ts.map +1 -0
  113. package/dist-esm/src/operations/eventsOperations.js +393 -0
  114. package/dist-esm/src/operations/eventsOperations.js.map +1 -0
  115. package/dist-esm/src/operations/impactedResources.d.ts +72 -0
  116. package/dist-esm/src/operations/impactedResources.d.ts.map +1 -0
  117. package/dist-esm/src/operations/impactedResources.js +330 -0
  118. package/dist-esm/src/operations/impactedResources.js.map +1 -0
  119. package/dist-esm/src/operations/index.d.ts +6 -1
  120. package/dist-esm/src/operations/index.d.ts.map +1 -1
  121. package/dist-esm/src/operations/index.js +6 -1
  122. package/dist-esm/src/operations/index.js.map +1 -1
  123. package/dist-esm/src/operations/metadata.d.ts +38 -0
  124. package/dist-esm/src/operations/metadata.d.ts.map +1 -0
  125. package/dist-esm/src/operations/metadata.js +162 -0
  126. package/dist-esm/src/operations/metadata.js.map +1 -0
  127. package/dist-esm/src/operations/securityAdvisoryImpactedResources.d.ts +58 -0
  128. package/dist-esm/src/operations/securityAdvisoryImpactedResources.d.ts.map +1 -0
  129. package/dist-esm/src/operations/securityAdvisoryImpactedResources.js +271 -0
  130. package/dist-esm/src/operations/securityAdvisoryImpactedResources.js.map +1 -0
  131. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +4 -7
  132. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -1
  133. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +3 -2
  134. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -1
  135. package/dist-esm/src/operationsInterfaces/eventOperations.d.ts +31 -0
  136. package/dist-esm/src/operationsInterfaces/eventOperations.d.ts.map +1 -0
  137. package/dist-esm/src/operationsInterfaces/eventOperations.js +9 -0
  138. package/dist-esm/src/operationsInterfaces/eventOperations.js.map +1 -0
  139. package/dist-esm/src/operationsInterfaces/eventsOperations.d.ts +26 -0
  140. package/dist-esm/src/operationsInterfaces/eventsOperations.d.ts.map +1 -0
  141. package/dist-esm/src/operationsInterfaces/eventsOperations.js +9 -0
  142. package/dist-esm/src/operationsInterfaces/eventsOperations.js.map +1 -0
  143. package/dist-esm/src/operationsInterfaces/impactedResources.d.ts +32 -0
  144. package/dist-esm/src/operationsInterfaces/impactedResources.d.ts.map +1 -0
  145. package/dist-esm/src/operationsInterfaces/impactedResources.js +9 -0
  146. package/dist-esm/src/operationsInterfaces/impactedResources.js.map +1 -0
  147. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -1
  148. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  149. package/dist-esm/src/operationsInterfaces/index.js +6 -1
  150. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  151. package/dist-esm/src/operationsInterfaces/metadata.d.ts +17 -0
  152. package/dist-esm/src/operationsInterfaces/metadata.d.ts.map +1 -0
  153. package/dist-esm/src/operationsInterfaces/metadata.js +9 -0
  154. package/dist-esm/src/operationsInterfaces/metadata.js.map +1 -0
  155. package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.d.ts +18 -0
  156. package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.d.ts.map +1 -0
  157. package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.js +9 -0
  158. package/dist-esm/src/operationsInterfaces/securityAdvisoryImpactedResources.js.map +1 -0
  159. package/dist-esm/test/resourcehealth_operations_test.spec.d.ts +4 -0
  160. package/dist-esm/test/resourcehealth_operations_test.spec.d.ts.map +1 -0
  161. package/dist-esm/test/resourcehealth_operations_test.spec.js +56 -0
  162. package/dist-esm/test/resourcehealth_operations_test.spec.js.map +1 -0
  163. package/package.json +4 -4
  164. package/review/arm-resourcehealth.api.md +516 -8
  165. package/src/microsoftResourceHealth.ts +29 -8
  166. package/src/models/index.ts +757 -35
  167. package/src/models/mappers.ts +956 -101
  168. package/src/models/parameters.ts +55 -3
  169. package/src/operations/availabilityStatuses.ts +9 -15
  170. package/src/operations/emergingIssues.ts +24 -18
  171. package/src/operations/eventOperations.ts +184 -0
  172. package/src/operations/eventsOperations.ts +434 -0
  173. package/src/operations/impactedResources.ts +414 -0
  174. package/src/operations/index.ts +6 -1
  175. package/src/operations/metadata.ts +182 -0
  176. package/src/operations/securityAdvisoryImpactedResources.ts +342 -0
  177. package/src/operationsInterfaces/availabilityStatuses.ts +4 -7
  178. package/src/operationsInterfaces/emergingIssues.ts +3 -0
  179. package/src/operationsInterfaces/eventOperations.ts +60 -0
  180. package/src/operationsInterfaces/eventsOperations.ts +47 -0
  181. package/src/operationsInterfaces/impactedResources.ts +63 -0
  182. package/src/operationsInterfaces/index.ts +6 -1
  183. package/src/operationsInterfaces/metadata.ts +36 -0
  184. package/src/operationsInterfaces/securityAdvisoryImpactedResources.ts +37 -0
  185. package/types/arm-resourcehealth.d.ts +853 -23
  186. package/dist-esm/test/sampleTest.d.ts +0 -2
  187. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  188. package/dist-esm/test/sampleTest.js +0 -38
  189. package/dist-esm/test/sampleTest.js.map +0 -1
@@ -0,0 +1,414 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { ImpactedResources } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
16
+ import {
17
+ EventImpactedResource,
18
+ ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams,
19
+ ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams,
20
+ ImpactedResourcesListBySubscriptionIdAndEventIdResponse,
21
+ ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams,
22
+ ImpactedResourcesListByTenantIdAndEventIdOptionalParams,
23
+ ImpactedResourcesListByTenantIdAndEventIdResponse,
24
+ ImpactedResourcesGetOptionalParams,
25
+ ImpactedResourcesGetResponse,
26
+ ImpactedResourcesGetByTenantIdOptionalParams,
27
+ ImpactedResourcesGetByTenantIdResponse,
28
+ ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse,
29
+ ImpactedResourcesListByTenantIdAndEventIdNextResponse
30
+ } from "../models";
31
+
32
+ /// <reference lib="esnext.asynciterable" />
33
+ /** Class containing ImpactedResources operations. */
34
+ export class ImpactedResourcesImpl implements ImpactedResources {
35
+ private readonly client: MicrosoftResourceHealth;
36
+
37
+ /**
38
+ * Initialize a new instance of the class ImpactedResources class.
39
+ * @param client Reference to the service client
40
+ */
41
+ constructor(client: MicrosoftResourceHealth) {
42
+ this.client = client;
43
+ }
44
+
45
+ /**
46
+ * Lists impacted resources in the subscription by an event.
47
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
48
+ * @param options The options parameters.
49
+ */
50
+ public listBySubscriptionIdAndEventId(
51
+ eventTrackingId: string,
52
+ options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams
53
+ ): PagedAsyncIterableIterator<EventImpactedResource> {
54
+ const iter = this.listBySubscriptionIdAndEventIdPagingAll(
55
+ eventTrackingId,
56
+ options
57
+ );
58
+ return {
59
+ next() {
60
+ return iter.next();
61
+ },
62
+ [Symbol.asyncIterator]() {
63
+ return this;
64
+ },
65
+ byPage: (settings?: PageSettings) => {
66
+ if (settings?.maxPageSize) {
67
+ throw new Error("maxPageSize is not supported by this operation.");
68
+ }
69
+ return this.listBySubscriptionIdAndEventIdPagingPage(
70
+ eventTrackingId,
71
+ options,
72
+ settings
73
+ );
74
+ }
75
+ };
76
+ }
77
+
78
+ private async *listBySubscriptionIdAndEventIdPagingPage(
79
+ eventTrackingId: string,
80
+ options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams,
81
+ settings?: PageSettings
82
+ ): AsyncIterableIterator<EventImpactedResource[]> {
83
+ let result: ImpactedResourcesListBySubscriptionIdAndEventIdResponse;
84
+ let continuationToken = settings?.continuationToken;
85
+ if (!continuationToken) {
86
+ result = await this._listBySubscriptionIdAndEventId(
87
+ eventTrackingId,
88
+ options
89
+ );
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
95
+ while (continuationToken) {
96
+ result = await this._listBySubscriptionIdAndEventIdNext(
97
+ eventTrackingId,
98
+ continuationToken,
99
+ options
100
+ );
101
+ continuationToken = result.nextLink;
102
+ let page = result.value || [];
103
+ setContinuationToken(page, continuationToken);
104
+ yield page;
105
+ }
106
+ }
107
+
108
+ private async *listBySubscriptionIdAndEventIdPagingAll(
109
+ eventTrackingId: string,
110
+ options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams
111
+ ): AsyncIterableIterator<EventImpactedResource> {
112
+ for await (const page of this.listBySubscriptionIdAndEventIdPagingPage(
113
+ eventTrackingId,
114
+ options
115
+ )) {
116
+ yield* page;
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Lists impacted resources in the tenant by an event.
122
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
123
+ * @param options The options parameters.
124
+ */
125
+ public listByTenantIdAndEventId(
126
+ eventTrackingId: string,
127
+ options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams
128
+ ): PagedAsyncIterableIterator<EventImpactedResource> {
129
+ const iter = this.listByTenantIdAndEventIdPagingAll(
130
+ eventTrackingId,
131
+ options
132
+ );
133
+ return {
134
+ next() {
135
+ return iter.next();
136
+ },
137
+ [Symbol.asyncIterator]() {
138
+ return this;
139
+ },
140
+ byPage: (settings?: PageSettings) => {
141
+ if (settings?.maxPageSize) {
142
+ throw new Error("maxPageSize is not supported by this operation.");
143
+ }
144
+ return this.listByTenantIdAndEventIdPagingPage(
145
+ eventTrackingId,
146
+ options,
147
+ settings
148
+ );
149
+ }
150
+ };
151
+ }
152
+
153
+ private async *listByTenantIdAndEventIdPagingPage(
154
+ eventTrackingId: string,
155
+ options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams,
156
+ settings?: PageSettings
157
+ ): AsyncIterableIterator<EventImpactedResource[]> {
158
+ let result: ImpactedResourcesListByTenantIdAndEventIdResponse;
159
+ let continuationToken = settings?.continuationToken;
160
+ if (!continuationToken) {
161
+ result = await this._listByTenantIdAndEventId(eventTrackingId, options);
162
+ let page = result.value || [];
163
+ continuationToken = result.nextLink;
164
+ setContinuationToken(page, continuationToken);
165
+ yield page;
166
+ }
167
+ while (continuationToken) {
168
+ result = await this._listByTenantIdAndEventIdNext(
169
+ eventTrackingId,
170
+ continuationToken,
171
+ options
172
+ );
173
+ continuationToken = result.nextLink;
174
+ let page = result.value || [];
175
+ setContinuationToken(page, continuationToken);
176
+ yield page;
177
+ }
178
+ }
179
+
180
+ private async *listByTenantIdAndEventIdPagingAll(
181
+ eventTrackingId: string,
182
+ options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams
183
+ ): AsyncIterableIterator<EventImpactedResource> {
184
+ for await (const page of this.listByTenantIdAndEventIdPagingPage(
185
+ eventTrackingId,
186
+ options
187
+ )) {
188
+ yield* page;
189
+ }
190
+ }
191
+
192
+ /**
193
+ * Lists impacted resources in the subscription by an event.
194
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
195
+ * @param options The options parameters.
196
+ */
197
+ private _listBySubscriptionIdAndEventId(
198
+ eventTrackingId: string,
199
+ options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams
200
+ ): Promise<ImpactedResourcesListBySubscriptionIdAndEventIdResponse> {
201
+ return this.client.sendOperationRequest(
202
+ { eventTrackingId, options },
203
+ listBySubscriptionIdAndEventIdOperationSpec
204
+ );
205
+ }
206
+
207
+ /**
208
+ * Gets the specific impacted resource in the subscription by an event.
209
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
210
+ * @param impactedResourceName Name of the Impacted Resource.
211
+ * @param options The options parameters.
212
+ */
213
+ get(
214
+ eventTrackingId: string,
215
+ impactedResourceName: string,
216
+ options?: ImpactedResourcesGetOptionalParams
217
+ ): Promise<ImpactedResourcesGetResponse> {
218
+ return this.client.sendOperationRequest(
219
+ { eventTrackingId, impactedResourceName, options },
220
+ getOperationSpec
221
+ );
222
+ }
223
+
224
+ /**
225
+ * Lists impacted resources in the tenant by an event.
226
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
227
+ * @param options The options parameters.
228
+ */
229
+ private _listByTenantIdAndEventId(
230
+ eventTrackingId: string,
231
+ options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams
232
+ ): Promise<ImpactedResourcesListByTenantIdAndEventIdResponse> {
233
+ return this.client.sendOperationRequest(
234
+ { eventTrackingId, options },
235
+ listByTenantIdAndEventIdOperationSpec
236
+ );
237
+ }
238
+
239
+ /**
240
+ * Gets the specific impacted resource in the tenant by an event.
241
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
242
+ * @param impactedResourceName Name of the Impacted Resource.
243
+ * @param options The options parameters.
244
+ */
245
+ getByTenantId(
246
+ eventTrackingId: string,
247
+ impactedResourceName: string,
248
+ options?: ImpactedResourcesGetByTenantIdOptionalParams
249
+ ): Promise<ImpactedResourcesGetByTenantIdResponse> {
250
+ return this.client.sendOperationRequest(
251
+ { eventTrackingId, impactedResourceName, options },
252
+ getByTenantIdOperationSpec
253
+ );
254
+ }
255
+
256
+ /**
257
+ * ListBySubscriptionIdAndEventIdNext
258
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
259
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionIdAndEventId
260
+ * method.
261
+ * @param options The options parameters.
262
+ */
263
+ private _listBySubscriptionIdAndEventIdNext(
264
+ eventTrackingId: string,
265
+ nextLink: string,
266
+ options?: ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams
267
+ ): Promise<ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse> {
268
+ return this.client.sendOperationRequest(
269
+ { eventTrackingId, nextLink, options },
270
+ listBySubscriptionIdAndEventIdNextOperationSpec
271
+ );
272
+ }
273
+
274
+ /**
275
+ * ListByTenantIdAndEventIdNext
276
+ * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event.
277
+ * @param nextLink The nextLink from the previous successful call to the ListByTenantIdAndEventId
278
+ * method.
279
+ * @param options The options parameters.
280
+ */
281
+ private _listByTenantIdAndEventIdNext(
282
+ eventTrackingId: string,
283
+ nextLink: string,
284
+ options?: ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams
285
+ ): Promise<ImpactedResourcesListByTenantIdAndEventIdNextResponse> {
286
+ return this.client.sendOperationRequest(
287
+ { eventTrackingId, nextLink, options },
288
+ listByTenantIdAndEventIdNextOperationSpec
289
+ );
290
+ }
291
+ }
292
+ // Operation Specifications
293
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
294
+
295
+ const listBySubscriptionIdAndEventIdOperationSpec: coreClient.OperationSpec = {
296
+ path:
297
+ "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources",
298
+ httpMethod: "GET",
299
+ responses: {
300
+ 200: {
301
+ bodyMapper: Mappers.EventImpactedResourceListResult
302
+ },
303
+ default: {
304
+ bodyMapper: Mappers.ErrorResponse
305
+ }
306
+ },
307
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
308
+ urlParameters: [
309
+ Parameters.$host,
310
+ Parameters.subscriptionId,
311
+ Parameters.eventTrackingId
312
+ ],
313
+ headerParameters: [Parameters.accept],
314
+ serializer
315
+ };
316
+ const getOperationSpec: coreClient.OperationSpec = {
317
+ path:
318
+ "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}",
319
+ httpMethod: "GET",
320
+ responses: {
321
+ 200: {
322
+ bodyMapper: Mappers.EventImpactedResource
323
+ },
324
+ default: {
325
+ bodyMapper: Mappers.ErrorResponse
326
+ }
327
+ },
328
+ queryParameters: [Parameters.apiVersion],
329
+ urlParameters: [
330
+ Parameters.$host,
331
+ Parameters.subscriptionId,
332
+ Parameters.eventTrackingId,
333
+ Parameters.impactedResourceName
334
+ ],
335
+ headerParameters: [Parameters.accept],
336
+ serializer
337
+ };
338
+ const listByTenantIdAndEventIdOperationSpec: coreClient.OperationSpec = {
339
+ path:
340
+ "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources",
341
+ httpMethod: "GET",
342
+ responses: {
343
+ 200: {
344
+ bodyMapper: Mappers.EventImpactedResourceListResult
345
+ },
346
+ default: {
347
+ bodyMapper: Mappers.ErrorResponse
348
+ }
349
+ },
350
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
351
+ urlParameters: [Parameters.$host, Parameters.eventTrackingId],
352
+ headerParameters: [Parameters.accept],
353
+ serializer
354
+ };
355
+ const getByTenantIdOperationSpec: coreClient.OperationSpec = {
356
+ path:
357
+ "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}",
358
+ httpMethod: "GET",
359
+ responses: {
360
+ 200: {
361
+ bodyMapper: Mappers.EventImpactedResource
362
+ },
363
+ default: {
364
+ bodyMapper: Mappers.ErrorResponse
365
+ }
366
+ },
367
+ queryParameters: [Parameters.apiVersion],
368
+ urlParameters: [
369
+ Parameters.$host,
370
+ Parameters.eventTrackingId,
371
+ Parameters.impactedResourceName
372
+ ],
373
+ headerParameters: [Parameters.accept],
374
+ serializer
375
+ };
376
+ const listBySubscriptionIdAndEventIdNextOperationSpec: coreClient.OperationSpec = {
377
+ path: "{nextLink}",
378
+ httpMethod: "GET",
379
+ responses: {
380
+ 200: {
381
+ bodyMapper: Mappers.EventImpactedResourceListResult
382
+ },
383
+ default: {
384
+ bodyMapper: Mappers.ErrorResponse
385
+ }
386
+ },
387
+ urlParameters: [
388
+ Parameters.$host,
389
+ Parameters.subscriptionId,
390
+ Parameters.nextLink,
391
+ Parameters.eventTrackingId
392
+ ],
393
+ headerParameters: [Parameters.accept],
394
+ serializer
395
+ };
396
+ const listByTenantIdAndEventIdNextOperationSpec: coreClient.OperationSpec = {
397
+ path: "{nextLink}",
398
+ httpMethod: "GET",
399
+ responses: {
400
+ 200: {
401
+ bodyMapper: Mappers.EventImpactedResourceListResult
402
+ },
403
+ default: {
404
+ bodyMapper: Mappers.ErrorResponse
405
+ }
406
+ },
407
+ urlParameters: [
408
+ Parameters.$host,
409
+ Parameters.nextLink,
410
+ Parameters.eventTrackingId
411
+ ],
412
+ headerParameters: [Parameters.accept],
413
+ serializer
414
+ };
@@ -7,7 +7,12 @@
7
7
  */
8
8
 
9
9
  export * from "./availabilityStatuses";
10
+ export * from "./operations";
11
+ export * from "./metadata";
12
+ export * from "./impactedResources";
13
+ export * from "./securityAdvisoryImpactedResources";
14
+ export * from "./eventsOperations";
15
+ export * from "./eventOperations";
10
16
  export * from "./childAvailabilityStatuses";
11
17
  export * from "./childResources";
12
- export * from "./operations";
13
18
  export * from "./emergingIssues";
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { Metadata } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { MicrosoftResourceHealth } from "../microsoftResourceHealth";
16
+ import {
17
+ MetadataEntity,
18
+ MetadataListNextOptionalParams,
19
+ MetadataListOptionalParams,
20
+ MetadataListResponse,
21
+ MetadataGetEntityOptionalParams,
22
+ MetadataGetEntityResponse,
23
+ MetadataListNextResponse
24
+ } from "../models";
25
+
26
+ /// <reference lib="esnext.asynciterable" />
27
+ /** Class containing Metadata operations. */
28
+ export class MetadataImpl implements Metadata {
29
+ private readonly client: MicrosoftResourceHealth;
30
+
31
+ /**
32
+ * Initialize a new instance of the class Metadata class.
33
+ * @param client Reference to the service client
34
+ */
35
+ constructor(client: MicrosoftResourceHealth) {
36
+ this.client = client;
37
+ }
38
+
39
+ /**
40
+ * Gets the list of metadata entities.
41
+ * @param options The options parameters.
42
+ */
43
+ public list(
44
+ options?: MetadataListOptionalParams
45
+ ): PagedAsyncIterableIterator<MetadataEntity> {
46
+ const iter = this.listPagingAll(options);
47
+ return {
48
+ next() {
49
+ return iter.next();
50
+ },
51
+ [Symbol.asyncIterator]() {
52
+ return this;
53
+ },
54
+ byPage: (settings?: PageSettings) => {
55
+ if (settings?.maxPageSize) {
56
+ throw new Error("maxPageSize is not supported by this operation.");
57
+ }
58
+ return this.listPagingPage(options, settings);
59
+ }
60
+ };
61
+ }
62
+
63
+ private async *listPagingPage(
64
+ options?: MetadataListOptionalParams,
65
+ settings?: PageSettings
66
+ ): AsyncIterableIterator<MetadataEntity[]> {
67
+ let result: MetadataListResponse;
68
+ let continuationToken = settings?.continuationToken;
69
+ if (!continuationToken) {
70
+ result = await this._list(options);
71
+ let page = result.value || [];
72
+ continuationToken = result.nextLink;
73
+ setContinuationToken(page, continuationToken);
74
+ yield page;
75
+ }
76
+ while (continuationToken) {
77
+ result = await this._listNext(continuationToken, options);
78
+ continuationToken = result.nextLink;
79
+ let page = result.value || [];
80
+ setContinuationToken(page, continuationToken);
81
+ yield page;
82
+ }
83
+ }
84
+
85
+ private async *listPagingAll(
86
+ options?: MetadataListOptionalParams
87
+ ): AsyncIterableIterator<MetadataEntity> {
88
+ for await (const page of this.listPagingPage(options)) {
89
+ yield* page;
90
+ }
91
+ }
92
+
93
+ /**
94
+ * Gets the list of metadata entities.
95
+ * @param options The options parameters.
96
+ */
97
+ private _list(
98
+ options?: MetadataListOptionalParams
99
+ ): Promise<MetadataListResponse> {
100
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
101
+ }
102
+
103
+ /**
104
+ * Gets the list of metadata entities.
105
+ * @param name Name of metadata entity.
106
+ * @param options The options parameters.
107
+ */
108
+ getEntity(
109
+ name: string,
110
+ options?: MetadataGetEntityOptionalParams
111
+ ): Promise<MetadataGetEntityResponse> {
112
+ return this.client.sendOperationRequest(
113
+ { name, options },
114
+ getEntityOperationSpec
115
+ );
116
+ }
117
+
118
+ /**
119
+ * ListNext
120
+ * @param nextLink The nextLink from the previous successful call to the List method.
121
+ * @param options The options parameters.
122
+ */
123
+ private _listNext(
124
+ nextLink: string,
125
+ options?: MetadataListNextOptionalParams
126
+ ): Promise<MetadataListNextResponse> {
127
+ return this.client.sendOperationRequest(
128
+ { nextLink, options },
129
+ listNextOperationSpec
130
+ );
131
+ }
132
+ }
133
+ // Operation Specifications
134
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
135
+
136
+ const listOperationSpec: coreClient.OperationSpec = {
137
+ path: "/providers/Microsoft.ResourceHealth/metadata",
138
+ httpMethod: "GET",
139
+ responses: {
140
+ 200: {
141
+ bodyMapper: Mappers.MetadataEntityListResult
142
+ },
143
+ default: {
144
+ bodyMapper: Mappers.ErrorResponse
145
+ }
146
+ },
147
+ queryParameters: [Parameters.apiVersion],
148
+ urlParameters: [Parameters.$host],
149
+ headerParameters: [Parameters.accept],
150
+ serializer
151
+ };
152
+ const getEntityOperationSpec: coreClient.OperationSpec = {
153
+ path: "/providers/Microsoft.ResourceHealth/metadata/{name}",
154
+ httpMethod: "GET",
155
+ responses: {
156
+ 200: {
157
+ bodyMapper: Mappers.MetadataEntity
158
+ },
159
+ default: {
160
+ bodyMapper: Mappers.ErrorResponse
161
+ }
162
+ },
163
+ queryParameters: [Parameters.apiVersion],
164
+ urlParameters: [Parameters.$host, Parameters.name],
165
+ headerParameters: [Parameters.accept],
166
+ serializer
167
+ };
168
+ const listNextOperationSpec: coreClient.OperationSpec = {
169
+ path: "{nextLink}",
170
+ httpMethod: "GET",
171
+ responses: {
172
+ 200: {
173
+ bodyMapper: Mappers.MetadataEntityListResult
174
+ },
175
+ default: {
176
+ bodyMapper: Mappers.ErrorResponse
177
+ }
178
+ },
179
+ urlParameters: [Parameters.$host, Parameters.nextLink],
180
+ headerParameters: [Parameters.accept],
181
+ serializer
182
+ };