@azure/arm-resourcehealth 2.0.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 (173) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{LICENSE.txt → LICENSE} +1 -1
  3. package/README.md +70 -82
  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 +233 -309
  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 +44 -39
  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/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  49. package/dist-esm/src/operations/index.d.ts.map +1 -0
  50. package/{esm → dist-esm/src}/operations/index.js +1 -2
  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/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/availabilityStatuses.js} +2 -7
  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/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js} +2 -2
  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/{esm/models/index.js → dist-esm/src/operationsInterfaces/operations.js} +2 -1
  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 +63 -32
  85. package/review/arm-resourcehealth.api.md +396 -0
  86. package/rollup.config.js +181 -30
  87. package/src/index.ts +13 -0
  88. package/src/microsoftResourceHealth.ts +38 -41
  89. package/src/microsoftResourceHealthContext.ts +47 -44
  90. package/src/models/index.ts +322 -878
  91. package/src/models/mappers.ts +232 -320
  92. package/src/models/parameters.ts +58 -40
  93. package/src/operations/availabilityStatuses.ts +325 -276
  94. package/src/operations/childAvailabilityStatuses.ts +137 -130
  95. package/src/operations/childResources.ts +109 -85
  96. package/src/operations/emergingIssues.ts +96 -103
  97. package/src/operations/index.ts +1 -2
  98. package/src/operations/operations.ts +24 -38
  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 +3 -3
  106. package/types/arm-resourcehealth.d.ts +588 -0
  107. package/types/tsdoc-metadata.json +11 -0
  108. package/dist/arm-resourcehealth.js +0 -1743
  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 -29
  113. package/esm/microsoftResourceHealth.d.ts.map +0 -1
  114. package/esm/microsoftResourceHealth.js +0 -42
  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 -61
  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 -9
  123. package/esm/models/availabilityStatusesMappers.js.map +0 -1
  124. package/esm/models/childAvailabilityStatusesMappers.d.ts +0 -2
  125. package/esm/models/childAvailabilityStatusesMappers.d.ts.map +0 -1
  126. package/esm/models/childAvailabilityStatusesMappers.js +0 -9
  127. package/esm/models/childAvailabilityStatusesMappers.js.map +0 -1
  128. package/esm/models/childResourcesMappers.d.ts +0 -2
  129. package/esm/models/childResourcesMappers.d.ts.map +0 -1
  130. package/esm/models/childResourcesMappers.js +0 -9
  131. package/esm/models/childResourcesMappers.js.map +0 -1
  132. package/esm/models/emergingIssuesMappers.d.ts +0 -2
  133. package/esm/models/emergingIssuesMappers.d.ts.map +0 -1
  134. package/esm/models/emergingIssuesMappers.js +0 -9
  135. package/esm/models/emergingIssuesMappers.js.map +0 -1
  136. package/esm/models/index.d.ts +0 -957
  137. package/esm/models/index.d.ts.map +0 -1
  138. package/esm/models/index.js.map +0 -1
  139. package/esm/models/mappers.d.ts +0 -26
  140. package/esm/models/mappers.d.ts.map +0 -1
  141. package/esm/models/mappers.js.map +0 -1
  142. package/esm/models/operationsMappers.d.ts +0 -2
  143. package/esm/models/operationsMappers.d.ts.map +0 -1
  144. package/esm/models/operationsMappers.js.map +0 -1
  145. package/esm/models/parameters.d.ts +0 -11
  146. package/esm/models/parameters.d.ts.map +0 -1
  147. package/esm/models/parameters.js.map +0 -1
  148. package/esm/operations/availabilityStatuses.d.ts +0 -166
  149. package/esm/operations/availabilityStatuses.d.ts.map +0 -1
  150. package/esm/operations/availabilityStatuses.js +0 -239
  151. package/esm/operations/availabilityStatuses.js.map +0 -1
  152. package/esm/operations/childAvailabilityStatuses.d.ts +0 -81
  153. package/esm/operations/childAvailabilityStatuses.d.ts.map +0 -1
  154. package/esm/operations/childAvailabilityStatuses.js +0 -117
  155. package/esm/operations/childAvailabilityStatuses.js.map +0 -1
  156. package/esm/operations/childResources.d.ts +0 -57
  157. package/esm/operations/childResources.d.ts.map +0 -1
  158. package/esm/operations/childResources.js +0 -87
  159. package/esm/operations/childResources.js.map +0 -1
  160. package/esm/operations/emergingIssues.d.ts +0 -61
  161. package/esm/operations/emergingIssues.d.ts.map +0 -1
  162. package/esm/operations/emergingIssues.js +0 -106
  163. package/esm/operations/emergingIssues.js.map +0 -1
  164. package/esm/operations/index.d.ts.map +0 -1
  165. package/esm/operations/index.js.map +0 -1
  166. package/esm/operations/operations.d.ts +0 -28
  167. package/esm/operations/operations.d.ts.map +0 -1
  168. package/esm/operations/operations.js +0 -50
  169. package/esm/operations/operations.js.map +0 -1
  170. package/src/models/availabilityStatusesMappers.ts +0 -19
  171. package/src/models/childAvailabilityStatusesMappers.ts +0 -19
  172. package/src/models/childResourcesMappers.ts +0 -19
  173. package/src/models/emergingIssuesMappers.ts +0 -22
@@ -3,119 +3,121 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as Models from "../models";
12
- import * as Mappers from "../models/emergingIssuesMappers";
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
13
  import * as Parameters from "../models/parameters";
14
14
  import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
15
+ import {
16
+ EmergingIssuesGetResult,
17
+ EmergingIssuesListNextOptionalParams,
18
+ EmergingIssuesListOptionalParams,
19
+ EmergingIssuesGetOptionalParams,
20
+ EmergingIssuesGetResponse,
21
+ EmergingIssuesListResponse,
22
+ EmergingIssuesListNextResponse
23
+ } from "../models";
15
24
 
16
- /** Class representing a EmergingIssues. */
17
- export class EmergingIssues {
25
+ /// <reference lib="esnext.asynciterable" />
26
+ /** Class containing EmergingIssues operations. */
27
+ export class EmergingIssuesImpl implements EmergingIssues {
18
28
  private readonly client: MicrosoftResourceHealthContext;
19
29
 
20
30
  /**
21
- * Create a EmergingIssues.
22
- * @param {MicrosoftResourceHealthContext} client Reference to the service client.
31
+ * Initialize a new instance of the class EmergingIssues class.
32
+ * @param client Reference to the service client
23
33
  */
24
34
  constructor(client: MicrosoftResourceHealthContext) {
25
35
  this.client = client;
26
36
  }
27
37
 
28
38
  /**
29
- * Gets Azure services' emerging issues.
30
- * @param [options] The optional parameters
31
- * @returns Promise<Models.EmergingIssuesGetResponse>
32
- */
33
- get(options?: msRest.RequestOptionsBase): Promise<Models.EmergingIssuesGetResponse>;
34
- /**
35
- * @param callback The callback
36
- */
37
- get(callback: msRest.ServiceCallback<Models.EmergingIssuesGetResult>): void;
38
- /**
39
- * @param options The optional parameters
40
- * @param callback The callback
39
+ * Lists Azure services' emerging issues.
40
+ * @param options The options parameters.
41
41
  */
42
- get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EmergingIssuesGetResult>): void;
43
- get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.EmergingIssuesGetResult>, callback?: msRest.ServiceCallback<Models.EmergingIssuesGetResult>): Promise<Models.EmergingIssuesGetResponse> {
44
- return this.client.sendOperationRequest(
45
- {
46
- options
42
+ public list(
43
+ options?: EmergingIssuesListOptionalParams
44
+ ): PagedAsyncIterableIterator<EmergingIssuesGetResult> {
45
+ const iter = this.listPagingAll(options);
46
+ return {
47
+ next() {
48
+ return iter.next();
47
49
  },
48
- getOperationSpec,
49
- callback) as Promise<Models.EmergingIssuesGetResponse>;
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
+ }
50
78
  }
51
79
 
52
80
  /**
53
- * Lists Azure services' emerging issues.
54
- * @param [options] The optional parameters
55
- * @returns Promise<Models.EmergingIssuesListResponse>
56
- */
57
- list(options?: msRest.RequestOptionsBase): Promise<Models.EmergingIssuesListResponse>;
58
- /**
59
- * @param callback The callback
60
- */
61
- list(callback: msRest.ServiceCallback<Models.EmergingIssueListResult>): void;
62
- /**
63
- * @param options The optional parameters
64
- * @param callback The callback
81
+ * Gets Azure services' emerging issues.
82
+ * @param options The options parameters.
65
83
  */
66
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EmergingIssueListResult>): void;
67
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.EmergingIssueListResult>, callback?: msRest.ServiceCallback<Models.EmergingIssueListResult>): Promise<Models.EmergingIssuesListResponse> {
68
- return this.client.sendOperationRequest(
69
- {
70
- options
71
- },
72
- listOperationSpec,
73
- callback) as Promise<Models.EmergingIssuesListResponse>;
84
+ get(
85
+ options?: EmergingIssuesGetOptionalParams
86
+ ): Promise<EmergingIssuesGetResponse> {
87
+ return this.client.sendOperationRequest({ options }, getOperationSpec);
74
88
  }
75
89
 
76
90
  /**
77
91
  * Lists Azure services' emerging issues.
78
- * @param nextPageLink The NextLink from the previous successful call to List operation.
79
- * @param [options] The optional parameters
80
- * @returns Promise<Models.EmergingIssuesListNextResponse>
81
- */
82
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.EmergingIssuesListNextResponse>;
83
- /**
84
- * @param nextPageLink The NextLink from the previous successful call to List operation.
85
- * @param callback The callback
92
+ * @param options The options parameters.
86
93
  */
87
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.EmergingIssueListResult>): void;
94
+ private _list(
95
+ options?: EmergingIssuesListOptionalParams
96
+ ): Promise<EmergingIssuesListResponse> {
97
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
98
+ }
99
+
88
100
  /**
89
- * @param nextPageLink The NextLink from the previous successful call to List operation.
90
- * @param options The optional parameters
91
- * @param callback The callback
101
+ * ListNext
102
+ * @param nextLink The nextLink from the previous successful call to the List method.
103
+ * @param options The options parameters.
92
104
  */
93
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EmergingIssueListResult>): void;
94
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.EmergingIssueListResult>, callback?: msRest.ServiceCallback<Models.EmergingIssueListResult>): Promise<Models.EmergingIssuesListNextResponse> {
105
+ private _listNext(
106
+ nextLink: string,
107
+ options?: EmergingIssuesListNextOptionalParams
108
+ ): Promise<EmergingIssuesListNextResponse> {
95
109
  return this.client.sendOperationRequest(
96
- {
97
- nextPageLink,
98
- options
99
- },
100
- listNextOperationSpec,
101
- callback) as Promise<Models.EmergingIssuesListNextResponse>;
110
+ { nextLink, options },
111
+ listNextOperationSpec
112
+ );
102
113
  }
103
114
  }
104
-
105
115
  // Operation Specifications
106
- const serializer = new msRest.Serializer(Mappers);
107
- const getOperationSpec: msRest.OperationSpec = {
116
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
117
+
118
+ const getOperationSpec: coreClient.OperationSpec = {
119
+ path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}",
108
120
  httpMethod: "GET",
109
- path: "providers/Microsoft.ResourceHealth/emergingIssues/{issueName}",
110
- urlParameters: [
111
- Parameters.issueName
112
- ],
113
- queryParameters: [
114
- Parameters.apiVersion
115
- ],
116
- headerParameters: [
117
- Parameters.acceptLanguage
118
- ],
119
121
  responses: {
120
122
  200: {
121
123
  bodyMapper: Mappers.EmergingIssuesGetResult
@@ -124,18 +126,14 @@ const getOperationSpec: msRest.OperationSpec = {
124
126
  bodyMapper: Mappers.ErrorResponse
125
127
  }
126
128
  },
129
+ queryParameters: [Parameters.apiVersion],
130
+ urlParameters: [Parameters.$host, Parameters.issueName],
131
+ headerParameters: [Parameters.accept],
127
132
  serializer
128
133
  };
129
-
130
- const listOperationSpec: msRest.OperationSpec = {
134
+ const listOperationSpec: coreClient.OperationSpec = {
135
+ path: "/providers/Microsoft.ResourceHealth/emergingIssues",
131
136
  httpMethod: "GET",
132
- path: "providers/Microsoft.ResourceHealth/emergingIssues",
133
- queryParameters: [
134
- Parameters.apiVersion
135
- ],
136
- headerParameters: [
137
- Parameters.acceptLanguage
138
- ],
139
137
  responses: {
140
138
  200: {
141
139
  bodyMapper: Mappers.EmergingIssueListResult
@@ -144,22 +142,14 @@ const listOperationSpec: msRest.OperationSpec = {
144
142
  bodyMapper: Mappers.ErrorResponse
145
143
  }
146
144
  },
145
+ queryParameters: [Parameters.apiVersion],
146
+ urlParameters: [Parameters.$host],
147
+ headerParameters: [Parameters.accept],
147
148
  serializer
148
149
  };
149
-
150
- const listNextOperationSpec: msRest.OperationSpec = {
151
- httpMethod: "GET",
152
- baseUrl: "https://management.azure.com",
150
+ const listNextOperationSpec: coreClient.OperationSpec = {
153
151
  path: "{nextLink}",
154
- urlParameters: [
155
- Parameters.nextPageLink
156
- ],
157
- queryParameters: [
158
- Parameters.apiVersion
159
- ],
160
- headerParameters: [
161
- Parameters.acceptLanguage
162
- ],
152
+ httpMethod: "GET",
163
153
  responses: {
164
154
  200: {
165
155
  bodyMapper: Mappers.EmergingIssueListResult
@@ -168,5 +158,8 @@ const listNextOperationSpec: msRest.OperationSpec = {
168
158
  bodyMapper: Mappers.ErrorResponse
169
159
  }
170
160
  },
161
+ queryParameters: [Parameters.apiVersion],
162
+ urlParameters: [Parameters.$host, Parameters.nextLink],
163
+ headerParameters: [Parameters.accept],
171
164
  serializer
172
165
  };
@@ -3,8 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
9
  export * from "./availabilityStatuses";
@@ -3,23 +3,26 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as Models from "../models";
12
- import * as Mappers from "../models/operationsMappers";
9
+ import { Operations } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
13
12
  import * as Parameters from "../models/parameters";
14
13
  import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
14
+ import {
15
+ OperationsListOptionalParams,
16
+ OperationsListResponse
17
+ } from "../models";
15
18
 
16
- /** Class representing a Operations. */
17
- export class Operations {
19
+ /** Class containing Operations operations. */
20
+ export class OperationsImpl implements Operations {
18
21
  private readonly client: MicrosoftResourceHealthContext;
19
22
 
20
23
  /**
21
- * Create a Operations.
22
- * @param {MicrosoftResourceHealthContext} client Reference to the service client.
24
+ * Initialize a new instance of the class Operations class.
25
+ * @param client Reference to the service client
23
26
  */
24
27
  constructor(client: MicrosoftResourceHealthContext) {
25
28
  this.client = client;
@@ -27,40 +30,20 @@ export class Operations {
27
30
 
28
31
  /**
29
32
  * Lists available operations for the resourcehealth resource provider
30
- * @param [options] The optional parameters
31
- * @returns Promise<Models.OperationsListResponse>
33
+ * @param options The options parameters.
32
34
  */
33
- list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
34
- /**
35
- * @param callback The callback
36
- */
37
- list(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
38
- /**
39
- * @param options The optional parameters
40
- * @param callback The callback
41
- */
42
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
43
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.OperationsListResponse> {
44
- return this.client.sendOperationRequest(
45
- {
46
- options
47
- },
48
- listOperationSpec,
49
- callback) as Promise<Models.OperationsListResponse>;
35
+ list(
36
+ options?: OperationsListOptionalParams
37
+ ): Promise<OperationsListResponse> {
38
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
50
39
  }
51
40
  }
52
-
53
41
  // Operation Specifications
54
- const serializer = new msRest.Serializer(Mappers);
55
- const listOperationSpec: msRest.OperationSpec = {
42
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
43
+
44
+ const listOperationSpec: coreClient.OperationSpec = {
45
+ path: "/providers/Microsoft.ResourceHealth/operations",
56
46
  httpMethod: "GET",
57
- path: "providers/Microsoft.ResourceHealth/operations",
58
- queryParameters: [
59
- Parameters.apiVersion
60
- ],
61
- headerParameters: [
62
- Parameters.acceptLanguage
63
- ],
64
47
  responses: {
65
48
  200: {
66
49
  bodyMapper: Mappers.OperationListResult
@@ -69,5 +52,8 @@ const listOperationSpec: msRest.OperationSpec = {
69
52
  bodyMapper: Mappers.ErrorResponse
70
53
  }
71
54
  },
55
+ queryParameters: [Parameters.apiVersion],
56
+ urlParameters: [Parameters.$host],
57
+ headerParameters: [Parameters.accept],
72
58
  serializer
73
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
+ }
@@ -0,0 +1,43 @@
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
+ ChildAvailabilityStatusesListOptionalParams,
13
+ ChildAvailabilityStatusesGetByResourceOptionalParams,
14
+ ChildAvailabilityStatusesGetByResourceResponse
15
+ } from "../models";
16
+
17
+ /// <reference lib="esnext.asynciterable" />
18
+ /** Interface representing a ChildAvailabilityStatuses. */
19
+ export interface ChildAvailabilityStatuses {
20
+ /**
21
+ * Lists the historical availability statuses for a single child resource. Use the nextLink property in
22
+ * the response to get the next page of availability status
23
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
24
+ * type. Currently the API only support one nesting level resource types :
25
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
26
+ * @param options The options parameters.
27
+ */
28
+ list(
29
+ resourceUri: string,
30
+ options?: ChildAvailabilityStatusesListOptionalParams
31
+ ): PagedAsyncIterableIterator<AvailabilityStatus>;
32
+ /**
33
+ * Gets current availability status for a single resource
34
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
35
+ * type. Currently the API only support one nesting level resource types :
36
+ * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
37
+ * @param options The options parameters.
38
+ */
39
+ getByResource(
40
+ resourceUri: string,
41
+ options?: ChildAvailabilityStatusesGetByResourceOptionalParams
42
+ ): Promise<ChildAvailabilityStatusesGetByResourceResponse>;
43
+ }
@@ -0,0 +1,30 @@
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
+ ChildResourcesListOptionalParams
13
+ } from "../models";
14
+
15
+ /// <reference lib="esnext.asynciterable" />
16
+ /** Interface representing a ChildResources. */
17
+ export interface ChildResources {
18
+ /**
19
+ * Lists the all the children and its current health status for a parent resource. Use the nextLink
20
+ * property in the response to get the next page of children current health
21
+ * @param resourceUri The fully qualified ID of the resource, including the resource name and resource
22
+ * type. Currently the API only support not nested parent resource type:
23
+ * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
24
+ * @param options The options parameters.
25
+ */
26
+ list(
27
+ resourceUri: string,
28
+ options?: ChildResourcesListOptionalParams
29
+ ): PagedAsyncIterableIterator<AvailabilityStatus>;
30
+ }
@@ -0,0 +1,34 @@
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
+ EmergingIssuesGetResult,
12
+ EmergingIssuesListOptionalParams,
13
+ EmergingIssuesGetOptionalParams,
14
+ EmergingIssuesGetResponse
15
+ } from "../models";
16
+
17
+ /// <reference lib="esnext.asynciterable" />
18
+ /** Interface representing a EmergingIssues. */
19
+ export interface EmergingIssues {
20
+ /**
21
+ * Lists Azure services' emerging issues.
22
+ * @param options The options parameters.
23
+ */
24
+ list(
25
+ options?: EmergingIssuesListOptionalParams
26
+ ): PagedAsyncIterableIterator<EmergingIssuesGetResult>;
27
+ /**
28
+ * Gets Azure services' emerging issues.
29
+ * @param options The options parameters.
30
+ */
31
+ get(
32
+ options?: EmergingIssuesGetOptionalParams
33
+ ): Promise<EmergingIssuesGetResponse>;
34
+ }
@@ -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,21 @@
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 {
10
+ OperationsListOptionalParams,
11
+ OperationsListResponse
12
+ } from "../models";
13
+
14
+ /** Interface representing a Operations. */
15
+ export interface Operations {
16
+ /**
17
+ * Lists available operations for the resourcehealth resource provider
18
+ * @param options The options parameters.
19
+ */
20
+ list(options?: OperationsListOptionalParams): Promise<OperationsListResponse>;
21
+ }
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "es6",
4
4
  "moduleResolution": "node",
5
5
  "strict": true,
6
- "target": "es5",
6
+ "target": "es6",
7
7
  "sourceMap": true,
8
8
  "declarationMap": true,
9
9
  "esModuleInterop": true,
@@ -11,9 +11,9 @@
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "lib": ["es6", "dom"],
13
13
  "declaration": true,
14
- "outDir": "./esm",
14
+ "outDir": "./dist-esm",
15
15
  "importHelpers": true
16
16
  },
17
- "include": ["./src/**/*.ts"],
17
+ "include": ["./src/**/*.ts", "./test/**/*.ts"],
18
18
  "exclude": ["node_modules"]
19
19
  }