@azure/arm-policy 5.0.0-beta.2 → 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 +5 -45
- package/README.md +4 -0
- package/dist/index.js +4 -24
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/index.d.ts +0 -1
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +0 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/operations/dataPolicyManifests.d.ts +2 -2
- package/dist-esm/src/operations/dataPolicyManifests.d.ts.map +1 -1
- package/dist-esm/src/operations/dataPolicyManifests.js.map +1 -1
- package/dist-esm/src/operations/policyAssignments.d.ts +2 -2
- package/dist-esm/src/operations/policyAssignments.d.ts.map +1 -1
- package/dist-esm/src/operations/policyAssignments.js.map +1 -1
- package/dist-esm/src/operations/policyDefinitions.d.ts +2 -2
- package/dist-esm/src/operations/policyDefinitions.d.ts.map +1 -1
- package/dist-esm/src/operations/policyDefinitions.js.map +1 -1
- package/dist-esm/src/operations/policyExemptions.d.ts +2 -2
- package/dist-esm/src/operations/policyExemptions.d.ts.map +1 -1
- package/dist-esm/src/operations/policyExemptions.js.map +1 -1
- package/dist-esm/src/operations/policySetDefinitions.d.ts +2 -2
- package/dist-esm/src/operations/policySetDefinitions.d.ts.map +1 -1
- package/dist-esm/src/operations/policySetDefinitions.js.map +1 -1
- package/dist-esm/src/policyClient.d.ts +4 -2
- package/dist-esm/src/policyClient.d.ts.map +1 -1
- package/dist-esm/src/policyClient.js +31 -3
- package/dist-esm/src/policyClient.js.map +1 -1
- package/dist-esm/test/policy_examples.d.ts +3 -1
- package/dist-esm/test/policy_examples.d.ts.map +1 -1
- package/dist-esm/test/policy_examples.js +56 -22
- package/dist-esm/test/policy_examples.js.map +1 -1
- package/package.json +8 -8
- package/review/arm-policy.api.md +3 -9
- package/src/index.ts +0 -1
- package/src/operations/dataPolicyManifests.ts +3 -3
- package/src/operations/policyAssignments.ts +3 -3
- package/src/operations/policyDefinitions.ts +3 -3
- package/src/operations/policyExemptions.ts +3 -3
- package/src/operations/policySetDefinitions.ts +3 -3
- package/src/policyClient.ts +44 -3
- package/types/arm-policy.d.ts +3 -13
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/src/policyClientContext.d.ts +0 -15
- package/dist-esm/src/policyClientContext.d.ts.map +0 -1
- package/dist-esm/src/policyClientContext.js +0 -48
- package/dist-esm/src/policyClientContext.js.map +0 -1
- package/src/policyClientContext.ts +0 -68
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
import { __asyncValues, __awaiter } from "tslib";
|
|
9
|
-
import { env, record } from "@azure-tools/test-recorder";
|
|
9
|
+
import { env, record, isPlaybackMode } from "@azure-tools/test-recorder";
|
|
10
10
|
import * as assert from "assert";
|
|
11
11
|
import { ClientSecretCredential } from "@azure/identity";
|
|
12
12
|
import { PolicyClient } from "../src/policyClient";
|
|
@@ -22,16 +22,19 @@ const recorderEnvSetup = {
|
|
|
22
22
|
],
|
|
23
23
|
queryParametersToSkip: []
|
|
24
24
|
};
|
|
25
|
+
export const testPollingOptions = {
|
|
26
|
+
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
|
|
27
|
+
};
|
|
25
28
|
describe("Policy test", () => {
|
|
26
29
|
let recorder;
|
|
27
30
|
let subscriptionId;
|
|
28
31
|
let client;
|
|
29
32
|
let location;
|
|
30
|
-
let
|
|
31
|
-
let policyName;
|
|
33
|
+
let resourceGroup;
|
|
32
34
|
let groupId;
|
|
33
|
-
let
|
|
35
|
+
let policyName;
|
|
34
36
|
let scope;
|
|
37
|
+
let policyAssignmentName;
|
|
35
38
|
beforeEach(function () {
|
|
36
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
40
|
recorder = record(this, recorderEnvSetup);
|
|
@@ -40,11 +43,11 @@ describe("Policy test", () => {
|
|
|
40
43
|
const credential = new ClientSecretCredential(env.AZURE_TENANT_ID, env.AZURE_CLIENT_ID, env.AZURE_CLIENT_SECRET);
|
|
41
44
|
client = new PolicyClient(credential, subscriptionId);
|
|
42
45
|
location = "eastus";
|
|
43
|
-
|
|
44
|
-
policyName = "policynameaxx";
|
|
46
|
+
resourceGroup = "myjstest";
|
|
45
47
|
groupId = "20000000-0001-0000-0000-000000000123";
|
|
46
|
-
|
|
48
|
+
policyName = "jspolicy";
|
|
47
49
|
scope = "/providers/Microsoft.Management/managementgroups/20000000-0001-0000-0000-000000000123/";
|
|
50
|
+
policyAssignmentName = "passigment";
|
|
48
51
|
});
|
|
49
52
|
});
|
|
50
53
|
afterEach(function () {
|
|
@@ -52,10 +55,9 @@ describe("Policy test", () => {
|
|
|
52
55
|
yield recorder.stop();
|
|
53
56
|
});
|
|
54
57
|
});
|
|
55
|
-
|
|
56
|
-
function policyDefinitions_createOrUpdateAtManagementGroup() {
|
|
58
|
+
it("policyDefinitions create test", function () {
|
|
57
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const
|
|
60
|
+
const res = yield client.policyDefinitions.createOrUpdateAtManagementGroup(policyName, groupId, {
|
|
59
61
|
policyType: "Custom",
|
|
60
62
|
description: "Don't create a VM anywhere",
|
|
61
63
|
policyRule: {
|
|
@@ -76,14 +78,41 @@ describe("Policy test", () => {
|
|
|
76
78
|
},
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
|
-
|
|
81
|
+
assert.equal(res.name, policyName);
|
|
80
82
|
});
|
|
81
|
-
}
|
|
83
|
+
});
|
|
84
|
+
it("policyDefinitions get test", function () {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const res = yield client.policyDefinitions.getAtManagementGroup(policyName, groupId);
|
|
87
|
+
assert.equal(res.name, policyName);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
it("policyDefinitions list test", function () {
|
|
91
|
+
var e_1, _a;
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const resArray = new Array();
|
|
94
|
+
try {
|
|
95
|
+
for (var _b = __asyncValues(client.policyDefinitions.listByManagementGroup(groupId)), _c; _c = yield _b.next(), !_c.done;) {
|
|
96
|
+
let item = _c.value;
|
|
97
|
+
resArray.push(item);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
101
|
+
finally {
|
|
102
|
+
try {
|
|
103
|
+
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
104
|
+
}
|
|
105
|
+
finally { if (e_1) throw e_1.error; }
|
|
106
|
+
}
|
|
107
|
+
assert.notEqual(resArray.length, 0);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
82
110
|
it("policyAssignments create test", function () {
|
|
83
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
yield policyDefinitions_createOrUpdateAtManagementGroup();
|
|
85
112
|
const definition = yield client.policyDefinitions.getAtManagementGroup(policyName, groupId);
|
|
86
|
-
const res = yield client.policyAssignments.create(scope, policyAssignmentName, {
|
|
113
|
+
const res = yield client.policyAssignments.create(scope, policyAssignmentName, {
|
|
114
|
+
policyDefinitionId: definition.id
|
|
115
|
+
});
|
|
87
116
|
assert.equal(res.name, policyAssignmentName);
|
|
88
117
|
});
|
|
89
118
|
});
|
|
@@ -94,45 +123,50 @@ describe("Policy test", () => {
|
|
|
94
123
|
});
|
|
95
124
|
});
|
|
96
125
|
it("policyAssignments list test", function () {
|
|
97
|
-
var
|
|
126
|
+
var e_2, _a;
|
|
98
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
128
|
const resArray = new Array();
|
|
100
129
|
try {
|
|
101
130
|
for (var _b = __asyncValues(client.policyAssignments.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
102
|
-
|
|
131
|
+
let item = _c.value;
|
|
103
132
|
resArray.push(item);
|
|
104
133
|
}
|
|
105
134
|
}
|
|
106
|
-
catch (
|
|
135
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
107
136
|
finally {
|
|
108
137
|
try {
|
|
109
138
|
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
110
139
|
}
|
|
111
|
-
finally { if (
|
|
140
|
+
finally { if (e_2) throw e_2.error; }
|
|
112
141
|
}
|
|
113
142
|
assert.notEqual(resArray.length, 0);
|
|
114
143
|
});
|
|
115
144
|
});
|
|
116
145
|
it("policyAssignments delete test", function () {
|
|
117
|
-
var
|
|
146
|
+
var e_3, _a;
|
|
118
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
148
|
const res = yield client.policyAssignments.delete(scope, policyAssignmentName);
|
|
120
149
|
const resArray = new Array();
|
|
121
150
|
try {
|
|
122
151
|
for (var _b = __asyncValues(client.policyAssignments.list()), _c; _c = yield _b.next(), !_c.done;) {
|
|
123
|
-
|
|
152
|
+
let item = _c.value;
|
|
124
153
|
resArray.push(item);
|
|
125
154
|
}
|
|
126
155
|
}
|
|
127
|
-
catch (
|
|
156
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
128
157
|
finally {
|
|
129
158
|
try {
|
|
130
159
|
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
131
160
|
}
|
|
132
|
-
finally { if (
|
|
161
|
+
finally { if (e_3) throw e_3.error; }
|
|
133
162
|
}
|
|
134
163
|
assert.notEqual(resArray.length, 0);
|
|
135
164
|
});
|
|
136
165
|
});
|
|
166
|
+
it("policyDefinitions delete test", function () {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const res = yield client.policyDefinitions.deleteAtManagementGroup(policyName, groupId);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
137
171
|
});
|
|
138
172
|
//# sourceMappingURL=policy_examples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy_examples.js","sourceRoot":"","sources":["../../test/policy_examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,GAAG,EACH,MAAM,
|
|
1
|
+
{"version":3,"file":"policy_examples.js","sourceRoot":"","sources":["../../test/policy_examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,EACL,GAAG,EACH,MAAM,EAIN,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,gBAAgB,GAA6B;IACjD,oBAAoB,EAAE;QACpB,eAAe,EAAE,iBAAiB;QAClC,mBAAmB,EAAE,qBAAqB;QAC1C,eAAe,EAAE,sCAAsC;QACvD,eAAe,EAAE,uBAAuB;KACzC;IACD,0BAA0B,EAAE;QAC1B,CAAC,SAAc,EAAO,EAAE,CACtB,SAAS,CAAC,OAAO,CACf,yBAAyB,EACzB,+BAA+B,CAChC;KACJ;IACD,qBAAqB,EAAE,EAAE;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;CACrD,CAAC;AAEF,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,QAAkB,CAAC;IACvB,IAAI,cAAsB,CAAC;IAC3B,IAAI,MAAoB,CAAC;IACzB,IAAI,QAAgB,CAAC;IACrB,IAAI,aAAqB,CAAC;IAC1B,IAAI,OAAe,CAAC;IACpB,IAAI,UAAkB,CAAC;IACvB,IAAI,KAAa,CAAC;IAClB,IAAI,oBAA4B,CAAC;IAEjC,UAAU,CAAC;;YACT,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAC1C,cAAc,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,EAAE,CAAC;;gBAC7B,KAAuB,IAAA,KAAA,cAAA,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA,IAAA;oBAA3C,IAAI,IAAI,WAAA,CAAA;oBACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;;;;;;;;;YACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAC,CAAC,CAAC,CAAC;;KACpC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE;;;YAClC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAC,oBAAoB,CAAC,CAAC;YAC9E,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAC;;gBAC7B,KAAuB,IAAA,KAAA,cAAA,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA,IAAA;oBAA3C,IAAI,IAAI,WAAA,CAAA;oBACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;;;;;;;;;YACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAC,CAAC,CAAC,CAAC;;KACpC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE;;YAClC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,UAAU,EAAC,OAAO,CAAC,CAAC;QACzF,CAAC;KAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"sdk-type": "mgmt",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "A generated SDK for PolicyClient.",
|
|
6
|
-
"version": "5.0.0
|
|
6
|
+
"version": "5.0.0",
|
|
7
7
|
"engines": { "node": ">=12.0.0" },
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@azure/core-paging": "^1.
|
|
9
|
+
"@azure/core-paging": "^1.2.0",
|
|
10
10
|
"@azure/core-client": "^1.0.0",
|
|
11
11
|
"@azure/core-auth": "^1.3.0",
|
|
12
12
|
"@azure/core-rest-pipeline": "^1.1.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "./dist-esm/src/index.js",
|
|
19
19
|
"types": "./types/arm-policy.d.ts",
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@microsoft/api-extractor": "7.
|
|
21
|
+
"@microsoft/api-extractor": "^7.18.11",
|
|
22
22
|
"@rollup/plugin-commonjs": "11.0.2",
|
|
23
23
|
"@rollup/plugin-json": "^4.0.0",
|
|
24
24
|
"@rollup/plugin-multi-entry": "^3.0.0",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
29
29
|
"typescript": "~4.2.0",
|
|
30
30
|
"uglify-js": "^3.4.9",
|
|
31
|
-
"
|
|
31
|
+
"rimraf": "^3.0.0",
|
|
32
|
+
"@azure/identity": "^2.0.1",
|
|
32
33
|
"@azure-tools/test-recorder": "^1.0.0",
|
|
33
34
|
"mocha": "^7.1.1",
|
|
34
35
|
"cross-env": "^7.0.2"
|
|
@@ -58,14 +59,14 @@
|
|
|
58
59
|
"types/*"
|
|
59
60
|
],
|
|
60
61
|
"scripts": {
|
|
61
|
-
"build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
62
|
+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
62
63
|
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
|
|
63
64
|
"prepack": "npm run build",
|
|
64
65
|
"pack": "npm pack 2>&1",
|
|
65
66
|
"extract-api": "api-extractor run --local",
|
|
66
67
|
"lint": "echo skipped",
|
|
67
68
|
"audit": "echo skipped",
|
|
68
|
-
"clean": "
|
|
69
|
+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
69
70
|
"build:node": "echo skipped",
|
|
70
71
|
"build:browser": "echo skipped",
|
|
71
72
|
"build:test": "echo skipped",
|
|
@@ -74,14 +75,13 @@
|
|
|
74
75
|
"execute:samples": "echo skipped",
|
|
75
76
|
"format": "echo skipped",
|
|
76
77
|
"test": "npm run integration-test",
|
|
77
|
-
"prebuild": "echo skipped",
|
|
78
78
|
"test:node": "echo skipped",
|
|
79
79
|
"test:browser": "echo skipped",
|
|
80
80
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
81
81
|
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
|
82
82
|
"unit-test:browser": "echo skipped",
|
|
83
83
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
84
|
-
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
|
|
84
|
+
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
|
|
85
85
|
"integration-test:browser": "echo skipped",
|
|
86
86
|
"docs": "echo skipped"
|
|
87
87
|
},
|
package/review/arm-policy.api.md
CHANGED
|
@@ -435,7 +435,9 @@ export interface PolicyAssignmentUpdate {
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
// @public (undocumented)
|
|
438
|
-
export class PolicyClient extends
|
|
438
|
+
export class PolicyClient extends coreClient.ServiceClient {
|
|
439
|
+
// (undocumented)
|
|
440
|
+
$host: string;
|
|
439
441
|
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams);
|
|
440
442
|
// (undocumented)
|
|
441
443
|
dataPolicyManifests: DataPolicyManifests;
|
|
@@ -447,13 +449,6 @@ export class PolicyClient extends PolicyClientContext {
|
|
|
447
449
|
policyExemptions: PolicyExemptions;
|
|
448
450
|
// (undocumented)
|
|
449
451
|
policySetDefinitions: PolicySetDefinitions;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// @public (undocumented)
|
|
453
|
-
export class PolicyClientContext extends coreClient.ServiceClient {
|
|
454
|
-
// (undocumented)
|
|
455
|
-
$host: string;
|
|
456
|
-
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams);
|
|
457
452
|
// (undocumented)
|
|
458
453
|
subscriptionId: string;
|
|
459
454
|
}
|
|
@@ -893,7 +888,6 @@ export interface UserAssignedIdentitiesValue {
|
|
|
893
888
|
readonly principalId?: string;
|
|
894
889
|
}
|
|
895
890
|
|
|
896
|
-
|
|
897
891
|
// (No @packageDocumentation comment for this package)
|
|
898
892
|
|
|
899
893
|
```
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { DataPolicyManifests } from "../operationsInterfaces";
|
|
|
11
11
|
import * as coreClient from "@azure/core-client";
|
|
12
12
|
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { PolicyClient } from "../policyClient";
|
|
15
15
|
import {
|
|
16
16
|
DataPolicyManifest,
|
|
17
17
|
DataPolicyManifestsListNextOptionalParams,
|
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
/// <reference lib="esnext.asynciterable" />
|
|
26
26
|
/** Class containing DataPolicyManifests operations. */
|
|
27
27
|
export class DataPolicyManifestsImpl implements DataPolicyManifests {
|
|
28
|
-
private readonly client:
|
|
28
|
+
private readonly client: PolicyClient;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Initialize a new instance of the class DataPolicyManifests class.
|
|
32
32
|
* @param client Reference to the service client
|
|
33
33
|
*/
|
|
34
|
-
constructor(client:
|
|
34
|
+
constructor(client: PolicyClient) {
|
|
35
35
|
this.client = client;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -11,7 +11,7 @@ import { PolicyAssignments } from "../operationsInterfaces";
|
|
|
11
11
|
import * as coreClient from "@azure/core-client";
|
|
12
12
|
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { PolicyClient } from "../policyClient";
|
|
15
15
|
import {
|
|
16
16
|
PolicyAssignment,
|
|
17
17
|
PolicyAssignmentsListForResourceGroupNextOptionalParams,
|
|
@@ -52,13 +52,13 @@ import {
|
|
|
52
52
|
/// <reference lib="esnext.asynciterable" />
|
|
53
53
|
/** Class containing PolicyAssignments operations. */
|
|
54
54
|
export class PolicyAssignmentsImpl implements PolicyAssignments {
|
|
55
|
-
private readonly client:
|
|
55
|
+
private readonly client: PolicyClient;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Initialize a new instance of the class PolicyAssignments class.
|
|
59
59
|
* @param client Reference to the service client
|
|
60
60
|
*/
|
|
61
|
-
constructor(client:
|
|
61
|
+
constructor(client: PolicyClient) {
|
|
62
62
|
this.client = client;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -11,7 +11,7 @@ import { PolicyDefinitions } from "../operationsInterfaces";
|
|
|
11
11
|
import * as coreClient from "@azure/core-client";
|
|
12
12
|
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { PolicyClient } from "../policyClient";
|
|
15
15
|
import {
|
|
16
16
|
PolicyDefinition,
|
|
17
17
|
PolicyDefinitionsListNextOptionalParams,
|
|
@@ -43,13 +43,13 @@ import {
|
|
|
43
43
|
/// <reference lib="esnext.asynciterable" />
|
|
44
44
|
/** Class containing PolicyDefinitions operations. */
|
|
45
45
|
export class PolicyDefinitionsImpl implements PolicyDefinitions {
|
|
46
|
-
private readonly client:
|
|
46
|
+
private readonly client: PolicyClient;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Initialize a new instance of the class PolicyDefinitions class.
|
|
50
50
|
* @param client Reference to the service client
|
|
51
51
|
*/
|
|
52
|
-
constructor(client:
|
|
52
|
+
constructor(client: PolicyClient) {
|
|
53
53
|
this.client = client;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -11,7 +11,7 @@ import { PolicyExemptions } from "../operationsInterfaces";
|
|
|
11
11
|
import * as coreClient from "@azure/core-client";
|
|
12
12
|
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { PolicyClient } from "../policyClient";
|
|
15
15
|
import {
|
|
16
16
|
PolicyExemption,
|
|
17
17
|
PolicyExemptionsListNextOptionalParams,
|
|
@@ -40,13 +40,13 @@ import {
|
|
|
40
40
|
/// <reference lib="esnext.asynciterable" />
|
|
41
41
|
/** Class containing PolicyExemptions operations. */
|
|
42
42
|
export class PolicyExemptionsImpl implements PolicyExemptions {
|
|
43
|
-
private readonly client:
|
|
43
|
+
private readonly client: PolicyClient;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Initialize a new instance of the class PolicyExemptions class.
|
|
47
47
|
* @param client Reference to the service client
|
|
48
48
|
*/
|
|
49
|
-
constructor(client:
|
|
49
|
+
constructor(client: PolicyClient) {
|
|
50
50
|
this.client = client;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -11,7 +11,7 @@ import { PolicySetDefinitions } from "../operationsInterfaces";
|
|
|
11
11
|
import * as coreClient from "@azure/core-client";
|
|
12
12
|
import * as Mappers from "../models/mappers";
|
|
13
13
|
import * as Parameters from "../models/parameters";
|
|
14
|
-
import {
|
|
14
|
+
import { PolicyClient } from "../policyClient";
|
|
15
15
|
import {
|
|
16
16
|
PolicySetDefinition,
|
|
17
17
|
PolicySetDefinitionsListNextOptionalParams,
|
|
@@ -43,13 +43,13 @@ import {
|
|
|
43
43
|
/// <reference lib="esnext.asynciterable" />
|
|
44
44
|
/** Class containing PolicySetDefinitions operations. */
|
|
45
45
|
export class PolicySetDefinitionsImpl implements PolicySetDefinitions {
|
|
46
|
-
private readonly client:
|
|
46
|
+
private readonly client: PolicyClient;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Initialize a new instance of the class PolicySetDefinitions class.
|
|
50
50
|
* @param client Reference to the service client
|
|
51
51
|
*/
|
|
52
|
-
constructor(client:
|
|
52
|
+
constructor(client: PolicyClient) {
|
|
53
53
|
this.client = client;
|
|
54
54
|
}
|
|
55
55
|
|
package/src/policyClient.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import * as coreClient from "@azure/core-client";
|
|
9
10
|
import * as coreAuth from "@azure/core-auth";
|
|
10
11
|
import {
|
|
11
12
|
DataPolicyManifestsImpl,
|
|
@@ -21,10 +22,12 @@ import {
|
|
|
21
22
|
PolicySetDefinitions,
|
|
22
23
|
PolicyExemptions
|
|
23
24
|
} from "./operationsInterfaces";
|
|
24
|
-
import { PolicyClientContext } from "./policyClientContext";
|
|
25
25
|
import { PolicyClientOptionalParams } from "./models";
|
|
26
26
|
|
|
27
|
-
export class PolicyClient extends
|
|
27
|
+
export class PolicyClient extends coreClient.ServiceClient {
|
|
28
|
+
$host: string;
|
|
29
|
+
subscriptionId: string;
|
|
30
|
+
|
|
28
31
|
/**
|
|
29
32
|
* Initializes a new instance of the PolicyClient class.
|
|
30
33
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
@@ -36,7 +39,45 @@ export class PolicyClient extends PolicyClientContext {
|
|
|
36
39
|
subscriptionId: string,
|
|
37
40
|
options?: PolicyClientOptionalParams
|
|
38
41
|
) {
|
|
39
|
-
|
|
42
|
+
if (credentials === undefined) {
|
|
43
|
+
throw new Error("'credentials' cannot be null");
|
|
44
|
+
}
|
|
45
|
+
if (subscriptionId === undefined) {
|
|
46
|
+
throw new Error("'subscriptionId' cannot be null");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Initializing default values for options
|
|
50
|
+
if (!options) {
|
|
51
|
+
options = {};
|
|
52
|
+
}
|
|
53
|
+
const defaults: PolicyClientOptionalParams = {
|
|
54
|
+
requestContentType: "application/json; charset=utf-8",
|
|
55
|
+
credential: credentials
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const packageDetails = `azsdk-js-arm-policy/5.0.0`;
|
|
59
|
+
const userAgentPrefix =
|
|
60
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
61
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
62
|
+
: `${packageDetails}`;
|
|
63
|
+
|
|
64
|
+
if (!options.credentialScopes) {
|
|
65
|
+
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
66
|
+
}
|
|
67
|
+
const optionsWithDefaults = {
|
|
68
|
+
...defaults,
|
|
69
|
+
...options,
|
|
70
|
+
userAgentOptions: {
|
|
71
|
+
userAgentPrefix
|
|
72
|
+
},
|
|
73
|
+
baseUri: options.endpoint || "https://management.azure.com"
|
|
74
|
+
};
|
|
75
|
+
super(optionsWithDefaults);
|
|
76
|
+
// Parameter assignments
|
|
77
|
+
this.subscriptionId = subscriptionId;
|
|
78
|
+
|
|
79
|
+
// Assigning values to Constant parameters
|
|
80
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
40
81
|
this.dataPolicyManifests = new DataPolicyManifestsImpl(this);
|
|
41
82
|
this.policyAssignments = new PolicyAssignmentsImpl(this);
|
|
42
83
|
this.policyDefinitions = new PolicyDefinitionsImpl(this);
|
package/types/arm-policy.d.ts
CHANGED
|
@@ -826,7 +826,9 @@ export declare interface PolicyAssignmentUpdate {
|
|
|
826
826
|
identity?: Identity;
|
|
827
827
|
}
|
|
828
828
|
|
|
829
|
-
export declare class PolicyClient extends
|
|
829
|
+
export declare class PolicyClient extends coreClient.ServiceClient {
|
|
830
|
+
$host: string;
|
|
831
|
+
subscriptionId: string;
|
|
830
832
|
/**
|
|
831
833
|
* Initializes a new instance of the PolicyClient class.
|
|
832
834
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
@@ -841,18 +843,6 @@ export declare class PolicyClient extends PolicyClientContext {
|
|
|
841
843
|
policyExemptions: PolicyExemptions;
|
|
842
844
|
}
|
|
843
845
|
|
|
844
|
-
export declare class PolicyClientContext extends coreClient.ServiceClient {
|
|
845
|
-
$host: string;
|
|
846
|
-
subscriptionId: string;
|
|
847
|
-
/**
|
|
848
|
-
* Initializes a new instance of the PolicyClientContext class.
|
|
849
|
-
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
850
|
-
* @param subscriptionId The ID of the target subscription.
|
|
851
|
-
* @param options The parameter options
|
|
852
|
-
*/
|
|
853
|
-
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams);
|
|
854
|
-
}
|
|
855
|
-
|
|
856
846
|
/** Optional parameters. */
|
|
857
847
|
export declare interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions {
|
|
858
848
|
/** server parameter */
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as coreClient from "@azure/core-client";
|
|
2
|
-
import * as coreAuth from "@azure/core-auth";
|
|
3
|
-
import { PolicyClientOptionalParams } from "./models";
|
|
4
|
-
export declare class PolicyClientContext extends coreClient.ServiceClient {
|
|
5
|
-
$host: string;
|
|
6
|
-
subscriptionId: string;
|
|
7
|
-
/**
|
|
8
|
-
* Initializes a new instance of the PolicyClientContext class.
|
|
9
|
-
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
10
|
-
* @param subscriptionId The ID of the target subscription.
|
|
11
|
-
* @param options The parameter options
|
|
12
|
-
*/
|
|
13
|
-
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=policyClientContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"policyClientContext.d.ts","sourceRoot":"","sources":["../../src/policyClientContext.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD,qBAAa,mBAAoB,SAAQ,UAAU,CAAC,aAAa;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;gBAED,WAAW,EAAE,QAAQ,CAAC,eAAe,EACrC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,0BAA0B;CA0CvC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
import * as coreClient from "@azure/core-client";
|
|
9
|
-
export class PolicyClientContext extends coreClient.ServiceClient {
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a new instance of the PolicyClientContext class.
|
|
12
|
-
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
13
|
-
* @param subscriptionId The ID of the target subscription.
|
|
14
|
-
* @param options The parameter options
|
|
15
|
-
*/
|
|
16
|
-
constructor(credentials, subscriptionId, options) {
|
|
17
|
-
if (credentials === undefined) {
|
|
18
|
-
throw new Error("'credentials' cannot be null");
|
|
19
|
-
}
|
|
20
|
-
if (subscriptionId === undefined) {
|
|
21
|
-
throw new Error("'subscriptionId' cannot be null");
|
|
22
|
-
}
|
|
23
|
-
// Initializing default values for options
|
|
24
|
-
if (!options) {
|
|
25
|
-
options = {};
|
|
26
|
-
}
|
|
27
|
-
const defaults = {
|
|
28
|
-
requestContentType: "application/json; charset=utf-8",
|
|
29
|
-
credential: credentials
|
|
30
|
-
};
|
|
31
|
-
const packageDetails = `azsdk-js-arm-policy/5.0.0-beta.2`;
|
|
32
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
33
|
-
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
34
|
-
: `${packageDetails}`;
|
|
35
|
-
if (!options.credentialScopes) {
|
|
36
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
37
|
-
}
|
|
38
|
-
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
39
|
-
userAgentPrefix
|
|
40
|
-
}, baseUri: options.endpoint || "https://management.azure.com" });
|
|
41
|
-
super(optionsWithDefaults);
|
|
42
|
-
// Parameter assignments
|
|
43
|
-
this.subscriptionId = subscriptionId;
|
|
44
|
-
// Assigning values to Constant parameters
|
|
45
|
-
this.$host = options.$host || "https://management.azure.com";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=policyClientContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"policyClientContext.js","sourceRoot":"","sources":["../../src/policyClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAIjD,MAAM,OAAO,mBAAoB,SAAQ,UAAU,CAAC,aAAa;IAI/D;;;;;OAKG;IACH,YACE,WAAqC,EACrC,cAAsB,EACtB,OAAoC;QAEpC,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QACD,IAAI,cAAc,KAAK,SAAS,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACpD;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAA+B;YAC3C,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,kCAAkC,CAAC;QAC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