Skip to content

Commit

Permalink
[Mgmt][arm-policy] Fix issue #25857 (#25889)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazrael2119 authored May 24, 2023
1 parent 1db8a1e commit 5f326d0
Show file tree
Hide file tree
Showing 142 changed files with 1,494 additions and 549 deletions.
4 changes: 2 additions & 2 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions sdk/policy/arm-policy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# Release History

## 5.1.0 (2023-05-18)

**Features**

## 5.0.4 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Interface DataPolicyManifestsListNextOptionalParams no longer has parameter filter
- Interface PolicyAssignmentsListForManagementGroupNextOptionalParams no longer has parameter filter
- Interface PolicyAssignmentsListForManagementGroupNextOptionalParams no longer has parameter top
- Interface PolicyAssignmentsListForResourceGroupNextOptionalParams no longer has parameter filter
- Interface PolicyAssignmentsListForResourceGroupNextOptionalParams no longer has parameter top
- Interface PolicyAssignmentsListForResourceNextOptionalParams no longer has parameter filter
- Interface PolicyAssignmentsListForResourceNextOptionalParams no longer has parameter top
- Interface PolicyAssignmentsListNextOptionalParams no longer has parameter filter
- Interface PolicyAssignmentsListNextOptionalParams no longer has parameter top
- Interface PolicyDefinitionsListBuiltInNextOptionalParams no longer has parameter filter
- Interface PolicyDefinitionsListBuiltInNextOptionalParams no longer has parameter top
- Interface PolicyDefinitionsListByManagementGroupNextOptionalParams no longer has parameter filter
- Interface PolicyDefinitionsListByManagementGroupNextOptionalParams no longer has parameter top
- Interface PolicyDefinitionsListNextOptionalParams no longer has parameter filter
- Interface PolicyDefinitionsListNextOptionalParams no longer has parameter top
- Interface PolicyExemptionsListForManagementGroupNextOptionalParams no longer has parameter filter
- Interface PolicyExemptionsListForResourceGroupNextOptionalParams no longer has parameter filter
- Interface PolicyExemptionsListForResourceNextOptionalParams no longer has parameter filter
- Interface PolicyExemptionsListNextOptionalParams no longer has parameter filter
- Interface PolicySetDefinitionsListBuiltInNextOptionalParams no longer has parameter filter
- Interface PolicySetDefinitionsListBuiltInNextOptionalParams no longer has parameter top
- Interface PolicySetDefinitionsListByManagementGroupNextOptionalParams no longer has parameter filter
- Interface PolicySetDefinitionsListByManagementGroupNextOptionalParams no longer has parameter top
- Interface PolicySetDefinitionsListNextOptionalParams no longer has parameter filter
- Interface PolicySetDefinitionsListNextOptionalParams no longer has parameter top

## 5.0.3 (2022-11-28)

**Features**
Expand Down
2 changes: 1 addition & 1 deletion sdk/policy/arm-policy/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Microsoft
Copyright (c) 2023 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions sdk/policy/arm-policy/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "a42f1b58607091c4f255ead152a8ef323fa0b280",
"readme": "specification/resources/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/[email protected].0-rc.3.20221108.1 --generate-sample=true",
"readme": "specification\\resources\\resource-manager\\readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/[email protected].2 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/[email protected].0-rc.3.20221108.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.2",
"use": "@autorest/[email protected].2"
}
2 changes: 1 addition & 1 deletion sdk/policy/arm-policy/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/policy/arm-policy",
"Tag": "js/policy/arm-policy_f045afdc79"
"Tag": "js/policy/arm-policy_5cdf0369fd"
}
9 changes: 5 additions & 4 deletions sdk/policy/arm-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for PolicyClient.",
"version": "5.0.4",
"version": "5.1.0",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.6.1",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
Expand All @@ -31,12 +31,13 @@
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"mkdirp": "^2.1.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~5.0.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"dotenv": "^16.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
Expand All @@ -48,7 +49,6 @@
"@azure/dev-tool": "^1.0.0",
"@azure/arm-managementgroups": "^2.0.1"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down Expand Up @@ -110,6 +110,7 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
Expand Down
28 changes: 2 additions & 26 deletions sdk/policy/arm-policy/review/arm-policy.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest;

// @public
export interface DataPolicyManifestsListNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
}

// @public
Expand Down Expand Up @@ -332,8 +331,6 @@ export type PolicyAssignmentsGetResponse = PolicyAssignment;

// @public
export interface PolicyAssignmentsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -350,8 +347,6 @@ export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentLi

// @public
export interface PolicyAssignmentsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -368,8 +363,6 @@ export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentList

// @public
export interface PolicyAssignmentsListForResourceNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -386,8 +379,6 @@ export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResul

// @public
export interface PolicyAssignmentsListNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand Down Expand Up @@ -427,6 +418,7 @@ export class PolicyClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyClientOptionalParams);
constructor(credentials: coreAuth.TokenCredential, options?: PolicyClientOptionalParams);
// (undocumented)
dataPolicyManifests: DataPolicyManifests;
// (undocumented)
Expand All @@ -438,7 +430,7 @@ export class PolicyClient extends coreClient.ServiceClient {
// (undocumented)
policySetDefinitions: PolicySetDefinitions;
// (undocumented)
subscriptionId: string;
subscriptionId?: string;
}

// @public
Expand Down Expand Up @@ -548,8 +540,6 @@ export type PolicyDefinitionsGetResponse = PolicyDefinition;

// @public
export interface PolicyDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -566,8 +556,6 @@ export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult;

// @public
export interface PolicyDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -584,8 +572,6 @@ export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionLis

// @public
export interface PolicyDefinitionsListNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand Down Expand Up @@ -652,7 +638,6 @@ export type PolicyExemptionsGetResponse = PolicyExemption;

// @public
export interface PolicyExemptionsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
}

// @public
Expand All @@ -668,7 +653,6 @@ export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionList

// @public
export interface PolicyExemptionsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
}

// @public
Expand All @@ -684,7 +668,6 @@ export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListRe

// @public
export interface PolicyExemptionsListForResourceNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
}

// @public
Expand All @@ -700,7 +683,6 @@ export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult;

// @public
export interface PolicyExemptionsListNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
}

// @public
Expand Down Expand Up @@ -796,8 +778,6 @@ export type PolicySetDefinitionsGetResponse = PolicySetDefinition;

// @public
export interface PolicySetDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -814,8 +794,6 @@ export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListRes

// @public
export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand All @@ -832,8 +810,6 @@ export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinit

// @public
export interface PolicySetDefinitionsListNextOptionalParams extends coreClient.OperationOptions {
filter?: string;
top?: number;
}

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
// Licensed under the MIT License.
import { PolicyClient } from "@azure/arm-policy";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();

/**
* This sample demonstrates how to This operation retrieves the data policy manifest with the given policy mode.
Expand All @@ -18,12 +21,18 @@ import { DefaultAzureCredential } from "@azure/identity";
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/examples/getDataPolicyManifest.json
*/
async function retrieveADataPolicyManifestByPolicyMode() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const subscriptionId =
process.env["POLICY_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const policyMode = "Microsoft.KeyVault.Data";
const credential = new DefaultAzureCredential();
const client = new PolicyClient(credential, subscriptionId);
const result = await client.dataPolicyManifests.getByPolicyMode(policyMode);
console.log(result);
}

retrieveADataPolicyManifestByPolicyMode().catch(console.error);
async function main() {
retrieveADataPolicyManifestByPolicyMode();
}

main().catch(console.error);
20 changes: 15 additions & 5 deletions sdk/policy/arm-policy/samples-dev/dataPolicyManifestsListSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
PolicyClient
} from "@azure/arm-policy";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();

/**
* This sample demonstrates how to This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.
Expand All @@ -21,7 +24,9 @@ import { DefaultAzureCredential } from "@azure/identity";
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/examples/listDataPolicyManifests.json
*/
async function listDataPolicyManifests() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const subscriptionId =
process.env["POLICY_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new PolicyClient(credential, subscriptionId);
const resArray = new Array();
Expand All @@ -31,16 +36,16 @@ async function listDataPolicyManifests() {
console.log(resArray);
}

listDataPolicyManifests().catch(console.error);

/**
* This sample demonstrates how to This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.
*
* @summary This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/examples/listDataPolicyManifestsNamespaceFilter.json
*/
async function listDataPolicyManifestsWithNamespaceFilter() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const subscriptionId =
process.env["POLICY_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const filter = "namespace eq 'Microsoft.KeyVault'";
const options: DataPolicyManifestsListOptionalParams = { filter };
const credential = new DefaultAzureCredential();
Expand All @@ -52,4 +57,9 @@ async function listDataPolicyManifestsWithNamespaceFilter() {
console.log(resArray);
}

listDataPolicyManifestsWithNamespaceFilter().catch(console.error);
async function main() {
listDataPolicyManifests();
listDataPolicyManifestsWithNamespaceFilter();
}

main().catch(console.error);
Loading

0 comments on commit 5f326d0

Please sign in to comment.