@azure/arm-resourcehealth 1.1.0 → 3.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{LICENSE.txt → LICENSE} +21 -21
  3. package/README.md +98 -100
  4. package/dist/index.js +1811 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +6 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +13 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/microsoftResourceHealth.d.ts +20 -0
  13. package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -0
  14. package/dist-esm/src/microsoftResourceHealth.js +27 -0
  15. package/dist-esm/src/microsoftResourceHealth.js.map +1 -0
  16. package/dist-esm/src/microsoftResourceHealthContext.d.ts +17 -0
  17. package/dist-esm/src/microsoftResourceHealthContext.d.ts.map +1 -0
  18. package/dist-esm/src/microsoftResourceHealthContext.js +50 -0
  19. package/dist-esm/src/microsoftResourceHealthContext.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +402 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +22 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +21 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/models/mappers.js +393 -170
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +12 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/{esm → dist-esm/src}/models/parameters.js +52 -36
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/availabilityStatuses.d.ts +102 -0
  33. package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -0
  34. package/dist-esm/src/operations/availabilityStatuses.js +407 -0
  35. package/dist-esm/src/operations/availabilityStatuses.js.map +1 -0
  36. package/dist-esm/src/operations/childAvailabilityStatuses.d.ts +51 -0
  37. package/dist-esm/src/operations/childAvailabilityStatuses.d.ts.map +1 -0
  38. package/dist-esm/src/operations/childAvailabilityStatuses.js +173 -0
  39. package/dist-esm/src/operations/childAvailabilityStatuses.js.map +1 -0
  40. package/dist-esm/src/operations/childResources.d.ts +43 -0
  41. package/dist-esm/src/operations/childResources.d.ts.map +1 -0
  42. package/dist-esm/src/operations/childResources.js +143 -0
  43. package/dist-esm/src/operations/childResources.js.map +1 -0
  44. package/dist-esm/src/operations/emergingIssues.d.ts +37 -0
  45. package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -0
  46. package/dist-esm/src/operations/emergingIssues.js +143 -0
  47. package/dist-esm/src/operations/emergingIssues.js.map +1 -0
  48. package/dist-esm/src/operations/index.d.ts +6 -0
  49. package/dist-esm/src/operations/index.d.ts.map +1 -0
  50. package/dist-esm/src/operations/index.js +13 -0
  51. package/dist-esm/src/operations/index.js.map +1 -0
  52. package/dist-esm/src/operations/operations.d.ts +18 -0
  53. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  54. package/dist-esm/src/operations/operations.js +46 -0
  55. package/dist-esm/src/operations/operations.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +40 -0
  57. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/availabilityStatuses.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/availabilityStatuses.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts +23 -0
  61. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/childResources.d.ts +15 -0
  65. package/dist-esm/src/operationsInterfaces/childResources.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/childResources.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/childResources.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +16 -0
  69. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/emergingIssues.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/emergingIssues.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  73. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  75. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/operations.d.ts +10 -0
  77. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  80. package/dist-esm/test/sampleTest.d.ts +2 -0
  81. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  82. package/dist-esm/test/sampleTest.js +40 -0
  83. package/dist-esm/test/sampleTest.js.map +1 -0
  84. package/package.json +68 -34
  85. package/review/arm-resourcehealth.api.md +396 -0
  86. package/rollup.config.js +184 -27
  87. package/src/index.ts +13 -0
  88. package/src/microsoftResourceHealth.ts +53 -0
  89. package/src/microsoftResourceHealthContext.ts +71 -0
  90. package/src/models/index.ts +478 -0
  91. package/{lib → src}/models/mappers.ts +409 -175
  92. package/src/models/parameters.ts +127 -0
  93. package/src/operations/availabilityStatuses.ts +479 -0
  94. package/src/operations/childAvailabilityStatuses.ts +210 -0
  95. package/src/operations/childResources.ts +168 -0
  96. package/src/operations/emergingIssues.ts +165 -0
  97. package/src/operations/index.ts +13 -0
  98. package/src/operations/operations.ts +59 -0
  99. package/src/operationsInterfaces/availabilityStatuses.ts +67 -0
  100. package/src/operationsInterfaces/childAvailabilityStatuses.ts +43 -0
  101. package/src/operationsInterfaces/childResources.ts +30 -0
  102. package/src/operationsInterfaces/emergingIssues.ts +34 -0
  103. package/src/operationsInterfaces/index.ts +13 -0
  104. package/src/operationsInterfaces/operations.ts +21 -0
  105. package/tsconfig.json +4 -4
  106. package/types/arm-resourcehealth.d.ts +588 -0
  107. package/types/tsdoc-metadata.json +11 -0
  108. package/dist/arm-resourcehealth.js +0 -1037
  109. package/dist/arm-resourcehealth.js.map +0 -1
  110. package/dist/arm-resourcehealth.min.js +0 -1
  111. package/dist/arm-resourcehealth.min.js.map +0 -1
  112. package/esm/microsoftResourceHealth.d.ts +0 -20
  113. package/esm/microsoftResourceHealth.d.ts.map +0 -1
  114. package/esm/microsoftResourceHealth.js +0 -35
  115. package/esm/microsoftResourceHealth.js.map +0 -1
  116. package/esm/microsoftResourceHealthContext.d.ts +0 -17
  117. package/esm/microsoftResourceHealthContext.d.ts.map +0 -1
  118. package/esm/microsoftResourceHealthContext.js +0 -57
  119. package/esm/microsoftResourceHealthContext.js.map +0 -1
  120. package/esm/models/availabilityStatusesMappers.d.ts +0 -2
  121. package/esm/models/availabilityStatusesMappers.d.ts.map +0 -1
  122. package/esm/models/availabilityStatusesMappers.js +0 -11
  123. package/esm/models/availabilityStatusesMappers.js.map +0 -1
  124. package/esm/models/index.d.ts +0 -589
  125. package/esm/models/index.d.ts.map +0 -1
  126. package/esm/models/index.js +0 -10
  127. package/esm/models/index.js.map +0 -1
  128. package/esm/models/mappers.d.ts +0 -16
  129. package/esm/models/mappers.d.ts.map +0 -1
  130. package/esm/models/mappers.js.map +0 -1
  131. package/esm/models/operationsMappers.d.ts +0 -2
  132. package/esm/models/operationsMappers.d.ts.map +0 -1
  133. package/esm/models/operationsMappers.js +0 -11
  134. package/esm/models/operationsMappers.js.map +0 -1
  135. package/esm/models/parameters.d.ts +0 -10
  136. package/esm/models/parameters.d.ts.map +0 -1
  137. package/esm/models/parameters.js.map +0 -1
  138. package/esm/operations/availabilityStatuses.d.ts +0 -166
  139. package/esm/operations/availabilityStatuses.d.ts.map +0 -1
  140. package/esm/operations/availabilityStatuses.js +0 -225
  141. package/esm/operations/availabilityStatuses.js.map +0 -1
  142. package/esm/operations/index.d.ts +0 -3
  143. package/esm/operations/index.d.ts.map +0 -1
  144. package/esm/operations/index.js +0 -12
  145. package/esm/operations/index.js.map +0 -1
  146. package/esm/operations/operations.d.ts +0 -28
  147. package/esm/operations/operations.d.ts.map +0 -1
  148. package/esm/operations/operations.js +0 -51
  149. package/esm/operations/operations.js.map +0 -1
  150. package/lib/microsoftResourceHealth.ts +0 -45
  151. package/lib/microsoftResourceHealthContext.ts +0 -63
  152. package/lib/models/availabilityStatusesMappers.ts +0 -22
  153. package/lib/models/index.ts +0 -628
  154. package/lib/models/operationsMappers.ts +0 -17
  155. package/lib/models/parameters.ts +0 -98
  156. package/lib/operations/availabilityStatuses.ts +0 -416
  157. package/lib/operations/index.ts +0 -12
  158. package/lib/operations/operations.ts +0 -74
@@ -0,0 +1,210 @@
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 } from "@azure/core-paging";
10
+ import { ChildAvailabilityStatuses } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
15
+ import {
16
+ AvailabilityStatus,
17
+ ChildAvailabilityStatusesListNextOptionalParams,
18
+ ChildAvailabilityStatusesListOptionalParams,
19
+ ChildAvailabilityStatusesGetByResourceOptionalParams,
20
+ ChildAvailabilityStatusesGetByResourceResponse,
21
+ ChildAvailabilityStatusesListResponse,
22
+ ChildAvailabilityStatusesListNextResponse
23
+ } from "../models";
24
+
25
+ /// <reference lib="esnext.asynciterable" />
26
+ /** Class containing ChildAvailabilityStatuses operations. */
27
+ export class ChildAvailabilityStatusesImpl
28
+ implements ChildAvailabilityStatuses {
29
+ private readonly client: MicrosoftResourceHealthContext;
30
+
31
+ /**
32
+ * Initialize a new instance of the class ChildAvailabilityStatuses class.
33
+ * @param client Reference to the service client
34
+ */
35
+ constructor(client: MicrosoftResourceHealthContext) {
36
+ this.client = client;
37
+ }
38
+
39
+ /**
40
+ * Lists the historical availability statuses for a single child resource. Use the nextLink property in
41
+ * the response to get the next page of availability status
42
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
43
+ * type. Currently the API only support one nesting level resource types :
44
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
45
+ * @param options The options parameters.
46
+ */
47
+ public list(
48
+ resourceUri: string,
49
+ options?: ChildAvailabilityStatusesListOptionalParams
50
+ ): PagedAsyncIterableIterator<AvailabilityStatus> {
51
+ const iter = this.listPagingAll(resourceUri, options);
52
+ return {
53
+ next() {
54
+ return iter.next();
55
+ },
56
+ [Symbol.asyncIterator]() {
57
+ return this;
58
+ },
59
+ byPage: () => {
60
+ return this.listPagingPage(resourceUri, options);
61
+ }
62
+ };
63
+ }
64
+
65
+ private async *listPagingPage(
66
+ resourceUri: string,
67
+ options?: ChildAvailabilityStatusesListOptionalParams
68
+ ): AsyncIterableIterator<AvailabilityStatus[]> {
69
+ let result = await this._list(resourceUri, options);
70
+ yield result.value || [];
71
+ let continuationToken = result.nextLink;
72
+ while (continuationToken) {
73
+ result = await this._listNext(resourceUri, continuationToken, options);
74
+ continuationToken = result.nextLink;
75
+ yield result.value || [];
76
+ }
77
+ }
78
+
79
+ private async *listPagingAll(
80
+ resourceUri: string,
81
+ options?: ChildAvailabilityStatusesListOptionalParams
82
+ ): AsyncIterableIterator<AvailabilityStatus> {
83
+ for await (const page of this.listPagingPage(resourceUri, options)) {
84
+ yield* page;
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Gets current availability status for a single resource
90
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
91
+ * type. Currently the API only support one nesting level resource types :
92
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
93
+ * @param options The options parameters.
94
+ */
95
+ getByResource(
96
+ resourceUri: string,
97
+ options?: ChildAvailabilityStatusesGetByResourceOptionalParams
98
+ ): Promise<ChildAvailabilityStatusesGetByResourceResponse> {
99
+ return this.client.sendOperationRequest(
100
+ { resourceUri, options },
101
+ getByResourceOperationSpec
102
+ );
103
+ }
104
+
105
+ /**
106
+ * Lists the historical availability statuses for a single child resource. Use the nextLink property in
107
+ * the response to get the next page of availability status
108
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
109
+ * type. Currently the API only support one nesting level resource types :
110
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
111
+ * @param options The options parameters.
112
+ */
113
+ private _list(
114
+ resourceUri: string,
115
+ options?: ChildAvailabilityStatusesListOptionalParams
116
+ ): Promise<ChildAvailabilityStatusesListResponse> {
117
+ return this.client.sendOperationRequest(
118
+ { resourceUri, options },
119
+ listOperationSpec
120
+ );
121
+ }
122
+
123
+ /**
124
+ * ListNext
125
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
126
+ * type. Currently the API only support one nesting level resource types :
127
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
128
+ * @param nextLink The nextLink from the previous successful call to the List method.
129
+ * @param options The options parameters.
130
+ */
131
+ private _listNext(
132
+ resourceUri: string,
133
+ nextLink: string,
134
+ options?: ChildAvailabilityStatusesListNextOptionalParams
135
+ ): Promise<ChildAvailabilityStatusesListNextResponse> {
136
+ return this.client.sendOperationRequest(
137
+ { resourceUri, nextLink, options },
138
+ listNextOperationSpec
139
+ );
140
+ }
141
+ }
142
+ // Operation Specifications
143
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
144
+
145
+ const getByResourceOperationSpec: coreClient.OperationSpec = {
146
+ path:
147
+ "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current",
148
+ httpMethod: "GET",
149
+ responses: {
150
+ 200: {
151
+ bodyMapper: Mappers.AvailabilityStatus
152
+ },
153
+ default: {
154
+ bodyMapper: Mappers.ErrorResponse
155
+ }
156
+ },
157
+ queryParameters: [
158
+ Parameters.apiVersion,
159
+ Parameters.filter,
160
+ Parameters.expand
161
+ ],
162
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
163
+ headerParameters: [Parameters.accept],
164
+ serializer
165
+ };
166
+ const listOperationSpec: coreClient.OperationSpec = {
167
+ path:
168
+ "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses",
169
+ httpMethod: "GET",
170
+ responses: {
171
+ 200: {
172
+ bodyMapper: Mappers.AvailabilityStatusListResult
173
+ },
174
+ default: {
175
+ bodyMapper: Mappers.ErrorResponse
176
+ }
177
+ },
178
+ queryParameters: [
179
+ Parameters.apiVersion,
180
+ Parameters.filter,
181
+ Parameters.expand
182
+ ],
183
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
184
+ headerParameters: [Parameters.accept],
185
+ serializer
186
+ };
187
+ const listNextOperationSpec: coreClient.OperationSpec = {
188
+ path: "{nextLink}",
189
+ httpMethod: "GET",
190
+ responses: {
191
+ 200: {
192
+ bodyMapper: Mappers.AvailabilityStatusListResult
193
+ },
194
+ default: {
195
+ bodyMapper: Mappers.ErrorResponse
196
+ }
197
+ },
198
+ queryParameters: [
199
+ Parameters.apiVersion,
200
+ Parameters.filter,
201
+ Parameters.expand
202
+ ],
203
+ urlParameters: [
204
+ Parameters.$host,
205
+ Parameters.resourceUri,
206
+ Parameters.nextLink
207
+ ],
208
+ headerParameters: [Parameters.accept],
209
+ serializer
210
+ };
@@ -0,0 +1,168 @@
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 } from "@azure/core-paging";
10
+ import { ChildResources } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
15
+ import {
16
+ AvailabilityStatus,
17
+ ChildResourcesListNextOptionalParams,
18
+ ChildResourcesListOptionalParams,
19
+ ChildResourcesListResponse,
20
+ ChildResourcesListNextResponse
21
+ } from "../models";
22
+
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing ChildResources operations. */
25
+ export class ChildResourcesImpl implements ChildResources {
26
+ private readonly client: MicrosoftResourceHealthContext;
27
+
28
+ /**
29
+ * Initialize a new instance of the class ChildResources class.
30
+ * @param client Reference to the service client
31
+ */
32
+ constructor(client: MicrosoftResourceHealthContext) {
33
+ this.client = client;
34
+ }
35
+
36
+ /**
37
+ * Lists the all the children and its current health status for a parent resource. Use the nextLink
38
+ * property in the response to get the next page of children current health
39
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
40
+ * type. Currently the API only support not nested parent resource type:
41
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
42
+ * @param options The options parameters.
43
+ */
44
+ public list(
45
+ resourceUri: string,
46
+ options?: ChildResourcesListOptionalParams
47
+ ): PagedAsyncIterableIterator<AvailabilityStatus> {
48
+ const iter = this.listPagingAll(resourceUri, options);
49
+ return {
50
+ next() {
51
+ return iter.next();
52
+ },
53
+ [Symbol.asyncIterator]() {
54
+ return this;
55
+ },
56
+ byPage: () => {
57
+ return this.listPagingPage(resourceUri, options);
58
+ }
59
+ };
60
+ }
61
+
62
+ private async *listPagingPage(
63
+ resourceUri: string,
64
+ options?: ChildResourcesListOptionalParams
65
+ ): AsyncIterableIterator<AvailabilityStatus[]> {
66
+ let result = await this._list(resourceUri, options);
67
+ yield result.value || [];
68
+ let continuationToken = result.nextLink;
69
+ while (continuationToken) {
70
+ result = await this._listNext(resourceUri, continuationToken, options);
71
+ continuationToken = result.nextLink;
72
+ yield result.value || [];
73
+ }
74
+ }
75
+
76
+ private async *listPagingAll(
77
+ resourceUri: string,
78
+ options?: ChildResourcesListOptionalParams
79
+ ): AsyncIterableIterator<AvailabilityStatus> {
80
+ for await (const page of this.listPagingPage(resourceUri, options)) {
81
+ yield* page;
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Lists the all the children and its current health status for a parent resource. Use the nextLink
87
+ * property in the response to get the next page of children current health
88
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
89
+ * type. Currently the API only support not nested parent resource type:
90
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
91
+ * @param options The options parameters.
92
+ */
93
+ private _list(
94
+ resourceUri: string,
95
+ options?: ChildResourcesListOptionalParams
96
+ ): Promise<ChildResourcesListResponse> {
97
+ return this.client.sendOperationRequest(
98
+ { resourceUri, options },
99
+ listOperationSpec
100
+ );
101
+ }
102
+
103
+ /**
104
+ * ListNext
105
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
106
+ * type. Currently the API only support not nested parent resource type:
107
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
108
+ * @param nextLink The nextLink from the previous successful call to the List method.
109
+ * @param options The options parameters.
110
+ */
111
+ private _listNext(
112
+ resourceUri: string,
113
+ nextLink: string,
114
+ options?: ChildResourcesListNextOptionalParams
115
+ ): Promise<ChildResourcesListNextResponse> {
116
+ return this.client.sendOperationRequest(
117
+ { resourceUri, nextLink, options },
118
+ listNextOperationSpec
119
+ );
120
+ }
121
+ }
122
+ // Operation Specifications
123
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
124
+
125
+ const listOperationSpec: coreClient.OperationSpec = {
126
+ path: "/{resourceUri}/providers/Microsoft.ResourceHealth/childResources",
127
+ httpMethod: "GET",
128
+ responses: {
129
+ 200: {
130
+ bodyMapper: Mappers.AvailabilityStatusListResult
131
+ },
132
+ default: {
133
+ bodyMapper: Mappers.ErrorResponse
134
+ }
135
+ },
136
+ queryParameters: [
137
+ Parameters.apiVersion,
138
+ Parameters.filter,
139
+ Parameters.expand
140
+ ],
141
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
142
+ headerParameters: [Parameters.accept],
143
+ serializer
144
+ };
145
+ const listNextOperationSpec: coreClient.OperationSpec = {
146
+ path: "{nextLink}",
147
+ httpMethod: "GET",
148
+ responses: {
149
+ 200: {
150
+ bodyMapper: Mappers.AvailabilityStatusListResult
151
+ },
152
+ default: {
153
+ bodyMapper: Mappers.ErrorResponse
154
+ }
155
+ },
156
+ queryParameters: [
157
+ Parameters.apiVersion,
158
+ Parameters.filter,
159
+ Parameters.expand
160
+ ],
161
+ urlParameters: [
162
+ Parameters.$host,
163
+ Parameters.resourceUri,
164
+ Parameters.nextLink
165
+ ],
166
+ headerParameters: [Parameters.accept],
167
+ serializer
168
+ };
@@ -0,0 +1,165 @@
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 } from "@azure/core-paging";
10
+ import { EmergingIssues } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
15
+ import {
16
+ EmergingIssuesGetResult,
17
+ EmergingIssuesListNextOptionalParams,
18
+ EmergingIssuesListOptionalParams,
19
+ EmergingIssuesGetOptionalParams,
20
+ EmergingIssuesGetResponse,
21
+ EmergingIssuesListResponse,
22
+ EmergingIssuesListNextResponse
23
+ } from "../models";
24
+
25
+ /// <reference lib="esnext.asynciterable" />
26
+ /** Class containing EmergingIssues operations. */
27
+ export class EmergingIssuesImpl implements EmergingIssues {
28
+ private readonly client: MicrosoftResourceHealthContext;
29
+
30
+ /**
31
+ * Initialize a new instance of the class EmergingIssues class.
32
+ * @param client Reference to the service client
33
+ */
34
+ constructor(client: MicrosoftResourceHealthContext) {
35
+ this.client = client;
36
+ }
37
+
38
+ /**
39
+ * Lists Azure services' emerging issues.
40
+ * @param options The options parameters.
41
+ */
42
+ public list(
43
+ options?: EmergingIssuesListOptionalParams
44
+ ): PagedAsyncIterableIterator<EmergingIssuesGetResult> {
45
+ const iter = this.listPagingAll(options);
46
+ return {
47
+ next() {
48
+ return iter.next();
49
+ },
50
+ [Symbol.asyncIterator]() {
51
+ return this;
52
+ },
53
+ byPage: () => {
54
+ return this.listPagingPage(options);
55
+ }
56
+ };
57
+ }
58
+
59
+ private async *listPagingPage(
60
+ options?: EmergingIssuesListOptionalParams
61
+ ): AsyncIterableIterator<EmergingIssuesGetResult[]> {
62
+ let result = await this._list(options);
63
+ yield result.value || [];
64
+ let continuationToken = result.nextLink;
65
+ while (continuationToken) {
66
+ result = await this._listNext(continuationToken, options);
67
+ continuationToken = result.nextLink;
68
+ yield result.value || [];
69
+ }
70
+ }
71
+
72
+ private async *listPagingAll(
73
+ options?: EmergingIssuesListOptionalParams
74
+ ): AsyncIterableIterator<EmergingIssuesGetResult> {
75
+ for await (const page of this.listPagingPage(options)) {
76
+ yield* page;
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Gets Azure services' emerging issues.
82
+ * @param options The options parameters.
83
+ */
84
+ get(
85
+ options?: EmergingIssuesGetOptionalParams
86
+ ): Promise<EmergingIssuesGetResponse> {
87
+ return this.client.sendOperationRequest({ options }, getOperationSpec);
88
+ }
89
+
90
+ /**
91
+ * Lists Azure services' emerging issues.
92
+ * @param options The options parameters.
93
+ */
94
+ private _list(
95
+ options?: EmergingIssuesListOptionalParams
96
+ ): Promise<EmergingIssuesListResponse> {
97
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
98
+ }
99
+
100
+ /**
101
+ * ListNext
102
+ * @param nextLink The nextLink from the previous successful call to the List method.
103
+ * @param options The options parameters.
104
+ */
105
+ private _listNext(
106
+ nextLink: string,
107
+ options?: EmergingIssuesListNextOptionalParams
108
+ ): Promise<EmergingIssuesListNextResponse> {
109
+ return this.client.sendOperationRequest(
110
+ { nextLink, options },
111
+ listNextOperationSpec
112
+ );
113
+ }
114
+ }
115
+ // Operation Specifications
116
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
117
+
118
+ const getOperationSpec: coreClient.OperationSpec = {
119
+ path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}",
120
+ httpMethod: "GET",
121
+ responses: {
122
+ 200: {
123
+ bodyMapper: Mappers.EmergingIssuesGetResult
124
+ },
125
+ default: {
126
+ bodyMapper: Mappers.ErrorResponse
127
+ }
128
+ },
129
+ queryParameters: [Parameters.apiVersion],
130
+ urlParameters: [Parameters.$host, Parameters.issueName],
131
+ headerParameters: [Parameters.accept],
132
+ serializer
133
+ };
134
+ const listOperationSpec: coreClient.OperationSpec = {
135
+ path: "/providers/Microsoft.ResourceHealth/emergingIssues",
136
+ httpMethod: "GET",
137
+ responses: {
138
+ 200: {
139
+ bodyMapper: Mappers.EmergingIssueListResult
140
+ },
141
+ default: {
142
+ bodyMapper: Mappers.ErrorResponse
143
+ }
144
+ },
145
+ queryParameters: [Parameters.apiVersion],
146
+ urlParameters: [Parameters.$host],
147
+ headerParameters: [Parameters.accept],
148
+ serializer
149
+ };
150
+ const listNextOperationSpec: coreClient.OperationSpec = {
151
+ path: "{nextLink}",
152
+ httpMethod: "GET",
153
+ responses: {
154
+ 200: {
155
+ bodyMapper: Mappers.EmergingIssueListResult
156
+ },
157
+ default: {
158
+ bodyMapper: Mappers.ErrorResponse
159
+ }
160
+ },
161
+ queryParameters: [Parameters.apiVersion],
162
+ urlParameters: [Parameters.$host, Parameters.nextLink],
163
+ headerParameters: [Parameters.accept],
164
+ serializer
165
+ };
@@ -0,0 +1,13 @@
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
+ export * from "./availabilityStatuses";
10
+ export * from "./childAvailabilityStatuses";
11
+ export * from "./childResources";
12
+ export * from "./operations";
13
+ export * from "./emergingIssues";
@@ -0,0 +1,59 @@
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 { Operations } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
14
+ import {
15
+ OperationsListOptionalParams,
16
+ OperationsListResponse
17
+ } from "../models";
18
+
19
+ /** Class containing Operations operations. */
20
+ export class OperationsImpl implements Operations {
21
+ private readonly client: MicrosoftResourceHealthContext;
22
+
23
+ /**
24
+ * Initialize a new instance of the class Operations class.
25
+ * @param client Reference to the service client
26
+ */
27
+ constructor(client: MicrosoftResourceHealthContext) {
28
+ this.client = client;
29
+ }
30
+
31
+ /**
32
+ * Lists available operations for the resourcehealth resource provider
33
+ * @param options The options parameters.
34
+ */
35
+ list(
36
+ options?: OperationsListOptionalParams
37
+ ): Promise<OperationsListResponse> {
38
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
39
+ }
40
+ }
41
+ // Operation Specifications
42
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
43
+
44
+ const listOperationSpec: coreClient.OperationSpec = {
45
+ path: "/providers/Microsoft.ResourceHealth/operations",
46
+ httpMethod: "GET",
47
+ responses: {
48
+ 200: {
49
+ bodyMapper: Mappers.OperationListResult
50
+ },
51
+ default: {
52
+ bodyMapper: Mappers.ErrorResponse
53
+ }
54
+ },
55
+ queryParameters: [Parameters.apiVersion],
56
+ urlParameters: [Parameters.$host],
57
+ headerParameters: [Parameters.accept],
58
+ serializer
59
+ };
@@ -0,0 +1,67 @@
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 } from "@azure/core-paging";
10
+ import {
11
+ AvailabilityStatus,
12
+ AvailabilityStatusesListBySubscriptionIdOptionalParams,
13
+ AvailabilityStatusesListByResourceGroupOptionalParams,
14
+ AvailabilityStatusesListOptionalParams,
15
+ AvailabilityStatusesGetByResourceOptionalParams,
16
+ AvailabilityStatusesGetByResourceResponse
17
+ } from "../models";
18
+
19
+ /// <reference lib="esnext.asynciterable" />
20
+ /** Interface representing a AvailabilityStatuses. */
21
+ export interface AvailabilityStatuses {
22
+ /**
23
+ * Lists the current availability status for all the resources in the subscription. Use the nextLink
24
+ * property in the response to get the next page of availability statuses.
25
+ * @param options The options parameters.
26
+ */
27
+ listBySubscriptionId(
28
+ options?: AvailabilityStatusesListBySubscriptionIdOptionalParams
29
+ ): PagedAsyncIterableIterator<AvailabilityStatus>;
30
+ /**
31
+ * Lists the current availability status for all the resources in the resource group. Use the nextLink
32
+ * property in the response to get the next page of availability statuses.
33
+ * @param resourceGroupName The name of the resource group.
34
+ * @param options The options parameters.
35
+ */
36
+ listByResourceGroup(
37
+ resourceGroupName: string,
38
+ options?: AvailabilityStatusesListByResourceGroupOptionalParams
39
+ ): PagedAsyncIterableIterator<AvailabilityStatus>;
40
+ /**
41
+ * Lists all historical availability transitions and impacting events for a single resource. Use the
42
+ * nextLink property in the response to get the next page of availability status
43
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
44
+ * type. Currently the API support not nested and one nesting level resource types :
45
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
46
+ * and
47
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
48
+ * @param options The options parameters.
49
+ */
50
+ list(
51
+ resourceUri: string,
52
+ options?: AvailabilityStatusesListOptionalParams
53
+ ): PagedAsyncIterableIterator<AvailabilityStatus>;
54
+ /**
55
+ * Gets current availability status for a single resource
56
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
57
+ * type. Currently the API support not nested and one nesting level resource types :
58
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
59
+ * and
60
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
61
+ * @param options The options parameters.
62
+ */
63
+ getByResource(
64
+ resourceUri: string,
65
+ options?: AvailabilityStatusesGetByResourceOptionalParams
66
+ ): Promise<AvailabilityStatusesGetByResourceResponse>;
67
+ }