@azure/arm-resourcehealth 3.2.1-alpha.20230522.1 → 4.0.0

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 +111 -8
  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 +6 -6
  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,434 @@
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 { EventsOperations } 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
+ Event,
18
+ EventsListBySubscriptionIdNextOptionalParams,
19
+ EventsListBySubscriptionIdOptionalParams,
20
+ EventsListBySubscriptionIdResponse,
21
+ EventsListByTenantIdNextOptionalParams,
22
+ EventsListByTenantIdOptionalParams,
23
+ EventsListByTenantIdResponse,
24
+ EventsListBySingleResourceNextOptionalParams,
25
+ EventsListBySingleResourceOptionalParams,
26
+ EventsListBySingleResourceResponse,
27
+ EventsListBySubscriptionIdNextResponse,
28
+ EventsListByTenantIdNextResponse,
29
+ EventsListBySingleResourceNextResponse
30
+ } from "../models";
31
+
32
+ /// <reference lib="esnext.asynciterable" />
33
+ /** Class containing EventsOperations operations. */
34
+ export class EventsOperationsImpl implements EventsOperations {
35
+ private readonly client: MicrosoftResourceHealth;
36
+
37
+ /**
38
+ * Initialize a new instance of the class EventsOperations class.
39
+ * @param client Reference to the service client
40
+ */
41
+ constructor(client: MicrosoftResourceHealth) {
42
+ this.client = client;
43
+ }
44
+
45
+ /**
46
+ * Lists service health events in the subscription.
47
+ * @param options The options parameters.
48
+ */
49
+ public listBySubscriptionId(
50
+ options?: EventsListBySubscriptionIdOptionalParams
51
+ ): PagedAsyncIterableIterator<Event> {
52
+ const iter = this.listBySubscriptionIdPagingAll(options);
53
+ return {
54
+ next() {
55
+ return iter.next();
56
+ },
57
+ [Symbol.asyncIterator]() {
58
+ return this;
59
+ },
60
+ byPage: (settings?: PageSettings) => {
61
+ if (settings?.maxPageSize) {
62
+ throw new Error("maxPageSize is not supported by this operation.");
63
+ }
64
+ return this.listBySubscriptionIdPagingPage(options, settings);
65
+ }
66
+ };
67
+ }
68
+
69
+ private async *listBySubscriptionIdPagingPage(
70
+ options?: EventsListBySubscriptionIdOptionalParams,
71
+ settings?: PageSettings
72
+ ): AsyncIterableIterator<Event[]> {
73
+ let result: EventsListBySubscriptionIdResponse;
74
+ let continuationToken = settings?.continuationToken;
75
+ if (!continuationToken) {
76
+ result = await this._listBySubscriptionId(options);
77
+ let page = result.value || [];
78
+ continuationToken = result.nextLink;
79
+ setContinuationToken(page, continuationToken);
80
+ yield page;
81
+ }
82
+ while (continuationToken) {
83
+ result = await this._listBySubscriptionIdNext(continuationToken, options);
84
+ continuationToken = result.nextLink;
85
+ let page = result.value || [];
86
+ setContinuationToken(page, continuationToken);
87
+ yield page;
88
+ }
89
+ }
90
+
91
+ private async *listBySubscriptionIdPagingAll(
92
+ options?: EventsListBySubscriptionIdOptionalParams
93
+ ): AsyncIterableIterator<Event> {
94
+ for await (const page of this.listBySubscriptionIdPagingPage(options)) {
95
+ yield* page;
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Lists current service health events in the tenant.
101
+ * @param options The options parameters.
102
+ */
103
+ public listByTenantId(
104
+ options?: EventsListByTenantIdOptionalParams
105
+ ): PagedAsyncIterableIterator<Event> {
106
+ const iter = this.listByTenantIdPagingAll(options);
107
+ return {
108
+ next() {
109
+ return iter.next();
110
+ },
111
+ [Symbol.asyncIterator]() {
112
+ return this;
113
+ },
114
+ byPage: (settings?: PageSettings) => {
115
+ if (settings?.maxPageSize) {
116
+ throw new Error("maxPageSize is not supported by this operation.");
117
+ }
118
+ return this.listByTenantIdPagingPage(options, settings);
119
+ }
120
+ };
121
+ }
122
+
123
+ private async *listByTenantIdPagingPage(
124
+ options?: EventsListByTenantIdOptionalParams,
125
+ settings?: PageSettings
126
+ ): AsyncIterableIterator<Event[]> {
127
+ let result: EventsListByTenantIdResponse;
128
+ let continuationToken = settings?.continuationToken;
129
+ if (!continuationToken) {
130
+ result = await this._listByTenantId(options);
131
+ let page = result.value || [];
132
+ continuationToken = result.nextLink;
133
+ setContinuationToken(page, continuationToken);
134
+ yield page;
135
+ }
136
+ while (continuationToken) {
137
+ result = await this._listByTenantIdNext(continuationToken, options);
138
+ continuationToken = result.nextLink;
139
+ let page = result.value || [];
140
+ setContinuationToken(page, continuationToken);
141
+ yield page;
142
+ }
143
+ }
144
+
145
+ private async *listByTenantIdPagingAll(
146
+ options?: EventsListByTenantIdOptionalParams
147
+ ): AsyncIterableIterator<Event> {
148
+ for await (const page of this.listByTenantIdPagingPage(options)) {
149
+ yield* page;
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Lists current service health events for given resource.
155
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
156
+ * type. Currently the API support not nested and one nesting level resource types :
157
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
158
+ * and
159
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
160
+ * @param options The options parameters.
161
+ */
162
+ public listBySingleResource(
163
+ resourceUri: string,
164
+ options?: EventsListBySingleResourceOptionalParams
165
+ ): PagedAsyncIterableIterator<Event> {
166
+ const iter = this.listBySingleResourcePagingAll(resourceUri, options);
167
+ return {
168
+ next() {
169
+ return iter.next();
170
+ },
171
+ [Symbol.asyncIterator]() {
172
+ return this;
173
+ },
174
+ byPage: (settings?: PageSettings) => {
175
+ if (settings?.maxPageSize) {
176
+ throw new Error("maxPageSize is not supported by this operation.");
177
+ }
178
+ return this.listBySingleResourcePagingPage(
179
+ resourceUri,
180
+ options,
181
+ settings
182
+ );
183
+ }
184
+ };
185
+ }
186
+
187
+ private async *listBySingleResourcePagingPage(
188
+ resourceUri: string,
189
+ options?: EventsListBySingleResourceOptionalParams,
190
+ settings?: PageSettings
191
+ ): AsyncIterableIterator<Event[]> {
192
+ let result: EventsListBySingleResourceResponse;
193
+ let continuationToken = settings?.continuationToken;
194
+ if (!continuationToken) {
195
+ result = await this._listBySingleResource(resourceUri, options);
196
+ let page = result.value || [];
197
+ continuationToken = result.nextLink;
198
+ setContinuationToken(page, continuationToken);
199
+ yield page;
200
+ }
201
+ while (continuationToken) {
202
+ result = await this._listBySingleResourceNext(
203
+ resourceUri,
204
+ continuationToken,
205
+ options
206
+ );
207
+ continuationToken = result.nextLink;
208
+ let page = result.value || [];
209
+ setContinuationToken(page, continuationToken);
210
+ yield page;
211
+ }
212
+ }
213
+
214
+ private async *listBySingleResourcePagingAll(
215
+ resourceUri: string,
216
+ options?: EventsListBySingleResourceOptionalParams
217
+ ): AsyncIterableIterator<Event> {
218
+ for await (const page of this.listBySingleResourcePagingPage(
219
+ resourceUri,
220
+ options
221
+ )) {
222
+ yield* page;
223
+ }
224
+ }
225
+
226
+ /**
227
+ * Lists service health events in the subscription.
228
+ * @param options The options parameters.
229
+ */
230
+ private _listBySubscriptionId(
231
+ options?: EventsListBySubscriptionIdOptionalParams
232
+ ): Promise<EventsListBySubscriptionIdResponse> {
233
+ return this.client.sendOperationRequest(
234
+ { options },
235
+ listBySubscriptionIdOperationSpec
236
+ );
237
+ }
238
+
239
+ /**
240
+ * Lists current service health events in the tenant.
241
+ * @param options The options parameters.
242
+ */
243
+ private _listByTenantId(
244
+ options?: EventsListByTenantIdOptionalParams
245
+ ): Promise<EventsListByTenantIdResponse> {
246
+ return this.client.sendOperationRequest(
247
+ { options },
248
+ listByTenantIdOperationSpec
249
+ );
250
+ }
251
+
252
+ /**
253
+ * Lists current service health events for given resource.
254
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
255
+ * type. Currently the API support not nested and one nesting level resource types :
256
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
257
+ * and
258
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
259
+ * @param options The options parameters.
260
+ */
261
+ private _listBySingleResource(
262
+ resourceUri: string,
263
+ options?: EventsListBySingleResourceOptionalParams
264
+ ): Promise<EventsListBySingleResourceResponse> {
265
+ return this.client.sendOperationRequest(
266
+ { resourceUri, options },
267
+ listBySingleResourceOperationSpec
268
+ );
269
+ }
270
+
271
+ /**
272
+ * ListBySubscriptionIdNext
273
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method.
274
+ * @param options The options parameters.
275
+ */
276
+ private _listBySubscriptionIdNext(
277
+ nextLink: string,
278
+ options?: EventsListBySubscriptionIdNextOptionalParams
279
+ ): Promise<EventsListBySubscriptionIdNextResponse> {
280
+ return this.client.sendOperationRequest(
281
+ { nextLink, options },
282
+ listBySubscriptionIdNextOperationSpec
283
+ );
284
+ }
285
+
286
+ /**
287
+ * ListByTenantIdNext
288
+ * @param nextLink The nextLink from the previous successful call to the ListByTenantId method.
289
+ * @param options The options parameters.
290
+ */
291
+ private _listByTenantIdNext(
292
+ nextLink: string,
293
+ options?: EventsListByTenantIdNextOptionalParams
294
+ ): Promise<EventsListByTenantIdNextResponse> {
295
+ return this.client.sendOperationRequest(
296
+ { nextLink, options },
297
+ listByTenantIdNextOperationSpec
298
+ );
299
+ }
300
+
301
+ /**
302
+ * ListBySingleResourceNext
303
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
304
+ * type. Currently the API support not nested and one nesting level resource types :
305
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
306
+ * and
307
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
308
+ * @param nextLink The nextLink from the previous successful call to the ListBySingleResource method.
309
+ * @param options The options parameters.
310
+ */
311
+ private _listBySingleResourceNext(
312
+ resourceUri: string,
313
+ nextLink: string,
314
+ options?: EventsListBySingleResourceNextOptionalParams
315
+ ): Promise<EventsListBySingleResourceNextResponse> {
316
+ return this.client.sendOperationRequest(
317
+ { resourceUri, nextLink, options },
318
+ listBySingleResourceNextOperationSpec
319
+ );
320
+ }
321
+ }
322
+ // Operation Specifications
323
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
324
+
325
+ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = {
326
+ path:
327
+ "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events",
328
+ httpMethod: "GET",
329
+ responses: {
330
+ 200: {
331
+ bodyMapper: Mappers.Events
332
+ },
333
+ default: {
334
+ bodyMapper: Mappers.ErrorResponse
335
+ }
336
+ },
337
+ queryParameters: [
338
+ Parameters.apiVersion,
339
+ Parameters.filter,
340
+ Parameters.queryStartTime
341
+ ],
342
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
343
+ headerParameters: [Parameters.accept],
344
+ serializer
345
+ };
346
+ const listByTenantIdOperationSpec: coreClient.OperationSpec = {
347
+ path: "/providers/Microsoft.ResourceHealth/events",
348
+ httpMethod: "GET",
349
+ responses: {
350
+ 200: {
351
+ bodyMapper: Mappers.Events
352
+ },
353
+ default: {
354
+ bodyMapper: Mappers.ErrorResponse
355
+ }
356
+ },
357
+ queryParameters: [
358
+ Parameters.apiVersion,
359
+ Parameters.filter,
360
+ Parameters.queryStartTime
361
+ ],
362
+ urlParameters: [Parameters.$host],
363
+ headerParameters: [Parameters.accept],
364
+ serializer
365
+ };
366
+ const listBySingleResourceOperationSpec: coreClient.OperationSpec = {
367
+ path: "/{resourceUri}/providers/Microsoft.ResourceHealth/events",
368
+ httpMethod: "GET",
369
+ responses: {
370
+ 200: {
371
+ bodyMapper: Mappers.Events
372
+ },
373
+ default: {
374
+ bodyMapper: Mappers.ErrorResponse
375
+ }
376
+ },
377
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
378
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
379
+ headerParameters: [Parameters.accept],
380
+ serializer
381
+ };
382
+ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = {
383
+ path: "{nextLink}",
384
+ httpMethod: "GET",
385
+ responses: {
386
+ 200: {
387
+ bodyMapper: Mappers.Events
388
+ },
389
+ default: {
390
+ bodyMapper: Mappers.ErrorResponse
391
+ }
392
+ },
393
+ urlParameters: [
394
+ Parameters.$host,
395
+ Parameters.subscriptionId,
396
+ Parameters.nextLink
397
+ ],
398
+ headerParameters: [Parameters.accept],
399
+ serializer
400
+ };
401
+ const listByTenantIdNextOperationSpec: coreClient.OperationSpec = {
402
+ path: "{nextLink}",
403
+ httpMethod: "GET",
404
+ responses: {
405
+ 200: {
406
+ bodyMapper: Mappers.Events
407
+ },
408
+ default: {
409
+ bodyMapper: Mappers.ErrorResponse
410
+ }
411
+ },
412
+ urlParameters: [Parameters.$host, Parameters.nextLink],
413
+ headerParameters: [Parameters.accept],
414
+ serializer
415
+ };
416
+ const listBySingleResourceNextOperationSpec: coreClient.OperationSpec = {
417
+ path: "{nextLink}",
418
+ httpMethod: "GET",
419
+ responses: {
420
+ 200: {
421
+ bodyMapper: Mappers.Events
422
+ },
423
+ default: {
424
+ bodyMapper: Mappers.ErrorResponse
425
+ }
426
+ },
427
+ urlParameters: [
428
+ Parameters.$host,
429
+ Parameters.resourceUri,
430
+ Parameters.nextLink
431
+ ],
432
+ headerParameters: [Parameters.accept],
433
+ serializer
434
+ };