@azure/arm-policyinsights 3.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/{LICENSE.txt → LICENSE} +2 -2
- package/README.md +72 -79
- package/dist/index.js +8639 -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 +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +1870 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +50 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +60 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +1336 -589
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +42 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +202 -166
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/attestations.d.ts +161 -0
- package/dist-esm/src/operations/attestations.d.ts.map +1 -0
- package/dist-esm/src/operations/attestations.js +747 -0
- package/dist-esm/src/operations/attestations.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +2 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +5 -5
- 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/operations/policyEvents.d.ts +208 -0
- package/dist-esm/src/operations/policyEvents.d.ts.map +1 -0
- package/dist-esm/src/operations/policyEvents.js +1097 -0
- package/dist-esm/src/operations/policyEvents.js.map +1 -0
- package/dist-esm/src/operations/policyMetadataOperations.d.ts +38 -0
- package/dist-esm/src/operations/policyMetadataOperations.d.ts.map +1 -0
- package/dist-esm/src/operations/policyMetadataOperations.js +144 -0
- package/dist-esm/src/operations/policyMetadataOperations.js.map +1 -0
- package/dist-esm/src/operations/policyRestrictions.d.ts +27 -0
- package/dist-esm/src/operations/policyRestrictions.d.ts.map +1 -0
- package/dist-esm/src/operations/policyRestrictions.js +81 -0
- package/dist-esm/src/operations/policyRestrictions.js.map +1 -0
- package/dist-esm/src/operations/policyStates.d.ts +361 -0
- package/dist-esm/src/operations/policyStates.d.ts.map +1 -0
- package/dist-esm/src/operations/policyStates.js +1632 -0
- package/dist-esm/src/operations/policyStates.js.map +1 -0
- package/dist-esm/src/operations/policyTrackedResources.d.ts +99 -0
- package/dist-esm/src/operations/policyTrackedResources.d.ts.map +1 -0
- package/dist-esm/src/operations/policyTrackedResources.js +458 -0
- package/dist-esm/src/operations/policyTrackedResources.js.map +1 -0
- package/dist-esm/src/operations/remediations.d.ts +304 -0
- package/dist-esm/src/operations/remediations.d.ts.map +1 -0
- package/dist-esm/src/operations/remediations.js +1377 -0
- package/dist-esm/src/operations/remediations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/attestations.d.ts +110 -0
- package/dist-esm/src/operationsInterfaces/attestations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/attestations.js +9 -0
- package/dist-esm/src/operationsInterfaces/attestations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +9 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +16 -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/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyEvents.d.ts +60 -0
- package/dist-esm/src/operationsInterfaces/policyEvents.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyEvents.js +9 -0
- package/dist-esm/src/operationsInterfaces/policyEvents.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyMetadataOperations.d.ts +17 -0
- package/dist-esm/src/operationsInterfaces/policyMetadataOperations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyMetadataOperations.js +9 -0
- package/dist-esm/src/operationsInterfaces/policyMetadataOperations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyRestrictions.d.ts +19 -0
- package/dist-esm/src/operationsInterfaces/policyRestrictions.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyRestrictions.js +9 -0
- package/dist-esm/src/operationsInterfaces/policyRestrictions.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyStates.d.ts +165 -0
- package/dist-esm/src/operationsInterfaces/policyStates.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyStates.js +9 -0
- package/dist-esm/src/operationsInterfaces/policyStates.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyTrackedResources.d.ts +29 -0
- package/dist-esm/src/operationsInterfaces/policyTrackedResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/policyTrackedResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/policyTrackedResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/remediations.d.ts +168 -0
- package/dist-esm/src/operationsInterfaces/remediations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/remediations.js +9 -0
- package/dist-esm/src/operationsInterfaces/remediations.js.map +1 -0
- package/dist-esm/src/policyInsightsClient.d.ts +24 -0
- package/dist-esm/src/policyInsightsClient.d.ts.map +1 -0
- package/dist-esm/src/policyInsightsClient.js +57 -0
- package/dist-esm/src/policyInsightsClient.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 +82 -22
- package/review/arm-policyinsights.api.md +1525 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1645 -2293
- package/src/models/mappers.ts +1579 -795
- package/src/models/parameters.ts +250 -167
- package/src/operations/attestations.ts +999 -0
- package/src/operations/index.ts +5 -5
- package/src/operations/operations.ts +29 -44
- package/src/operations/policyEvents.ts +1158 -327
- package/src/operations/policyMetadataOperations.ts +108 -113
- package/src/operations/policyRestrictions.ts +111 -0
- package/src/operations/policyStates.ts +1751 -750
- package/src/operations/policyTrackedResources.ts +416 -284
- package/src/operations/remediations.ts +1208 -1248
- package/src/operationsInterfaces/attestations.ts +212 -0
- package/src/operationsInterfaces/index.ts +16 -0
- package/src/operationsInterfaces/operations.ts +21 -0
- package/src/operationsInterfaces/policyEvents.ts +109 -0
- package/src/operationsInterfaces/policyMetadataOperations.ts +36 -0
- package/src/operationsInterfaces/policyRestrictions.ts +40 -0
- package/src/operationsInterfaces/policyStates.ts +287 -0
- package/src/operationsInterfaces/policyTrackedResources.ts +55 -0
- package/src/operationsInterfaces/remediations.ts +310 -0
- package/src/policyInsightsClient.ts +93 -39
- package/tsconfig.json +20 -7
- package/types/arm-policyinsights.d.ts +2728 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-policyinsights.js +0 -4909
- package/dist/arm-policyinsights.js.map +0 -1
- package/dist/arm-policyinsights.min.js +0 -1
- package/dist/arm-policyinsights.min.js.map +0 -1
- package/esm/models/index.d.ts +0 -2651
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -8
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -40
- 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 +0 -9
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -33
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/policyEventsMappers.d.ts +0 -2
- package/esm/models/policyEventsMappers.d.ts.map +0 -1
- package/esm/models/policyEventsMappers.js +0 -9
- package/esm/models/policyEventsMappers.js.map +0 -1
- package/esm/models/policyMetadataOperationsMappers.d.ts +0 -2
- package/esm/models/policyMetadataOperationsMappers.d.ts.map +0 -1
- package/esm/models/policyMetadataOperationsMappers.js +0 -9
- package/esm/models/policyMetadataOperationsMappers.js.map +0 -1
- package/esm/models/policyStatesMappers.d.ts +0 -2
- package/esm/models/policyStatesMappers.d.ts.map +0 -1
- package/esm/models/policyStatesMappers.js +0 -9
- package/esm/models/policyStatesMappers.js.map +0 -1
- package/esm/models/policyTrackedResourcesMappers.d.ts +0 -2
- package/esm/models/policyTrackedResourcesMappers.d.ts.map +0 -1
- package/esm/models/policyTrackedResourcesMappers.js +0 -9
- package/esm/models/policyTrackedResourcesMappers.js.map +0 -1
- package/esm/models/remediationsMappers.d.ts +0 -2
- package/esm/models/remediationsMappers.d.ts.map +0 -1
- package/esm/models/remediationsMappers.js +0 -9
- package/esm/models/remediationsMappers.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 -51
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/policyEvents.d.ts +0 -198
- package/esm/operations/policyEvents.d.ts.map +0 -1
- package/esm/operations/policyEvents.js +0 -365
- package/esm/operations/policyEvents.js.map +0 -1
- package/esm/operations/policyMetadataOperations.d.ts +0 -64
- package/esm/operations/policyMetadataOperations.d.ts.map +0 -1
- package/esm/operations/policyMetadataOperations.js +0 -106
- package/esm/operations/policyMetadataOperations.js.map +0 -1
- package/esm/operations/policyStates.d.ts +0 -442
- package/esm/operations/policyStates.d.ts.map +0 -1
- package/esm/operations/policyStates.js +0 -712
- package/esm/operations/policyStates.js.map +0 -1
- package/esm/operations/policyTrackedResources.d.ts +0 -160
- package/esm/operations/policyTrackedResources.d.ts.map +0 -1
- package/esm/operations/policyTrackedResources.js +0 -258
- package/esm/operations/policyTrackedResources.js.map +0 -1
- package/esm/operations/remediations.d.ts +0 -679
- package/esm/operations/remediations.d.ts.map +0 -1
- package/esm/operations/remediations.js +0 -1014
- package/esm/operations/remediations.js.map +0 -1
- package/esm/policyInsightsClient.d.ts +0 -22
- package/esm/policyInsightsClient.d.ts.map +0 -1
- package/esm/policyInsightsClient.js +0 -37
- package/esm/policyInsightsClient.js.map +0 -1
- package/esm/policyInsightsClientContext.d.ts +0 -13
- package/esm/policyInsightsClientContext.d.ts.map +0 -1
- package/esm/policyInsightsClientContext.js +0 -50
- package/esm/policyInsightsClientContext.js.map +0 -1
- package/src/models/operationsMappers.ts +0 -15
- package/src/models/policyEventsMappers.ts +0 -14
- package/src/models/policyMetadataOperationsMappers.ts +0 -16
- package/src/models/policyStatesMappers.ts +0 -24
- package/src/models/policyTrackedResourcesMappers.ts +0 -16
- package/src/models/remediationsMappers.ts +0 -20
- package/src/policyInsightsClientContext.ts +0 -54
|
@@ -1,175 +1,170 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
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
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { PolicyMetadataOperations } 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
|
-
import {
|
|
14
|
+
import { PolicyInsightsClient } from "../policyInsightsClient";
|
|
15
|
+
import {
|
|
16
|
+
SlimPolicyMetadata,
|
|
17
|
+
PolicyMetadataListNextOptionalParams,
|
|
18
|
+
PolicyMetadataListOptionalParams,
|
|
19
|
+
PolicyMetadataGetResourceOptionalParams,
|
|
20
|
+
PolicyMetadataGetResourceResponse,
|
|
21
|
+
PolicyMetadataListResponse,
|
|
22
|
+
PolicyMetadataListNextResponse
|
|
23
|
+
} from "../models";
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
/// <reference lib="esnext.asynciterable" />
|
|
26
|
+
/** Class containing PolicyMetadataOperations operations. */
|
|
27
|
+
export class PolicyMetadataOperationsImpl implements PolicyMetadataOperations {
|
|
28
|
+
private readonly client: PolicyInsightsClient;
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
31
|
+
* Initialize a new instance of the class PolicyMetadataOperations class.
|
|
32
|
+
* @param client Reference to the service client
|
|
24
33
|
*/
|
|
25
|
-
constructor(client:
|
|
34
|
+
constructor(client: PolicyInsightsClient) {
|
|
26
35
|
this.client = client;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
38
|
/**
|
|
30
|
-
* Get policy metadata
|
|
31
|
-
* @param
|
|
32
|
-
* @param [options] The optional parameters
|
|
33
|
-
* @returns Promise<Models.PolicyMetadataGetResourceResponse>
|
|
34
|
-
*/
|
|
35
|
-
getResource(resourceName: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyMetadataGetResourceResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* @param resourceName The name of the policy metadata resource.
|
|
38
|
-
* @param callback The callback
|
|
39
|
-
*/
|
|
40
|
-
getResource(resourceName: string, callback: msRest.ServiceCallback<Models.PolicyMetadata>): void;
|
|
41
|
-
/**
|
|
42
|
-
* @param resourceName The name of the policy metadata resource.
|
|
43
|
-
* @param options The optional parameters
|
|
44
|
-
* @param callback The callback
|
|
39
|
+
* Get a list of the policy metadata resources.
|
|
40
|
+
* @param options The options parameters.
|
|
45
41
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
public list(
|
|
43
|
+
options?: PolicyMetadataListOptionalParams
|
|
44
|
+
): PagedAsyncIterableIterator<SlimPolicyMetadata> {
|
|
45
|
+
const iter = this.listPagingAll(options);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
byPage: () => {
|
|
54
|
+
return this.listPagingPage(options);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private async *listPagingPage(
|
|
60
|
+
options?: PolicyMetadataListOptionalParams
|
|
61
|
+
): AsyncIterableIterator<SlimPolicyMetadata[]> {
|
|
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?: PolicyMetadataListOptionalParams
|
|
74
|
+
): AsyncIterableIterator<SlimPolicyMetadata> {
|
|
75
|
+
for await (const page of this.listPagingPage(options)) {
|
|
76
|
+
yield* page;
|
|
77
|
+
}
|
|
55
78
|
}
|
|
56
79
|
|
|
57
80
|
/**
|
|
58
|
-
* Get
|
|
59
|
-
* @param
|
|
60
|
-
* @
|
|
61
|
-
*/
|
|
62
|
-
list(options?: Models.PolicyMetadataListOptionalParams): Promise<Models.PolicyMetadataListResponse>;
|
|
63
|
-
/**
|
|
64
|
-
* @param callback The callback
|
|
65
|
-
*/
|
|
66
|
-
list(callback: msRest.ServiceCallback<Models.PolicyMetadataCollection>): void;
|
|
67
|
-
/**
|
|
68
|
-
* @param options The optional parameters
|
|
69
|
-
* @param callback The callback
|
|
81
|
+
* Get policy metadata resource.
|
|
82
|
+
* @param resourceName The name of the policy metadata resource.
|
|
83
|
+
* @param options The options parameters.
|
|
70
84
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
getResource(
|
|
86
|
+
resourceName: string,
|
|
87
|
+
options?: PolicyMetadataGetResourceOptionalParams
|
|
88
|
+
): Promise<PolicyMetadataGetResourceResponse> {
|
|
73
89
|
return this.client.sendOperationRequest(
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
listOperationSpec,
|
|
78
|
-
callback) as Promise<Models.PolicyMetadataListResponse>;
|
|
90
|
+
{ resourceName, options },
|
|
91
|
+
getResourceOperationSpec
|
|
92
|
+
);
|
|
79
93
|
}
|
|
80
94
|
|
|
81
95
|
/**
|
|
82
96
|
* Get a list of the policy metadata resources.
|
|
83
|
-
* @param
|
|
84
|
-
* @param [options] The optional parameters
|
|
85
|
-
* @returns Promise<Models.PolicyMetadataListNextResponse>
|
|
86
|
-
*/
|
|
87
|
-
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyMetadataListNextResponse>;
|
|
88
|
-
/**
|
|
89
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
90
|
-
* @param callback The callback
|
|
97
|
+
* @param options The options parameters.
|
|
91
98
|
*/
|
|
92
|
-
|
|
99
|
+
private _list(
|
|
100
|
+
options?: PolicyMetadataListOptionalParams
|
|
101
|
+
): Promise<PolicyMetadataListResponse> {
|
|
102
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
103
|
+
}
|
|
104
|
+
|
|
93
105
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @param
|
|
96
|
-
* @param
|
|
106
|
+
* ListNext
|
|
107
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
108
|
+
* @param options The options parameters.
|
|
97
109
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
private _listNext(
|
|
111
|
+
nextLink: string,
|
|
112
|
+
options?: PolicyMetadataListNextOptionalParams
|
|
113
|
+
): Promise<PolicyMetadataListNextResponse> {
|
|
100
114
|
return this.client.sendOperationRequest(
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
listNextOperationSpec,
|
|
106
|
-
callback) as Promise<Models.PolicyMetadataListNextResponse>;
|
|
115
|
+
{ nextLink, options },
|
|
116
|
+
listNextOperationSpec
|
|
117
|
+
);
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
|
-
|
|
110
120
|
// Operation Specifications
|
|
111
|
-
const serializer =
|
|
112
|
-
|
|
121
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
122
|
+
|
|
123
|
+
const getResourceOperationSpec: coreClient.OperationSpec = {
|
|
124
|
+
path: "/providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}",
|
|
113
125
|
httpMethod: "GET",
|
|
114
|
-
path: "providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}",
|
|
115
|
-
urlParameters: [
|
|
116
|
-
Parameters.resourceName
|
|
117
|
-
],
|
|
118
|
-
queryParameters: [
|
|
119
|
-
Parameters.apiVersion3
|
|
120
|
-
],
|
|
121
|
-
headerParameters: [
|
|
122
|
-
Parameters.acceptLanguage
|
|
123
|
-
],
|
|
124
126
|
responses: {
|
|
125
127
|
200: {
|
|
126
128
|
bodyMapper: Mappers.PolicyMetadata
|
|
127
129
|
},
|
|
128
130
|
default: {
|
|
129
|
-
bodyMapper: Mappers.
|
|
131
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
130
132
|
}
|
|
131
133
|
},
|
|
134
|
+
queryParameters: [Parameters.apiVersion2],
|
|
135
|
+
urlParameters: [Parameters.$host, Parameters.resourceName],
|
|
136
|
+
headerParameters: [Parameters.accept],
|
|
132
137
|
serializer
|
|
133
138
|
};
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
140
|
+
path: "/providers/Microsoft.PolicyInsights/policyMetadata",
|
|
136
141
|
httpMethod: "GET",
|
|
137
|
-
path: "providers/Microsoft.PolicyInsights/policyMetadata",
|
|
138
|
-
queryParameters: [
|
|
139
|
-
Parameters.apiVersion3,
|
|
140
|
-
Parameters.top
|
|
141
|
-
],
|
|
142
|
-
headerParameters: [
|
|
143
|
-
Parameters.acceptLanguage
|
|
144
|
-
],
|
|
145
142
|
responses: {
|
|
146
143
|
200: {
|
|
147
144
|
bodyMapper: Mappers.PolicyMetadataCollection
|
|
148
145
|
},
|
|
149
146
|
default: {
|
|
150
|
-
bodyMapper: Mappers.
|
|
147
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
151
148
|
}
|
|
152
149
|
},
|
|
150
|
+
queryParameters: [Parameters.top, Parameters.apiVersion2],
|
|
151
|
+
urlParameters: [Parameters.$host],
|
|
152
|
+
headerParameters: [Parameters.accept],
|
|
153
153
|
serializer
|
|
154
154
|
};
|
|
155
|
-
|
|
156
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
|
157
|
-
httpMethod: "GET",
|
|
158
|
-
baseUrl: "https://management.azure.com",
|
|
155
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
159
156
|
path: "{nextLink}",
|
|
160
|
-
|
|
161
|
-
Parameters.nextPageLink
|
|
162
|
-
],
|
|
163
|
-
headerParameters: [
|
|
164
|
-
Parameters.acceptLanguage
|
|
165
|
-
],
|
|
157
|
+
httpMethod: "GET",
|
|
166
158
|
responses: {
|
|
167
159
|
200: {
|
|
168
160
|
bodyMapper: Mappers.PolicyMetadataCollection
|
|
169
161
|
},
|
|
170
162
|
default: {
|
|
171
|
-
bodyMapper: Mappers.
|
|
163
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
172
164
|
}
|
|
173
165
|
},
|
|
166
|
+
queryParameters: [Parameters.top, Parameters.apiVersion2],
|
|
167
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
168
|
+
headerParameters: [Parameters.accept],
|
|
174
169
|
serializer
|
|
175
170
|
};
|
|
@@ -0,0 +1,111 @@
|
|
|
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 { PolicyRestrictions } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { PolicyInsightsClient } from "../policyInsightsClient";
|
|
14
|
+
import {
|
|
15
|
+
CheckRestrictionsRequest,
|
|
16
|
+
PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams,
|
|
17
|
+
PolicyRestrictionsCheckAtSubscriptionScopeResponse,
|
|
18
|
+
PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams,
|
|
19
|
+
PolicyRestrictionsCheckAtResourceGroupScopeResponse
|
|
20
|
+
} from "../models";
|
|
21
|
+
|
|
22
|
+
/** Class containing PolicyRestrictions operations. */
|
|
23
|
+
export class PolicyRestrictionsImpl implements PolicyRestrictions {
|
|
24
|
+
private readonly client: PolicyInsightsClient;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Initialize a new instance of the class PolicyRestrictions class.
|
|
28
|
+
* @param client Reference to the service client
|
|
29
|
+
*/
|
|
30
|
+
constructor(client: PolicyInsightsClient) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Checks what restrictions Azure Policy will place on a resource within a subscription.
|
|
36
|
+
* @param parameters The check policy restrictions parameters.
|
|
37
|
+
* @param options The options parameters.
|
|
38
|
+
*/
|
|
39
|
+
checkAtSubscriptionScope(
|
|
40
|
+
parameters: CheckRestrictionsRequest,
|
|
41
|
+
options?: PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams
|
|
42
|
+
): Promise<PolicyRestrictionsCheckAtSubscriptionScopeResponse> {
|
|
43
|
+
return this.client.sendOperationRequest(
|
|
44
|
+
{ parameters, options },
|
|
45
|
+
checkAtSubscriptionScopeOperationSpec
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checks what restrictions Azure Policy will place on a resource within a resource group. Use this
|
|
51
|
+
* when the resource group the resource will be created in is already known.
|
|
52
|
+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
|
53
|
+
* @param parameters The check policy restrictions parameters.
|
|
54
|
+
* @param options The options parameters.
|
|
55
|
+
*/
|
|
56
|
+
checkAtResourceGroupScope(
|
|
57
|
+
resourceGroupName: string,
|
|
58
|
+
parameters: CheckRestrictionsRequest,
|
|
59
|
+
options?: PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams
|
|
60
|
+
): Promise<PolicyRestrictionsCheckAtResourceGroupScopeResponse> {
|
|
61
|
+
return this.client.sendOperationRequest(
|
|
62
|
+
{ resourceGroupName, parameters, options },
|
|
63
|
+
checkAtResourceGroupScopeOperationSpec
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Operation Specifications
|
|
68
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
69
|
+
|
|
70
|
+
const checkAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = {
|
|
71
|
+
path:
|
|
72
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions",
|
|
73
|
+
httpMethod: "POST",
|
|
74
|
+
responses: {
|
|
75
|
+
200: {
|
|
76
|
+
bodyMapper: Mappers.CheckRestrictionsResult
|
|
77
|
+
},
|
|
78
|
+
default: {
|
|
79
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
requestBody: Parameters.parameters1,
|
|
83
|
+
queryParameters: [Parameters.apiVersion3],
|
|
84
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
85
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
86
|
+
mediaType: "json",
|
|
87
|
+
serializer
|
|
88
|
+
};
|
|
89
|
+
const checkAtResourceGroupScopeOperationSpec: coreClient.OperationSpec = {
|
|
90
|
+
path:
|
|
91
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions",
|
|
92
|
+
httpMethod: "POST",
|
|
93
|
+
responses: {
|
|
94
|
+
200: {
|
|
95
|
+
bodyMapper: Mappers.CheckRestrictionsResult
|
|
96
|
+
},
|
|
97
|
+
default: {
|
|
98
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
requestBody: Parameters.parameters1,
|
|
102
|
+
queryParameters: [Parameters.apiVersion3],
|
|
103
|
+
urlParameters: [
|
|
104
|
+
Parameters.$host,
|
|
105
|
+
Parameters.subscriptionId,
|
|
106
|
+
Parameters.resourceGroupName1
|
|
107
|
+
],
|
|
108
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
109
|
+
mediaType: "json",
|
|
110
|
+
serializer
|
|
111
|
+
};
|