@azure/arm-policyinsights 4.1.1 → 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 +69 -85
- 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/{esm/models/policyEventsMappers.js → dist-esm/src/index.js} +5 -2
- 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 +1287 -697
- 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 +209 -162
- 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/dist-esm/src/operations/index.js +16 -0
- 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/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/attestations.js} +2 -8
- 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/{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/src/operationsInterfaces/policyEvents.d.ts +60 -0
- package/dist-esm/src/operationsInterfaces/policyEvents.d.ts.map +1 -0
- package/{src/models/policyEventsMappers.ts → dist-esm/src/operationsInterfaces/policyEvents.js} +2 -8
- 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/{src/models/policyMetadataOperationsMappers.ts → dist-esm/src/operationsInterfaces/policyMetadataOperations.js} +2 -9
- 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 -23
- package/review/arm-policyinsights.api.md +1525 -0
- package/rollup.config.js +181 -30
- package/{esm/models/operationsMappers.js → src/index.ts} +5 -2
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1582 -2619
- package/src/models/mappers.ts +1454 -829
- package/src/models/parameters.ts +257 -163
- package/src/operations/attestations.ts +999 -0
- package/src/operations/index.ts +3 -2
- package/src/operations/operations.ts +27 -41
- package/src/operations/policyEvents.ts +1064 -600
- package/src/operations/policyMetadataOperations.ts +106 -113
- package/src/operations/policyRestrictions.ts +111 -0
- package/src/operations/policyStates.ts +1685 -1109
- package/src/operations/policyTrackedResources.ts +414 -293
- package/src/operations/remediations.ts +1201 -1264
- package/src/operationsInterfaces/attestations.ts +212 -0
- package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +4 -3
- 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 +91 -42
- 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 -5548
- 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 -3009
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -42
- 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 -32
- 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.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 -50
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/policyEvents.d.ts +0 -323
- package/esm/operations/policyEvents.d.ts.map +0 -1
- package/esm/operations/policyEvents.js +0 -572
- 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 -108
- package/esm/operations/policyMetadataOperations.js.map +0 -1
- package/esm/operations/policyStates.d.ts +0 -588
- package/esm/operations/policyStates.d.ts.map +0 -1
- package/esm/operations/policyStates.js +0 -951
- 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 -269
- 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 -1037
- package/esm/operations/remediations.js.map +0 -1
- package/esm/policyInsightsClient.d.ts +0 -28
- package/esm/policyInsightsClient.d.ts.map +0 -1
- package/esm/policyInsightsClient.js +0 -41
- package/esm/policyInsightsClient.js.map +0 -1
- package/esm/policyInsightsClientContext.d.ts +0 -19
- package/esm/policyInsightsClientContext.d.ts.map +0 -1
- package/esm/policyInsightsClientContext.js +0 -54
- package/esm/policyInsightsClientContext.js.map +0 -1
- package/src/models/policyStatesMappers.ts +0 -25
- package/src/models/policyTrackedResourcesMappers.ts +0 -16
- package/src/models/remediationsMappers.ts +0 -20
- package/src/policyInsightsClientContext.ts +0 -59
|
@@ -3,175 +3,168 @@
|
|
|
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 { PolicyMetadataOperations } 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
|
-
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";
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
/// <reference lib="esnext.asynciterable" />
|
|
26
|
+
/** Class containing PolicyMetadataOperations operations. */
|
|
27
|
+
export class PolicyMetadataOperationsImpl implements PolicyMetadataOperations {
|
|
28
|
+
private readonly client: PolicyInsightsClient;
|
|
19
29
|
|
|
20
30
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param
|
|
31
|
+
* Initialize a new instance of the class PolicyMetadataOperations class.
|
|
32
|
+
* @param client Reference to the service client
|
|
23
33
|
*/
|
|
24
|
-
constructor(client:
|
|
34
|
+
constructor(client: PolicyInsightsClient) {
|
|
25
35
|
this.client = client;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
|
-
* Get policy metadata
|
|
30
|
-
* @param
|
|
31
|
-
* @param [options] The optional parameters
|
|
32
|
-
* @returns Promise<Models.PolicyMetadataGetResourceResponse>
|
|
33
|
-
*/
|
|
34
|
-
getResource(resourceName: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyMetadataGetResourceResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* @param resourceName The name of the policy metadata resource.
|
|
37
|
-
* @param callback The callback
|
|
38
|
-
*/
|
|
39
|
-
getResource(resourceName: string, callback: msRest.ServiceCallback<Models.PolicyMetadata>): void;
|
|
40
|
-
/**
|
|
41
|
-
* @param resourceName The name of the policy metadata resource.
|
|
42
|
-
* @param options The optional parameters
|
|
43
|
-
* @param callback The callback
|
|
39
|
+
* Get a list of the policy metadata resources.
|
|
40
|
+
* @param options The options parameters.
|
|
44
41
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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;
|
|
51
52
|
},
|
|
52
|
-
|
|
53
|
-
|
|
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
|
+
}
|
|
54
78
|
}
|
|
55
79
|
|
|
56
80
|
/**
|
|
57
|
-
* Get
|
|
58
|
-
* @param
|
|
59
|
-
* @
|
|
60
|
-
*/
|
|
61
|
-
list(options?: Models.PolicyMetadataListOptionalParams): Promise<Models.PolicyMetadataListResponse>;
|
|
62
|
-
/**
|
|
63
|
-
* @param callback The callback
|
|
64
|
-
*/
|
|
65
|
-
list(callback: msRest.ServiceCallback<Models.PolicyMetadataCollection>): void;
|
|
66
|
-
/**
|
|
67
|
-
* @param options The optional parameters
|
|
68
|
-
* @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.
|
|
69
84
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
getResource(
|
|
86
|
+
resourceName: string,
|
|
87
|
+
options?: PolicyMetadataGetResourceOptionalParams
|
|
88
|
+
): Promise<PolicyMetadataGetResourceResponse> {
|
|
72
89
|
return this.client.sendOperationRequest(
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
listOperationSpec,
|
|
77
|
-
callback) as Promise<Models.PolicyMetadataListResponse>;
|
|
90
|
+
{ resourceName, options },
|
|
91
|
+
getResourceOperationSpec
|
|
92
|
+
);
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
/**
|
|
81
96
|
* Get a list of the policy metadata resources.
|
|
82
|
-
* @param
|
|
83
|
-
* @param [options] The optional parameters
|
|
84
|
-
* @returns Promise<Models.PolicyMetadataListNextResponse>
|
|
85
|
-
*/
|
|
86
|
-
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.PolicyMetadataListNextResponse>;
|
|
87
|
-
/**
|
|
88
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
89
|
-
* @param callback The callback
|
|
97
|
+
* @param options The options parameters.
|
|
90
98
|
*/
|
|
91
|
-
|
|
99
|
+
private _list(
|
|
100
|
+
options?: PolicyMetadataListOptionalParams
|
|
101
|
+
): Promise<PolicyMetadataListResponse> {
|
|
102
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
103
|
+
}
|
|
104
|
+
|
|
92
105
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
106
|
+
* ListNext
|
|
107
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
108
|
+
* @param options The options parameters.
|
|
96
109
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
private _listNext(
|
|
111
|
+
nextLink: string,
|
|
112
|
+
options?: PolicyMetadataListNextOptionalParams
|
|
113
|
+
): Promise<PolicyMetadataListNextResponse> {
|
|
99
114
|
return this.client.sendOperationRequest(
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
listNextOperationSpec,
|
|
105
|
-
callback) as Promise<Models.PolicyMetadataListNextResponse>;
|
|
115
|
+
{ nextLink, options },
|
|
116
|
+
listNextOperationSpec
|
|
117
|
+
);
|
|
106
118
|
}
|
|
107
119
|
}
|
|
108
|
-
|
|
109
120
|
// Operation Specifications
|
|
110
|
-
const serializer =
|
|
111
|
-
|
|
121
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
122
|
+
|
|
123
|
+
const getResourceOperationSpec: coreClient.OperationSpec = {
|
|
124
|
+
path: "/providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}",
|
|
112
125
|
httpMethod: "GET",
|
|
113
|
-
path: "providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}",
|
|
114
|
-
urlParameters: [
|
|
115
|
-
Parameters.resourceName
|
|
116
|
-
],
|
|
117
|
-
queryParameters: [
|
|
118
|
-
Parameters.apiVersion2
|
|
119
|
-
],
|
|
120
|
-
headerParameters: [
|
|
121
|
-
Parameters.acceptLanguage
|
|
122
|
-
],
|
|
123
126
|
responses: {
|
|
124
127
|
200: {
|
|
125
128
|
bodyMapper: Mappers.PolicyMetadata
|
|
126
129
|
},
|
|
127
130
|
default: {
|
|
128
|
-
bodyMapper: Mappers.
|
|
131
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
129
132
|
}
|
|
130
133
|
},
|
|
134
|
+
queryParameters: [Parameters.apiVersion2],
|
|
135
|
+
urlParameters: [Parameters.$host, Parameters.resourceName],
|
|
136
|
+
headerParameters: [Parameters.accept],
|
|
131
137
|
serializer
|
|
132
138
|
};
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
140
|
+
path: "/providers/Microsoft.PolicyInsights/policyMetadata",
|
|
135
141
|
httpMethod: "GET",
|
|
136
|
-
path: "providers/Microsoft.PolicyInsights/policyMetadata",
|
|
137
|
-
queryParameters: [
|
|
138
|
-
Parameters.apiVersion2,
|
|
139
|
-
Parameters.top
|
|
140
|
-
],
|
|
141
|
-
headerParameters: [
|
|
142
|
-
Parameters.acceptLanguage
|
|
143
|
-
],
|
|
144
142
|
responses: {
|
|
145
143
|
200: {
|
|
146
144
|
bodyMapper: Mappers.PolicyMetadataCollection
|
|
147
145
|
},
|
|
148
146
|
default: {
|
|
149
|
-
bodyMapper: Mappers.
|
|
147
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
150
148
|
}
|
|
151
149
|
},
|
|
150
|
+
queryParameters: [Parameters.top, Parameters.apiVersion2],
|
|
151
|
+
urlParameters: [Parameters.$host],
|
|
152
|
+
headerParameters: [Parameters.accept],
|
|
152
153
|
serializer
|
|
153
154
|
};
|
|
154
|
-
|
|
155
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
|
156
|
-
httpMethod: "GET",
|
|
157
|
-
baseUrl: "https://management.azure.com",
|
|
155
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
158
156
|
path: "{nextLink}",
|
|
159
|
-
|
|
160
|
-
Parameters.nextPageLink
|
|
161
|
-
],
|
|
162
|
-
queryParameters: [
|
|
163
|
-
Parameters.apiVersion2
|
|
164
|
-
],
|
|
165
|
-
headerParameters: [
|
|
166
|
-
Parameters.acceptLanguage
|
|
167
|
-
],
|
|
157
|
+
httpMethod: "GET",
|
|
168
158
|
responses: {
|
|
169
159
|
200: {
|
|
170
160
|
bodyMapper: Mappers.PolicyMetadataCollection
|
|
171
161
|
},
|
|
172
162
|
default: {
|
|
173
|
-
bodyMapper: Mappers.
|
|
163
|
+
bodyMapper: Mappers.ErrorResponseAutoGenerated
|
|
174
164
|
}
|
|
175
165
|
},
|
|
166
|
+
queryParameters: [Parameters.top, Parameters.apiVersion2],
|
|
167
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
168
|
+
headerParameters: [Parameters.accept],
|
|
176
169
|
serializer
|
|
177
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
|
+
};
|