Skip to content

Commit 1314e34

Browse files
author
SDKAuto
committed
CodeGen from PR 13958 in Azure/azure-rest-api-specs
Merge 79f0f0aca9db65e6d2de6a013dbc20ad004096b4 into 6a209b9db4e27a651a6c2f38109ce3b2b9868aca
1 parent 8d6abbe commit 1314e34

19 files changed

+3352
-308
lines changed

sdk/policy/arm-policy/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 Microsoft
3+
Copyright (c) 2021 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/policy/arm-policy/README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ npm install @azure/arm-policy
1515

1616
### How to use
1717

18-
#### nodejs - Authentication, client creation and get policyAssignments as an example written in TypeScript.
18+
#### nodejs - client creation and getByPolicyMode dataPolicyManifests as an example written in TypeScript.
1919

2020
##### Install @azure/ms-rest-nodeauth
2121

@@ -26,18 +26,16 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"
2626

2727
##### Sample code
2828

29+
While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
2930
```typescript
30-
import * as msRest from "@azure/ms-rest-js";
31-
import * as msRestAzure from "@azure/ms-rest-azure-js";
32-
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
33-
import { PolicyClient, PolicyModels, PolicyMappers } from "@azure/arm-policy";
31+
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
32+
const { PolicyClient } = require("@azure/arm-policy");
3433
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3534

3635
msRestNodeAuth.interactiveLogin().then((creds) => {
3736
const client = new PolicyClient(creds, subscriptionId);
38-
const scope = "testscope";
39-
const policyAssignmentName = "testpolicyAssignmentName";
40-
client.policyAssignments.get(scope, policyAssignmentName).then((result) => {
37+
const policyMode = "testpolicyMode";
38+
client.dataPolicyManifests.getByPolicyMode(policyMode).then((result) => {
4139
console.log("The result is:");
4240
console.log(result);
4341
});
@@ -46,7 +44,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
4644
});
4745
```
4846

49-
#### browser - Authentication, client creation and get policyAssignments as an example written in JavaScript.
47+
#### browser - Authentication, client creation and getByPolicyMode dataPolicyManifests as an example written in JavaScript.
5048

5149
##### Install @azure/ms-rest-browserauth
5250

@@ -80,9 +78,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
8078
authManager.login();
8179
}
8280
const client = new Azure.ArmPolicy.PolicyClient(res.creds, subscriptionId);
83-
const scope = "testscope";
84-
const policyAssignmentName = "testpolicyAssignmentName";
85-
client.policyAssignments.get(scope, policyAssignmentName).then((result) => {
81+
const policyMode = "testpolicyMode";
82+
client.dataPolicyManifests.getByPolicyMode(policyMode).then((result) => {
8683
console.log("The result is:");
8784
console.log(result);
8885
}).catch((err) => {

sdk/policy/arm-policy/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const config = {
2121
"@azure/ms-rest-azure-js": "msRestAzure"
2222
},
2323
banner: `/*
24-
* Copyright (c) Microsoft Corporation. All rights reserved.
25-
* Licensed under the MIT License. See License.txt in the project root for license information.
24+
* Copyright (c) Microsoft Corporation.
25+
* Licensed under the MIT License.
2626
*
2727
* Code generated by Microsoft (R) AutoRest Code Generator.
2828
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
export {
10+
Alias,
11+
AliasPath,
12+
AliasPathMetadata,
13+
AliasPattern,
14+
BaseResource,
15+
CloudError,
16+
DataEffect,
17+
DataManifestCustomResourceFunctionDefinition,
18+
DataPolicyManifest,
19+
DataPolicyManifestListResult,
20+
ErrorAdditionalInfo,
21+
ErrorResponse,
22+
Identity,
23+
NonComplianceMessage,
24+
ParameterDefinitionsValue,
25+
ParameterDefinitionsValueMetadata,
26+
ParameterValuesValue,
27+
PolicyAssignment,
28+
PolicyDefinition,
29+
PolicyDefinitionGroup,
30+
PolicyDefinitionReference,
31+
PolicyExemption,
32+
PolicySetDefinition,
33+
ResourceTypeAliases,
34+
SystemData
35+
} from "../models/mappers";

0 commit comments

Comments
 (0)