@azure/arm-resourcehealth 1.2.1 → 3.0.0-alpha.20211221.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -83
  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 +67 -24
  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 +40 -38
  89. package/src/microsoftResourceHealthContext.ts +49 -47
  90. package/src/models/index.ts +382 -532
  91. package/src/models/mappers.ts +409 -175
  92. package/src/models/parameters.ts +66 -37
  93. package/src/operations/availabilityStatuses.ts +335 -272
  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 +6 -5
  98. package/src/operations/operations.ts +26 -41
  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 -1047
  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 -26
  113. package/esm/microsoftResourceHealth.d.ts.map +0 -1
  114. package/esm/microsoftResourceHealth.js +0 -40
  115. package/esm/microsoftResourceHealth.js.map +0 -1
  116. package/esm/microsoftResourceHealthContext.d.ts +0 -23
  117. package/esm/microsoftResourceHealthContext.d.ts.map +0 -1
  118. package/esm/microsoftResourceHealthContext.js +0 -62
  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/src/models/availabilityStatusesMappers.ts +0 -22
  151. package/src/models/operationsMappers.ts +0 -17
@@ -1,270 +1,325 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/availabilityStatusesMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { AvailabilityStatuses } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
14
  import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
15
+ import {
16
+ AvailabilityStatus,
17
+ AvailabilityStatusesListBySubscriptionIdNextOptionalParams,
18
+ AvailabilityStatusesListBySubscriptionIdOptionalParams,
19
+ AvailabilityStatusesListByResourceGroupNextOptionalParams,
20
+ AvailabilityStatusesListByResourceGroupOptionalParams,
21
+ AvailabilityStatusesListNextOptionalParams,
22
+ AvailabilityStatusesListOptionalParams,
23
+ AvailabilityStatusesListBySubscriptionIdResponse,
24
+ AvailabilityStatusesListByResourceGroupResponse,
25
+ AvailabilityStatusesGetByResourceOptionalParams,
26
+ AvailabilityStatusesGetByResourceResponse,
27
+ AvailabilityStatusesListResponse,
28
+ AvailabilityStatusesListBySubscriptionIdNextResponse,
29
+ AvailabilityStatusesListByResourceGroupNextResponse,
30
+ AvailabilityStatusesListNextResponse
31
+ } from "../models";
16
32
 
17
- /** Class representing a AvailabilityStatuses. */
18
- export class AvailabilityStatuses {
33
+ /// <reference lib="esnext.asynciterable" />
34
+ /** Class containing AvailabilityStatuses operations. */
35
+ export class AvailabilityStatusesImpl implements AvailabilityStatuses {
19
36
  private readonly client: MicrosoftResourceHealthContext;
20
37
 
21
38
  /**
22
- * Create a AvailabilityStatuses.
23
- * @param {MicrosoftResourceHealthContext} client Reference to the service client.
39
+ * Initialize a new instance of the class AvailabilityStatuses class.
40
+ * @param client Reference to the service client
24
41
  */
25
42
  constructor(client: MicrosoftResourceHealthContext) {
26
43
  this.client = client;
27
44
  }
28
45
 
29
46
  /**
30
- * Lists the current availability status for all the resources in the subscription. Use the
31
- * nextLink property in the response to get the next page of availability statuses.
32
- * @param [options] The optional parameters
33
- * @returns Promise<Models.AvailabilityStatusesListBySubscriptionIdResponse>
47
+ * Lists the current availability status for all the resources in the subscription. Use the nextLink
48
+ * property in the response to get the next page of availability statuses.
49
+ * @param options The options parameters.
34
50
  */
35
- listBySubscriptionId(options?: Models.AvailabilityStatusesListBySubscriptionIdOptionalParams): Promise<Models.AvailabilityStatusesListBySubscriptionIdResponse>;
36
- /**
37
- * @param callback The callback
38
- */
39
- listBySubscriptionId(callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
40
- /**
41
- * @param options The optional parameters
42
- * @param callback The callback
43
- */
44
- listBySubscriptionId(options: Models.AvailabilityStatusesListBySubscriptionIdOptionalParams, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
45
- listBySubscriptionId(options?: Models.AvailabilityStatusesListBySubscriptionIdOptionalParams | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListBySubscriptionIdResponse> {
46
- return this.client.sendOperationRequest(
47
- {
48
- options
51
+ public listBySubscriptionId(
52
+ options?: AvailabilityStatusesListBySubscriptionIdOptionalParams
53
+ ): PagedAsyncIterableIterator<AvailabilityStatus> {
54
+ const iter = this.listBySubscriptionIdPagingAll(options);
55
+ return {
56
+ next() {
57
+ return iter.next();
49
58
  },
50
- listBySubscriptionIdOperationSpec,
51
- callback) as Promise<Models.AvailabilityStatusesListBySubscriptionIdResponse>;
59
+ [Symbol.asyncIterator]() {
60
+ return this;
61
+ },
62
+ byPage: () => {
63
+ return this.listBySubscriptionIdPagingPage(options);
64
+ }
65
+ };
66
+ }
67
+
68
+ private async *listBySubscriptionIdPagingPage(
69
+ options?: AvailabilityStatusesListBySubscriptionIdOptionalParams
70
+ ): AsyncIterableIterator<AvailabilityStatus[]> {
71
+ let result = await this._listBySubscriptionId(options);
72
+ yield result.value || [];
73
+ let continuationToken = result.nextLink;
74
+ while (continuationToken) {
75
+ result = await this._listBySubscriptionIdNext(continuationToken, options);
76
+ continuationToken = result.nextLink;
77
+ yield result.value || [];
78
+ }
79
+ }
80
+
81
+ private async *listBySubscriptionIdPagingAll(
82
+ options?: AvailabilityStatusesListBySubscriptionIdOptionalParams
83
+ ): AsyncIterableIterator<AvailabilityStatus> {
84
+ for await (const page of this.listBySubscriptionIdPagingPage(options)) {
85
+ yield* page;
86
+ }
52
87
  }
53
88
 
54
89
  /**
55
- * Lists the current availability status for all the resources in the resource group. Use the
56
- * nextLink property in the response to get the next page of availability statuses.
57
- * @param resourceGroupName The name of the resource group.
58
- * @param [options] The optional parameters
59
- * @returns Promise<Models.AvailabilityStatusesListByResourceGroupResponse>
60
- */
61
- listByResourceGroup(resourceGroupName: string, options?: Models.AvailabilityStatusesListByResourceGroupOptionalParams): Promise<Models.AvailabilityStatusesListByResourceGroupResponse>;
62
- /**
63
- * @param resourceGroupName The name of the resource group.
64
- * @param callback The callback
65
- */
66
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
67
- /**
90
+ * Lists the current availability status for all the resources in the resource group. Use the nextLink
91
+ * property in the response to get the next page of availability statuses.
68
92
  * @param resourceGroupName The name of the resource group.
69
- * @param options The optional parameters
70
- * @param callback The callback
93
+ * @param options The options parameters.
71
94
  */
72
- listByResourceGroup(resourceGroupName: string, options: Models.AvailabilityStatusesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
73
- listByResourceGroup(resourceGroupName: string, options?: Models.AvailabilityStatusesListByResourceGroupOptionalParams | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListByResourceGroupResponse> {
74
- return this.client.sendOperationRequest(
75
- {
95
+ public listByResourceGroup(
96
+ resourceGroupName: string,
97
+ options?: AvailabilityStatusesListByResourceGroupOptionalParams
98
+ ): PagedAsyncIterableIterator<AvailabilityStatus> {
99
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
100
+ return {
101
+ next() {
102
+ return iter.next();
103
+ },
104
+ [Symbol.asyncIterator]() {
105
+ return this;
106
+ },
107
+ byPage: () => {
108
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
109
+ }
110
+ };
111
+ }
112
+
113
+ private async *listByResourceGroupPagingPage(
114
+ resourceGroupName: string,
115
+ options?: AvailabilityStatusesListByResourceGroupOptionalParams
116
+ ): AsyncIterableIterator<AvailabilityStatus[]> {
117
+ let result = await this._listByResourceGroup(resourceGroupName, options);
118
+ yield result.value || [];
119
+ let continuationToken = result.nextLink;
120
+ while (continuationToken) {
121
+ result = await this._listByResourceGroupNext(
76
122
  resourceGroupName,
123
+ continuationToken,
77
124
  options
78
- },
79
- listByResourceGroupOperationSpec,
80
- callback) as Promise<Models.AvailabilityStatusesListByResourceGroupResponse>;
125
+ );
126
+ continuationToken = result.nextLink;
127
+ yield result.value || [];
128
+ }
129
+ }
130
+
131
+ private async *listByResourceGroupPagingAll(
132
+ resourceGroupName: string,
133
+ options?: AvailabilityStatusesListByResourceGroupOptionalParams
134
+ ): AsyncIterableIterator<AvailabilityStatus> {
135
+ for await (const page of this.listByResourceGroupPagingPage(
136
+ resourceGroupName,
137
+ options
138
+ )) {
139
+ yield* page;
140
+ }
81
141
  }
82
142
 
83
143
  /**
84
- * Gets current availability status for a single resource
85
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
86
- * resource type. Currently the API support not nested and one nesting level resource types :
87
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
88
- * and
89
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
90
- * @param [options] The optional parameters
91
- * @returns Promise<Models.AvailabilityStatusesGetByResourceResponse>
92
- */
93
- getByResource(resourceUri: string, options?: Models.AvailabilityStatusesGetByResourceOptionalParams): Promise<Models.AvailabilityStatusesGetByResourceResponse>;
94
- /**
95
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
96
- * resource type. Currently the API support not nested and one nesting level resource types :
97
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
98
- * and
99
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
100
- * @param callback The callback
101
- */
102
- getByResource(resourceUri: string, callback: msRest.ServiceCallback<Models.AvailabilityStatus>): void;
103
- /**
104
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
105
- * resource type. Currently the API support not nested and one nesting level resource types :
106
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
107
- * and
108
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
109
- * @param options The optional parameters
110
- * @param callback The callback
144
+ * Lists all historical availability transitions and impacting events for a single resource. Use the
145
+ * nextLink property in the response to get the next page of availability status
146
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
147
+ * type. Currently the API support not nested and one nesting level resource types :
148
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
149
+ * and
150
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
151
+ * @param options The options parameters.
111
152
  */
112
- getByResource(resourceUri: string, options: Models.AvailabilityStatusesGetByResourceOptionalParams, callback: msRest.ServiceCallback<Models.AvailabilityStatus>): void;
113
- getByResource(resourceUri: string, options?: Models.AvailabilityStatusesGetByResourceOptionalParams | msRest.ServiceCallback<Models.AvailabilityStatus>, callback?: msRest.ServiceCallback<Models.AvailabilityStatus>): Promise<Models.AvailabilityStatusesGetByResourceResponse> {
114
- return this.client.sendOperationRequest(
115
- {
116
- resourceUri,
117
- options
153
+ public list(
154
+ resourceUri: string,
155
+ options?: AvailabilityStatusesListOptionalParams
156
+ ): PagedAsyncIterableIterator<AvailabilityStatus> {
157
+ const iter = this.listPagingAll(resourceUri, options);
158
+ return {
159
+ next() {
160
+ return iter.next();
118
161
  },
119
- getByResourceOperationSpec,
120
- callback) as Promise<Models.AvailabilityStatusesGetByResourceResponse>;
162
+ [Symbol.asyncIterator]() {
163
+ return this;
164
+ },
165
+ byPage: () => {
166
+ return this.listPagingPage(resourceUri, options);
167
+ }
168
+ };
169
+ }
170
+
171
+ private async *listPagingPage(
172
+ resourceUri: string,
173
+ options?: AvailabilityStatusesListOptionalParams
174
+ ): AsyncIterableIterator<AvailabilityStatus[]> {
175
+ let result = await this._list(resourceUri, options);
176
+ yield result.value || [];
177
+ let continuationToken = result.nextLink;
178
+ while (continuationToken) {
179
+ result = await this._listNext(resourceUri, continuationToken, options);
180
+ continuationToken = result.nextLink;
181
+ yield result.value || [];
182
+ }
183
+ }
184
+
185
+ private async *listPagingAll(
186
+ resourceUri: string,
187
+ options?: AvailabilityStatusesListOptionalParams
188
+ ): AsyncIterableIterator<AvailabilityStatus> {
189
+ for await (const page of this.listPagingPage(resourceUri, options)) {
190
+ yield* page;
191
+ }
121
192
  }
122
193
 
123
194
  /**
124
- * Lists all historical availability transitions and impacting events for a single resource. Use
125
- * the nextLink property in the response to get the next page of availability status
126
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
127
- * resource type. Currently the API support not nested and one nesting level resource types :
128
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
129
- * and
130
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
131
- * @param [options] The optional parameters
132
- * @returns Promise<Models.AvailabilityStatusesListResponse>
133
- */
134
- list(resourceUri: string, options?: Models.AvailabilityStatusesListOptionalParams): Promise<Models.AvailabilityStatusesListResponse>;
135
- /**
136
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
137
- * resource type. Currently the API support not nested and one nesting level resource types :
138
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
139
- * and
140
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
141
- * @param callback The callback
142
- */
143
- list(resourceUri: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
144
- /**
145
- * @param resourceUri The fully qualified ID of the resource, including the resource name and
146
- * resource type. Currently the API support not nested and one nesting level resource types :
147
- * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
148
- * and
149
- * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
150
- * @param options The optional parameters
151
- * @param callback The callback
195
+ * Lists the current availability status for all the resources in the subscription. Use the nextLink
196
+ * property in the response to get the next page of availability statuses.
197
+ * @param options The options parameters.
152
198
  */
153
- list(resourceUri: string, options: Models.AvailabilityStatusesListOptionalParams, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
154
- list(resourceUri: string, options?: Models.AvailabilityStatusesListOptionalParams | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListResponse> {
199
+ private _listBySubscriptionId(
200
+ options?: AvailabilityStatusesListBySubscriptionIdOptionalParams
201
+ ): Promise<AvailabilityStatusesListBySubscriptionIdResponse> {
155
202
  return this.client.sendOperationRequest(
156
- {
157
- resourceUri,
158
- options
159
- },
160
- listOperationSpec,
161
- callback) as Promise<Models.AvailabilityStatusesListResponse>;
203
+ { options },
204
+ listBySubscriptionIdOperationSpec
205
+ );
162
206
  }
163
207
 
164
208
  /**
165
- * Lists the current availability status for all the resources in the subscription. Use the
166
- * nextLink property in the response to get the next page of availability statuses.
167
- * @param nextPageLink The NextLink from the previous successful call to List operation.
168
- * @param [options] The optional parameters
169
- * @returns Promise<Models.AvailabilityStatusesListBySubscriptionIdNextResponse>
170
- */
171
- listBySubscriptionIdNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AvailabilityStatusesListBySubscriptionIdNextResponse>;
172
- /**
173
- * @param nextPageLink The NextLink from the previous successful call to List operation.
174
- * @param callback The callback
175
- */
176
- listBySubscriptionIdNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
177
- /**
178
- * @param nextPageLink The NextLink from the previous successful call to List operation.
179
- * @param options The optional parameters
180
- * @param callback The callback
209
+ * Lists the current availability status for all the resources in the resource group. Use the nextLink
210
+ * property in the response to get the next page of availability statuses.
211
+ * @param resourceGroupName The name of the resource group.
212
+ * @param options The options parameters.
181
213
  */
182
- listBySubscriptionIdNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
183
- listBySubscriptionIdNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListBySubscriptionIdNextResponse> {
214
+ private _listByResourceGroup(
215
+ resourceGroupName: string,
216
+ options?: AvailabilityStatusesListByResourceGroupOptionalParams
217
+ ): Promise<AvailabilityStatusesListByResourceGroupResponse> {
184
218
  return this.client.sendOperationRequest(
185
- {
186
- nextPageLink,
187
- options
188
- },
189
- listBySubscriptionIdNextOperationSpec,
190
- callback) as Promise<Models.AvailabilityStatusesListBySubscriptionIdNextResponse>;
219
+ { resourceGroupName, options },
220
+ listByResourceGroupOperationSpec
221
+ );
191
222
  }
192
223
 
193
224
  /**
194
- * Lists the current availability status for all the resources in the resource group. Use the
195
- * nextLink property in the response to get the next page of availability statuses.
196
- * @param nextPageLink The NextLink from the previous successful call to List operation.
197
- * @param [options] The optional parameters
198
- * @returns Promise<Models.AvailabilityStatusesListByResourceGroupNextResponse>
199
- */
200
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AvailabilityStatusesListByResourceGroupNextResponse>;
201
- /**
202
- * @param nextPageLink The NextLink from the previous successful call to List operation.
203
- * @param callback The callback
225
+ * Gets current availability status for a single resource
226
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
227
+ * type. Currently the API support not nested and one nesting level resource types :
228
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
229
+ * and
230
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
231
+ * @param options The options parameters.
204
232
  */
205
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
233
+ getByResource(
234
+ resourceUri: string,
235
+ options?: AvailabilityStatusesGetByResourceOptionalParams
236
+ ): Promise<AvailabilityStatusesGetByResourceResponse> {
237
+ return this.client.sendOperationRequest(
238
+ { resourceUri, options },
239
+ getByResourceOperationSpec
240
+ );
241
+ }
242
+
206
243
  /**
207
- * @param nextPageLink The NextLink from the previous successful call to List operation.
208
- * @param options The optional parameters
209
- * @param callback The callback
244
+ * Lists all historical availability transitions and impacting events for a single resource. Use the
245
+ * nextLink property in the response to get the next page of availability status
246
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
247
+ * type. Currently the API support not nested and one nesting level resource types :
248
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
249
+ * and
250
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
251
+ * @param options The options parameters.
210
252
  */
211
- listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
212
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListByResourceGroupNextResponse> {
253
+ private _list(
254
+ resourceUri: string,
255
+ options?: AvailabilityStatusesListOptionalParams
256
+ ): Promise<AvailabilityStatusesListResponse> {
213
257
  return this.client.sendOperationRequest(
214
- {
215
- nextPageLink,
216
- options
217
- },
218
- listByResourceGroupNextOperationSpec,
219
- callback) as Promise<Models.AvailabilityStatusesListByResourceGroupNextResponse>;
258
+ { resourceUri, options },
259
+ listOperationSpec
260
+ );
220
261
  }
221
262
 
222
263
  /**
223
- * Lists all historical availability transitions and impacting events for a single resource. Use
224
- * the nextLink property in the response to get the next page of availability status
225
- * @param nextPageLink The NextLink from the previous successful call to List operation.
226
- * @param [options] The optional parameters
227
- * @returns Promise<Models.AvailabilityStatusesListNextResponse>
264
+ * ListBySubscriptionIdNext
265
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method.
266
+ * @param options The options parameters.
228
267
  */
229
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AvailabilityStatusesListNextResponse>;
268
+ private _listBySubscriptionIdNext(
269
+ nextLink: string,
270
+ options?: AvailabilityStatusesListBySubscriptionIdNextOptionalParams
271
+ ): Promise<AvailabilityStatusesListBySubscriptionIdNextResponse> {
272
+ return this.client.sendOperationRequest(
273
+ { nextLink, options },
274
+ listBySubscriptionIdNextOperationSpec
275
+ );
276
+ }
277
+
230
278
  /**
231
- * @param nextPageLink The NextLink from the previous successful call to List operation.
232
- * @param callback The callback
279
+ * ListByResourceGroupNext
280
+ * @param resourceGroupName The name of the resource group.
281
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
282
+ * @param options The options parameters.
233
283
  */
234
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
284
+ private _listByResourceGroupNext(
285
+ resourceGroupName: string,
286
+ nextLink: string,
287
+ options?: AvailabilityStatusesListByResourceGroupNextOptionalParams
288
+ ): Promise<AvailabilityStatusesListByResourceGroupNextResponse> {
289
+ return this.client.sendOperationRequest(
290
+ { resourceGroupName, nextLink, options },
291
+ listByResourceGroupNextOperationSpec
292
+ );
293
+ }
294
+
235
295
  /**
236
- * @param nextPageLink The NextLink from the previous successful call to List operation.
237
- * @param options The optional parameters
238
- * @param callback The callback
296
+ * ListNext
297
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
298
+ * type. Currently the API support not nested and one nesting level resource types :
299
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
300
+ * and
301
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
302
+ * @param nextLink The nextLink from the previous successful call to the List method.
303
+ * @param options The options parameters.
239
304
  */
240
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
241
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.AvailabilityStatusesListNextResponse> {
305
+ private _listNext(
306
+ resourceUri: string,
307
+ nextLink: string,
308
+ options?: AvailabilityStatusesListNextOptionalParams
309
+ ): Promise<AvailabilityStatusesListNextResponse> {
242
310
  return this.client.sendOperationRequest(
243
- {
244
- nextPageLink,
245
- options
246
- },
247
- listNextOperationSpec,
248
- callback) as Promise<Models.AvailabilityStatusesListNextResponse>;
311
+ { resourceUri, nextLink, options },
312
+ listNextOperationSpec
313
+ );
249
314
  }
250
315
  }
251
-
252
316
  // Operation Specifications
253
- const serializer = new msRest.Serializer(Mappers);
254
- const listBySubscriptionIdOperationSpec: msRest.OperationSpec = {
317
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
318
+
319
+ const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = {
320
+ path:
321
+ "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses",
255
322
  httpMethod: "GET",
256
- path: "subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses",
257
- urlParameters: [
258
- Parameters.subscriptionId
259
- ],
260
- queryParameters: [
261
- Parameters.apiVersion,
262
- Parameters.filter,
263
- Parameters.expand
264
- ],
265
- headerParameters: [
266
- Parameters.acceptLanguage
267
- ],
268
323
  responses: {
269
324
  200: {
270
325
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -273,24 +328,19 @@ const listBySubscriptionIdOperationSpec: msRest.OperationSpec = {
273
328
  bodyMapper: Mappers.ErrorResponse
274
329
  }
275
330
  },
276
- serializer
277
- };
278
-
279
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
280
- httpMethod: "GET",
281
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses",
282
- urlParameters: [
283
- Parameters.subscriptionId,
284
- Parameters.resourceGroupName
285
- ],
286
331
  queryParameters: [
287
332
  Parameters.apiVersion,
288
333
  Parameters.filter,
289
334
  Parameters.expand
290
335
  ],
291
- headerParameters: [
292
- Parameters.acceptLanguage
293
- ],
336
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
337
+ headerParameters: [Parameters.accept],
338
+ serializer
339
+ };
340
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
341
+ path:
342
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses",
343
+ httpMethod: "GET",
294
344
  responses: {
295
345
  200: {
296
346
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -299,23 +349,23 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = {
299
349
  bodyMapper: Mappers.ErrorResponse
300
350
  }
301
351
  },
302
- serializer
303
- };
304
-
305
- const getByResourceOperationSpec: msRest.OperationSpec = {
306
- httpMethod: "GET",
307
- path: "{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current",
308
- urlParameters: [
309
- Parameters.resourceUri
310
- ],
311
352
  queryParameters: [
312
353
  Parameters.apiVersion,
313
354
  Parameters.filter,
314
355
  Parameters.expand
315
356
  ],
316
- headerParameters: [
317
- Parameters.acceptLanguage
357
+ urlParameters: [
358
+ Parameters.$host,
359
+ Parameters.subscriptionId,
360
+ Parameters.resourceGroupName
318
361
  ],
362
+ headerParameters: [Parameters.accept],
363
+ serializer
364
+ };
365
+ const getByResourceOperationSpec: coreClient.OperationSpec = {
366
+ path:
367
+ "/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current",
368
+ httpMethod: "GET",
319
369
  responses: {
320
370
  200: {
321
371
  bodyMapper: Mappers.AvailabilityStatus
@@ -324,23 +374,19 @@ const getByResourceOperationSpec: msRest.OperationSpec = {
324
374
  bodyMapper: Mappers.ErrorResponse
325
375
  }
326
376
  },
327
- serializer
328
- };
329
-
330
- const listOperationSpec: msRest.OperationSpec = {
331
- httpMethod: "GET",
332
- path: "{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses",
333
- urlParameters: [
334
- Parameters.resourceUri
335
- ],
336
377
  queryParameters: [
337
378
  Parameters.apiVersion,
338
379
  Parameters.filter,
339
380
  Parameters.expand
340
381
  ],
341
- headerParameters: [
342
- Parameters.acceptLanguage
343
- ],
382
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
383
+ headerParameters: [Parameters.accept],
384
+ serializer
385
+ };
386
+ const listOperationSpec: coreClient.OperationSpec = {
387
+ path:
388
+ "/{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses",
389
+ httpMethod: "GET",
344
390
  responses: {
345
391
  200: {
346
392
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -349,19 +395,18 @@ const listOperationSpec: msRest.OperationSpec = {
349
395
  bodyMapper: Mappers.ErrorResponse
350
396
  }
351
397
  },
398
+ queryParameters: [
399
+ Parameters.apiVersion,
400
+ Parameters.filter,
401
+ Parameters.expand
402
+ ],
403
+ urlParameters: [Parameters.$host, Parameters.resourceUri],
404
+ headerParameters: [Parameters.accept],
352
405
  serializer
353
406
  };
354
-
355
- const listBySubscriptionIdNextOperationSpec: msRest.OperationSpec = {
356
- httpMethod: "GET",
357
- baseUrl: "https://management.azure.com",
407
+ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = {
358
408
  path: "{nextLink}",
359
- urlParameters: [
360
- Parameters.nextPageLink
361
- ],
362
- headerParameters: [
363
- Parameters.acceptLanguage
364
- ],
409
+ httpMethod: "GET",
365
410
  responses: {
366
411
  200: {
367
412
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -370,19 +415,22 @@ const listBySubscriptionIdNextOperationSpec: msRest.OperationSpec = {
370
415
  bodyMapper: Mappers.ErrorResponse
371
416
  }
372
417
  },
418
+ queryParameters: [
419
+ Parameters.apiVersion,
420
+ Parameters.filter,
421
+ Parameters.expand
422
+ ],
423
+ urlParameters: [
424
+ Parameters.$host,
425
+ Parameters.subscriptionId,
426
+ Parameters.nextLink
427
+ ],
428
+ headerParameters: [Parameters.accept],
373
429
  serializer
374
430
  };
375
-
376
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
377
- httpMethod: "GET",
378
- baseUrl: "https://management.azure.com",
431
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
379
432
  path: "{nextLink}",
380
- urlParameters: [
381
- Parameters.nextPageLink
382
- ],
383
- headerParameters: [
384
- Parameters.acceptLanguage
385
- ],
433
+ httpMethod: "GET",
386
434
  responses: {
387
435
  200: {
388
436
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -391,19 +439,23 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
391
439
  bodyMapper: Mappers.ErrorResponse
392
440
  }
393
441
  },
442
+ queryParameters: [
443
+ Parameters.apiVersion,
444
+ Parameters.filter,
445
+ Parameters.expand
446
+ ],
447
+ urlParameters: [
448
+ Parameters.$host,
449
+ Parameters.subscriptionId,
450
+ Parameters.resourceGroupName,
451
+ Parameters.nextLink
452
+ ],
453
+ headerParameters: [Parameters.accept],
394
454
  serializer
395
455
  };
396
-
397
- const listNextOperationSpec: msRest.OperationSpec = {
398
- httpMethod: "GET",
399
- baseUrl: "https://management.azure.com",
456
+ const listNextOperationSpec: coreClient.OperationSpec = {
400
457
  path: "{nextLink}",
401
- urlParameters: [
402
- Parameters.nextPageLink
403
- ],
404
- headerParameters: [
405
- Parameters.acceptLanguage
406
- ],
458
+ httpMethod: "GET",
407
459
  responses: {
408
460
  200: {
409
461
  bodyMapper: Mappers.AvailabilityStatusListResult
@@ -412,5 +464,16 @@ const listNextOperationSpec: msRest.OperationSpec = {
412
464
  bodyMapper: Mappers.ErrorResponse
413
465
  }
414
466
  },
467
+ queryParameters: [
468
+ Parameters.apiVersion,
469
+ Parameters.filter,
470
+ Parameters.expand
471
+ ],
472
+ urlParameters: [
473
+ Parameters.$host,
474
+ Parameters.resourceUri,
475
+ Parameters.nextLink
476
+ ],
477
+ headerParameters: [Parameters.accept],
415
478
  serializer
416
479
  };