@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.
- package/CHANGELOG.md +14 -0
- package/{LICENSE.txt → LICENSE} +1 -1
- package/README.md +70 -82
- package/dist/index.js +1811 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/src/index.d.ts +6 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/microsoftResourceHealth.d.ts +20 -0
- package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -0
- package/dist-esm/src/microsoftResourceHealth.js +27 -0
- package/dist-esm/src/microsoftResourceHealth.js.map +1 -0
- package/dist-esm/src/microsoftResourceHealthContext.d.ts +17 -0
- package/dist-esm/src/microsoftResourceHealthContext.d.ts.map +1 -0
- package/dist-esm/src/microsoftResourceHealthContext.js +50 -0
- package/dist-esm/src/microsoftResourceHealthContext.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +402 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +22 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +21 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +233 -309
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +12 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +44 -39
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/availabilityStatuses.d.ts +102 -0
- package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operations/availabilityStatuses.js +407 -0
- package/dist-esm/src/operations/availabilityStatuses.js.map +1 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.d.ts +51 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.js +173 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.js.map +1 -0
- package/dist-esm/src/operations/childResources.d.ts +43 -0
- package/dist-esm/src/operations/childResources.d.ts.map +1 -0
- package/dist-esm/src/operations/childResources.js +143 -0
- package/dist-esm/src/operations/childResources.js.map +1 -0
- package/dist-esm/src/operations/emergingIssues.d.ts +37 -0
- package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -0
- package/dist-esm/src/operations/emergingIssues.js +143 -0
- package/dist-esm/src/operations/emergingIssues.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +1 -2
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +18 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +46 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +40 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -0
- package/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/availabilityStatuses.js} +2 -7
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts +23 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts.map +1 -0
- package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js} +2 -2
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/childResources.d.ts +15 -0
- package/dist-esm/src/operationsInterfaces/childResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/childResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/childResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +16 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.js +9 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +10 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/{esm/models/index.js → dist-esm/src/operationsInterfaces/operations.js} +2 -1
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +63 -32
- package/review/arm-resourcehealth.api.md +396 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +13 -0
- package/src/microsoftResourceHealth.ts +38 -41
- package/src/microsoftResourceHealthContext.ts +47 -44
- package/src/models/index.ts +322 -878
- package/src/models/mappers.ts +232 -320
- package/src/models/parameters.ts +58 -40
- package/src/operations/availabilityStatuses.ts +325 -276
- package/src/operations/childAvailabilityStatuses.ts +137 -130
- package/src/operations/childResources.ts +109 -85
- package/src/operations/emergingIssues.ts +96 -103
- package/src/operations/index.ts +1 -2
- package/src/operations/operations.ts +24 -38
- package/src/operationsInterfaces/availabilityStatuses.ts +67 -0
- package/src/operationsInterfaces/childAvailabilityStatuses.ts +43 -0
- package/src/operationsInterfaces/childResources.ts +30 -0
- package/src/operationsInterfaces/emergingIssues.ts +34 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +21 -0
- package/tsconfig.json +3 -3
- package/types/arm-resourcehealth.d.ts +588 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-resourcehealth.js +0 -1743
- package/dist/arm-resourcehealth.js.map +0 -1
- package/dist/arm-resourcehealth.min.js +0 -1
- package/dist/arm-resourcehealth.min.js.map +0 -1
- package/esm/microsoftResourceHealth.d.ts +0 -29
- package/esm/microsoftResourceHealth.d.ts.map +0 -1
- package/esm/microsoftResourceHealth.js +0 -42
- package/esm/microsoftResourceHealth.js.map +0 -1
- package/esm/microsoftResourceHealthContext.d.ts +0 -23
- package/esm/microsoftResourceHealthContext.d.ts.map +0 -1
- package/esm/microsoftResourceHealthContext.js +0 -61
- package/esm/microsoftResourceHealthContext.js.map +0 -1
- package/esm/models/availabilityStatusesMappers.d.ts +0 -2
- package/esm/models/availabilityStatusesMappers.d.ts.map +0 -1
- package/esm/models/availabilityStatusesMappers.js +0 -9
- package/esm/models/availabilityStatusesMappers.js.map +0 -1
- package/esm/models/childAvailabilityStatusesMappers.d.ts +0 -2
- package/esm/models/childAvailabilityStatusesMappers.d.ts.map +0 -1
- package/esm/models/childAvailabilityStatusesMappers.js +0 -9
- package/esm/models/childAvailabilityStatusesMappers.js.map +0 -1
- package/esm/models/childResourcesMappers.d.ts +0 -2
- package/esm/models/childResourcesMappers.d.ts.map +0 -1
- package/esm/models/childResourcesMappers.js +0 -9
- package/esm/models/childResourcesMappers.js.map +0 -1
- package/esm/models/emergingIssuesMappers.d.ts +0 -2
- package/esm/models/emergingIssuesMappers.d.ts.map +0 -1
- package/esm/models/emergingIssuesMappers.js +0 -9
- package/esm/models/emergingIssuesMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -957
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -26
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -11
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/availabilityStatuses.d.ts +0 -166
- package/esm/operations/availabilityStatuses.d.ts.map +0 -1
- package/esm/operations/availabilityStatuses.js +0 -239
- package/esm/operations/availabilityStatuses.js.map +0 -1
- package/esm/operations/childAvailabilityStatuses.d.ts +0 -81
- package/esm/operations/childAvailabilityStatuses.d.ts.map +0 -1
- package/esm/operations/childAvailabilityStatuses.js +0 -117
- package/esm/operations/childAvailabilityStatuses.js.map +0 -1
- package/esm/operations/childResources.d.ts +0 -57
- package/esm/operations/childResources.d.ts.map +0 -1
- package/esm/operations/childResources.js +0 -87
- package/esm/operations/childResources.js.map +0 -1
- package/esm/operations/emergingIssues.d.ts +0 -61
- package/esm/operations/emergingIssues.d.ts.map +0 -1
- package/esm/operations/emergingIssues.js +0 -106
- package/esm/operations/emergingIssues.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -28
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -50
- package/esm/operations/operations.js.map +0 -1
- package/src/models/availabilityStatusesMappers.ts +0 -19
- package/src/models/childAvailabilityStatusesMappers.ts +0 -19
- package/src/models/childResourcesMappers.ts +0 -19
- package/src/models/emergingIssuesMappers.ts +0 -22
@@ -3,143 +3,149 @@
|
|
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
|
11
|
-
import
|
12
|
-
import * as
|
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
13
|
import * as Parameters from "../models/parameters";
|
14
14
|
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
|
15
|
+
import {
|
16
|
+
AvailabilityStatus,
|
17
|
+
ChildAvailabilityStatusesListNextOptionalParams,
|
18
|
+
ChildAvailabilityStatusesListOptionalParams,
|
19
|
+
ChildAvailabilityStatusesGetByResourceOptionalParams,
|
20
|
+
ChildAvailabilityStatusesGetByResourceResponse,
|
21
|
+
ChildAvailabilityStatusesListResponse,
|
22
|
+
ChildAvailabilityStatusesListNextResponse
|
23
|
+
} from "../models";
|
15
24
|
|
16
|
-
|
17
|
-
|
25
|
+
/// <reference lib="esnext.asynciterable" />
|
26
|
+
/** Class containing ChildAvailabilityStatuses operations. */
|
27
|
+
export class ChildAvailabilityStatusesImpl
|
28
|
+
implements ChildAvailabilityStatuses {
|
18
29
|
private readonly client: MicrosoftResourceHealthContext;
|
19
30
|
|
20
31
|
/**
|
21
|
-
*
|
22
|
-
* @param
|
32
|
+
* Initialize a new instance of the class ChildAvailabilityStatuses class.
|
33
|
+
* @param client Reference to the service client
|
23
34
|
*/
|
24
35
|
constructor(client: MicrosoftResourceHealthContext) {
|
25
36
|
this.client = client;
|
26
37
|
}
|
27
38
|
|
28
39
|
/**
|
29
|
-
*
|
30
|
-
*
|
31
|
-
*
|
32
|
-
*
|
33
|
-
*
|
34
|
-
* @
|
35
|
-
*/
|
36
|
-
getByResource(resourceUri: string, options?: Models.ChildAvailabilityStatusesGetByResourceOptionalParams): Promise<Models.ChildAvailabilityStatusesGetByResourceResponse>;
|
37
|
-
/**
|
38
|
-
* @param resourceUri The fully qualified ID of the resource, including the resource name and
|
39
|
-
* resource type. Currently the API only support one nesting level resource types :
|
40
|
-
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
41
|
-
* @param callback The callback
|
42
|
-
*/
|
43
|
-
getByResource(resourceUri: string, callback: msRest.ServiceCallback<Models.AvailabilityStatus>): void;
|
44
|
-
/**
|
45
|
-
* @param resourceUri The fully qualified ID of the resource, including the resource name and
|
46
|
-
* resource type. Currently the API only support one nesting level resource types :
|
47
|
-
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
48
|
-
* @param options The optional parameters
|
49
|
-
* @param callback The callback
|
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.
|
50
46
|
*/
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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();
|
57
55
|
},
|
58
|
-
|
59
|
-
|
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
|
+
}
|
60
86
|
}
|
61
87
|
|
62
88
|
/**
|
63
|
-
*
|
64
|
-
*
|
65
|
-
*
|
66
|
-
*
|
67
|
-
*
|
68
|
-
* @param [options] The optional parameters
|
69
|
-
* @returns Promise<Models.ChildAvailabilityStatusesListResponse>
|
70
|
-
*/
|
71
|
-
list(resourceUri: string, options?: Models.ChildAvailabilityStatusesListOptionalParams): Promise<Models.ChildAvailabilityStatusesListResponse>;
|
72
|
-
/**
|
73
|
-
* @param resourceUri The fully qualified ID of the resource, including the resource name and
|
74
|
-
* resource type. Currently the API only support one nesting level resource types :
|
75
|
-
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
76
|
-
* @param callback The callback
|
77
|
-
*/
|
78
|
-
list(resourceUri: string, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
|
79
|
-
/**
|
80
|
-
* @param resourceUri The fully qualified ID of the resource, including the resource name and
|
81
|
-
* resource type. Currently the API only support one nesting level resource types :
|
82
|
-
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
|
83
|
-
* @param options The optional parameters
|
84
|
-
* @param callback The callback
|
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.
|
85
94
|
*/
|
86
|
-
|
87
|
-
|
95
|
+
getByResource(
|
96
|
+
resourceUri: string,
|
97
|
+
options?: ChildAvailabilityStatusesGetByResourceOptionalParams
|
98
|
+
): Promise<ChildAvailabilityStatusesGetByResourceResponse> {
|
88
99
|
return this.client.sendOperationRequest(
|
89
|
-
{
|
90
|
-
|
91
|
-
|
92
|
-
},
|
93
|
-
listOperationSpec,
|
94
|
-
callback) as Promise<Models.ChildAvailabilityStatusesListResponse>;
|
100
|
+
{ resourceUri, options },
|
101
|
+
getByResourceOperationSpec
|
102
|
+
);
|
95
103
|
}
|
96
104
|
|
97
105
|
/**
|
98
|
-
* Lists the historical availability statuses for a single child resource. Use the nextLink
|
99
|
-
*
|
100
|
-
* @param
|
101
|
-
*
|
102
|
-
*
|
103
|
-
|
104
|
-
listNext(nextPageLink: string, options?: Models.ChildAvailabilityStatusesListNextOptionalParams): Promise<Models.ChildAvailabilityStatusesListNextResponse>;
|
105
|
-
/**
|
106
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
107
|
-
* @param callback The callback
|
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.
|
108
112
|
*/
|
109
|
-
|
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
|
+
|
110
123
|
/**
|
111
|
-
*
|
112
|
-
* @param
|
113
|
-
*
|
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.
|
114
130
|
*/
|
115
|
-
|
116
|
-
|
131
|
+
private _listNext(
|
132
|
+
resourceUri: string,
|
133
|
+
nextLink: string,
|
134
|
+
options?: ChildAvailabilityStatusesListNextOptionalParams
|
135
|
+
): Promise<ChildAvailabilityStatusesListNextResponse> {
|
117
136
|
return this.client.sendOperationRequest(
|
118
|
-
{
|
119
|
-
|
120
|
-
|
121
|
-
},
|
122
|
-
listNextOperationSpec,
|
123
|
-
callback) as Promise<Models.ChildAvailabilityStatusesListNextResponse>;
|
137
|
+
{ resourceUri, nextLink, options },
|
138
|
+
listNextOperationSpec
|
139
|
+
);
|
124
140
|
}
|
125
141
|
}
|
126
|
-
|
127
142
|
// Operation Specifications
|
128
|
-
const serializer =
|
129
|
-
|
143
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
144
|
+
|
145
|
+
const getByResourceOperationSpec: coreClient.OperationSpec = {
|
146
|
+
path:
|
147
|
+
"/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current",
|
130
148
|
httpMethod: "GET",
|
131
|
-
path: "{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current",
|
132
|
-
urlParameters: [
|
133
|
-
Parameters.resourceUri
|
134
|
-
],
|
135
|
-
queryParameters: [
|
136
|
-
Parameters.apiVersion,
|
137
|
-
Parameters.filter,
|
138
|
-
Parameters.expand
|
139
|
-
],
|
140
|
-
headerParameters: [
|
141
|
-
Parameters.acceptLanguage
|
142
|
-
],
|
143
149
|
responses: {
|
144
150
|
200: {
|
145
151
|
bodyMapper: Mappers.AvailabilityStatus
|
@@ -148,23 +154,19 @@ const getByResourceOperationSpec: msRest.OperationSpec = {
|
|
148
154
|
bodyMapper: Mappers.ErrorResponse
|
149
155
|
}
|
150
156
|
},
|
151
|
-
serializer
|
152
|
-
};
|
153
|
-
|
154
|
-
const listOperationSpec: msRest.OperationSpec = {
|
155
|
-
httpMethod: "GET",
|
156
|
-
path: "{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses",
|
157
|
-
urlParameters: [
|
158
|
-
Parameters.resourceUri
|
159
|
-
],
|
160
157
|
queryParameters: [
|
161
158
|
Parameters.apiVersion,
|
162
159
|
Parameters.filter,
|
163
160
|
Parameters.expand
|
164
161
|
],
|
165
|
-
|
166
|
-
|
167
|
-
|
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",
|
168
170
|
responses: {
|
169
171
|
200: {
|
170
172
|
bodyMapper: Mappers.AvailabilityStatusListResult
|
@@ -173,24 +175,18 @@ const listOperationSpec: msRest.OperationSpec = {
|
|
173
175
|
bodyMapper: Mappers.ErrorResponse
|
174
176
|
}
|
175
177
|
},
|
176
|
-
serializer
|
177
|
-
};
|
178
|
-
|
179
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
180
|
-
httpMethod: "GET",
|
181
|
-
baseUrl: "https://management.azure.com",
|
182
|
-
path: "{nextLink}",
|
183
|
-
urlParameters: [
|
184
|
-
Parameters.nextPageLink
|
185
|
-
],
|
186
178
|
queryParameters: [
|
187
179
|
Parameters.apiVersion,
|
188
180
|
Parameters.filter,
|
189
181
|
Parameters.expand
|
190
182
|
],
|
191
|
-
|
192
|
-
|
193
|
-
|
183
|
+
urlParameters: [Parameters.$host, Parameters.resourceUri],
|
184
|
+
headerParameters: [Parameters.accept],
|
185
|
+
serializer
|
186
|
+
};
|
187
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
188
|
+
path: "{nextLink}",
|
189
|
+
httpMethod: "GET",
|
194
190
|
responses: {
|
195
191
|
200: {
|
196
192
|
bodyMapper: Mappers.AvailabilityStatusListResult
|
@@ -199,5 +195,16 @@ const listNextOperationSpec: msRest.OperationSpec = {
|
|
199
195
|
bodyMapper: Mappers.ErrorResponse
|
200
196
|
}
|
201
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],
|
202
209
|
serializer
|
203
210
|
};
|
@@ -3,23 +3,31 @@
|
|
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
|
11
|
-
import
|
12
|
-
import * as
|
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
13
|
import * as Parameters from "../models/parameters";
|
14
14
|
import { MicrosoftResourceHealthContext } from "../microsoftResourceHealthContext";
|
15
|
+
import {
|
16
|
+
AvailabilityStatus,
|
17
|
+
ChildResourcesListNextOptionalParams,
|
18
|
+
ChildResourcesListOptionalParams,
|
19
|
+
ChildResourcesListResponse,
|
20
|
+
ChildResourcesListNextResponse
|
21
|
+
} from "../models";
|
15
22
|
|
16
|
-
|
17
|
-
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
24
|
+
/** Class containing ChildResources operations. */
|
25
|
+
export class ChildResourcesImpl implements ChildResources {
|
18
26
|
private readonly client: MicrosoftResourceHealthContext;
|
19
27
|
|
20
28
|
/**
|
21
|
-
*
|
22
|
-
* @param
|
29
|
+
* Initialize a new instance of the class ChildResources class.
|
30
|
+
* @param client Reference to the service client
|
23
31
|
*/
|
24
32
|
constructor(client: MicrosoftResourceHealthContext) {
|
25
33
|
this.client = client;
|
@@ -28,84 +36,95 @@ export class ChildResources {
|
|
28
36
|
/**
|
29
37
|
* Lists the all the children and its current health status for a parent resource. Use the nextLink
|
30
38
|
* property in the response to get the next page of children current health
|
31
|
-
* @param resourceUri The fully qualified ID of the resource, including the resource name and
|
32
|
-
*
|
33
|
-
*
|
34
|
-
* @param
|
35
|
-
* @returns Promise<Models.ChildResourcesListResponse>
|
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.
|
36
43
|
*/
|
37
|
-
list(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
* /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
|
49
|
-
* @param options The optional parameters
|
50
|
-
* @param callback The callback
|
51
|
-
*/
|
52
|
-
list(resourceUri: string, options: Models.ChildResourcesListOptionalParams, callback: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): void;
|
53
|
-
list(resourceUri: string, options?: Models.ChildResourcesListOptionalParams | msRest.ServiceCallback<Models.AvailabilityStatusListResult>, callback?: msRest.ServiceCallback<Models.AvailabilityStatusListResult>): Promise<Models.ChildResourcesListResponse> {
|
54
|
-
return this.client.sendOperationRequest(
|
55
|
-
{
|
56
|
-
resourceUri,
|
57
|
-
options
|
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;
|
58
55
|
},
|
59
|
-
|
60
|
-
|
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
|
+
}
|
61
83
|
}
|
62
84
|
|
63
85
|
/**
|
64
86
|
* Lists the all the children and its current health status for a parent resource. Use the nextLink
|
65
87
|
* property in the response to get the next page of children current health
|
66
|
-
* @param
|
67
|
-
*
|
68
|
-
*
|
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.
|
69
92
|
*/
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
+
|
76
103
|
/**
|
77
|
-
*
|
78
|
-
* @param
|
79
|
-
*
|
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.
|
80
110
|
*/
|
81
|
-
|
82
|
-
|
111
|
+
private _listNext(
|
112
|
+
resourceUri: string,
|
113
|
+
nextLink: string,
|
114
|
+
options?: ChildResourcesListNextOptionalParams
|
115
|
+
): Promise<ChildResourcesListNextResponse> {
|
83
116
|
return this.client.sendOperationRequest(
|
84
|
-
{
|
85
|
-
|
86
|
-
|
87
|
-
},
|
88
|
-
listNextOperationSpec,
|
89
|
-
callback) as Promise<Models.ChildResourcesListNextResponse>;
|
117
|
+
{ resourceUri, nextLink, options },
|
118
|
+
listNextOperationSpec
|
119
|
+
);
|
90
120
|
}
|
91
121
|
}
|
92
|
-
|
93
122
|
// Operation Specifications
|
94
|
-
const serializer =
|
95
|
-
|
123
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
124
|
+
|
125
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
126
|
+
path: "/{resourceUri}/providers/Microsoft.ResourceHealth/childResources",
|
96
127
|
httpMethod: "GET",
|
97
|
-
path: "{resourceUri}/providers/Microsoft.ResourceHealth/childResources",
|
98
|
-
urlParameters: [
|
99
|
-
Parameters.resourceUri
|
100
|
-
],
|
101
|
-
queryParameters: [
|
102
|
-
Parameters.apiVersion,
|
103
|
-
Parameters.filter,
|
104
|
-
Parameters.expand
|
105
|
-
],
|
106
|
-
headerParameters: [
|
107
|
-
Parameters.acceptLanguage
|
108
|
-
],
|
109
128
|
responses: {
|
110
129
|
200: {
|
111
130
|
bodyMapper: Mappers.AvailabilityStatusListResult
|
@@ -114,24 +133,18 @@ const listOperationSpec: msRest.OperationSpec = {
|
|
114
133
|
bodyMapper: Mappers.ErrorResponse
|
115
134
|
}
|
116
135
|
},
|
117
|
-
serializer
|
118
|
-
};
|
119
|
-
|
120
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
121
|
-
httpMethod: "GET",
|
122
|
-
baseUrl: "https://management.azure.com",
|
123
|
-
path: "{nextLink}",
|
124
|
-
urlParameters: [
|
125
|
-
Parameters.nextPageLink
|
126
|
-
],
|
127
136
|
queryParameters: [
|
128
137
|
Parameters.apiVersion,
|
129
138
|
Parameters.filter,
|
130
139
|
Parameters.expand
|
131
140
|
],
|
132
|
-
|
133
|
-
|
134
|
-
|
141
|
+
urlParameters: [Parameters.$host, Parameters.resourceUri],
|
142
|
+
headerParameters: [Parameters.accept],
|
143
|
+
serializer
|
144
|
+
};
|
145
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
146
|
+
path: "{nextLink}",
|
147
|
+
httpMethod: "GET",
|
135
148
|
responses: {
|
136
149
|
200: {
|
137
150
|
bodyMapper: Mappers.AvailabilityStatusListResult
|
@@ -140,5 +153,16 @@ const listNextOperationSpec: msRest.OperationSpec = {
|
|
140
153
|
bodyMapper: Mappers.ErrorResponse
|
141
154
|
}
|
142
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],
|
143
167
|
serializer
|
144
168
|
};
|