From ba002dc0676b0f50c4bb0159833bdba549427e2f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 15 Feb 2023 23:34:33 +0000 Subject: [PATCH] CodeGen from PR 22623 in Azure/azure-rest-api-specs Merge f622043b729d4406248f443416952a6256d18b58 into d2088a7409d1ed25b8cdcadd18c6789c7504bdf2 --- common/config/rush/pnpm-lock.yaml | 77 +- sdk/policy/arm-policy/CHANGELOG.md | 106 +- sdk/policy/arm-policy/LICENSE | 2 +- sdk/policy/arm-policy/README.md | 2 +- sdk/policy/arm-policy/_meta.json | 8 +- sdk/policy/arm-policy/package.json | 23 +- .../arm-policy/review/arm-policy.api.md | 292 ++++- sdk/policy/arm-policy/src/models/index.ts | 1018 +++++++++++------ sdk/policy/arm-policy/src/models/mappers.ts | 1003 +++++++++++----- .../arm-policy/src/models/parameters.ts | 208 ++-- .../src/operations/dataPolicyManifests.ts | 1 - sdk/policy/arm-policy/src/operations/index.ts | 4 +- .../src/operations/policyAssignments.ts | 48 +- .../src/operations/policyDefinitions.ts | 31 +- .../src/operations/policyExemptions.ts | 79 +- .../src/operations/policySetDefinitions.ts | 7 +- .../src/operations/variableValues.ts | 615 ++++++++++ .../arm-policy/src/operations/variables.ts | 549 +++++++++ .../src/operationsInterfaces/index.ts | 4 +- .../operationsInterfaces/policyExemptions.ts | 22 +- .../operationsInterfaces/variableValues.ts | 135 +++ .../src/operationsInterfaces/variables.ts | 116 ++ sdk/policy/arm-policy/src/pagingHelper.ts | 8 +- sdk/policy/arm-policy/src/policyClient.ts | 22 +- sdk/policy/arm-policy/test/sampleTest.ts | 43 + sdk/policy/arm-policy/tsconfig.json | 11 +- 26 files changed, 3492 insertions(+), 942 deletions(-) create mode 100644 sdk/policy/arm-policy/src/operations/variableValues.ts create mode 100644 sdk/policy/arm-policy/src/operations/variables.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/variableValues.ts create mode 100644 sdk/policy/arm-policy/src/operationsInterfaces/variables.ts create mode 100644 sdk/policy/arm-policy/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7b9af74c3d6a..18a9b7fa536d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10619,15 +10619,15 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-B8N9yM+1Vp9CzUjf5v04PDB2vxlbhIGq/5fJoYje1pEHa+tLmcyaiiGn+96Pw9SlMsJ7XQJ8Z8AFPsCk4JfRAQ==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-pbgSizSD6fqUc3TJ6Um2g9rFWWYq/9QnuI4F76c6aT86S3dBO2HjQkFt3GXBgKBAi8LypRKj5+5f59I8y3zmrQ==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -12087,15 +12087,15 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-xeoRu2vTD3xQ2h+KA+2zkDNG7AM3+awOInV5RGm86yAtRPAtz/weXH3vgimhCIg7HhQJHWF3i8qE9+eXcIDYJw==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-QSRmk3iRSsS5Gp8yf6bgyt2nOM2XenHe6J8YcUF1K29Ip27cKRuIR/gYSXgSP0KtxC+t79CAjKl5wzSIkzvHzQ==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -12663,15 +12663,15 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-G6eUZBvHVwVqwPvmMs3L3nIXxTlCqO1EdlbCdmc03yWQWZDhB4/1zpJI57r+MKFwpp7Hh4aaQMS969vjb/ZM1A==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-xlGVxP5sS3yFgQtNT1TItsy2qHVnrc6OxUIXTKzyfCsyKeIu7LsEAjrE9vm7c7t5KC85iSTSDtMbKOvFi48o7Q==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -12746,15 +12746,15 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-y5sE5EWeQqgTSWY3yIdpUF84BAAdiphTy7DTx/94BeU07jsVdWgYIDDFrrbUUsu2D2a4SiTHSXyiwc4+F4Hnlw==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-M8FKQIl8dYrf+Ky+Ub12Lf8NeMhC9Fraqf7M0bJZdthL83Ot6JstRL1oExZ+KmtZ5OZDjKEFh8OxWONQtxmEAQ==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -12883,15 +12883,15 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-MyYntSTdIQn5AwQIsy90k4V0uLmgRynGKJl8KlKAZ779BjA1ux5s8b0resLSwicN/rePVrZlHYF3IhVlASv6QA==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-upZnU6/BmJIfn4KK8OZM9NMPYWp2IgCAyDpeF4L6ohYcnLTsHIY9mRVdqYQUwLqWdgfBx+W9PRtNMXlw5qP+Zw==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -13673,15 +13673,15 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-IciJx9xqVQORaDOK/Gsm6zPvPVBtEjR8+JyL2AluuCbyTvfmDI+VSsuc7uAhYbEoVRa1xu1Prpp6k16C4oRn6w==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-8WtqMPYlSxYPqzcoBEVlsZPy9r7ZZRE472Vnm3oCss0iGVxGjmzq4D6/G7pe/8SEQIs/03HuZrIjiasLcWvshQ==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -14280,15 +14280,15 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-HLDiqkIrLxtnmzIfq03xmy5rn1CdCg5NFyM6N+ipwXeNkCgIdk28rBKKGC3vz5QYbtgFPylDgrummJli9E33ZQ==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-jzeJrcW+MsKdsNzsMsg0JztNAol91RI0sBsu0QATEnQ35wpS1q+f+kThUBzkLAtsHh4utvE8CDE3xRrLhlT3ew==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -14307,15 +14307,15 @@ packages: dev: false file:projects/arm-resources.tgz: - resolution: {integrity: sha512-Zu3QMWfINqKQaQUTCeqCoSt3cKqshq6KsKIvFSUj5je73MO6VRK4Jfr8lLPamhFDVeZ2/ZD8kP3qPaIEOqKnrA==, tarball: file:projects/arm-resources.tgz} + resolution: {integrity: sha512-yfRrlJ8rdEfD5Lv7DEpuf/mk41z8JL6zjl4huSgddGNRHVCj0qK7OQsfRqpiySY240MvR9b1Ox97J34jKrErBg==, tarball: file:projects/arm-resources.tgz} name: '@rush-temp/arm-resources' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -15149,15 +15149,15 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-k+IkhuH0X48gA6YncaNmSgc5fi4ytUR1unL6ojsrmRSO2PmryKBJCsDjftkWe76TgGyBZoDQWJGSbIoltJQjGw==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-4IcGgLJrM5zBR+d5UzY0iK2Y7r4UgfPrYZPGkdtYBsdBsM4OMx+b6zDyuaRx6443hme2BkUmQaud+4X/zzGLNA==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 @@ -17893,7 +17893,7 @@ packages: dev: false file:projects/monitor-ingestion.tgz: - resolution: {integrity: sha512-CtEBzCs8gADc56AozIehMF2iu7e7R/8YroShdvL2gjK6Hol5Tz+LRfNo4m9XoM17Mwsm1VtZe6Di0vA+WdiJ3g==, tarball: file:projects/monitor-ingestion.tgz} + resolution: {integrity: sha512-zodipV0pcRnzrfWjHYqvU42+E4V7E6TqdSYdrmqk/W9isTlZ3lW7OQXvblPPmjo2gTxDBbq+MUcDJ1Bu4FPPYA==, tarball: file:projects/monitor-ingestion.tgz} name: '@rush-temp/monitor-ingestion' version: 0.0.0 dependencies: @@ -18798,7 +18798,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-kLU74faNZXQAJXMne2lL+AAKkVKmU8+obYvymA9G2IuJBpPraaTOxyIOypkQeZqLuWCdZgrgeCno39dVP0MLtg==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-mSZh1szK6lxMnczMO7kgXzef/o22kR6Ttc0voG7IKFLpMKRq6gwvWDAtPzvAEz9qjHzskrN9Me89DaPc7H7ccw==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: @@ -18850,7 +18850,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false diff --git a/sdk/policy/arm-policy/CHANGELOG.md b/sdk/policy/arm-policy/CHANGELOG.md index 6f1461494737..957c1dab3131 100644 --- a/sdk/policy/arm-policy/CHANGELOG.md +++ b/sdk/policy/arm-policy/CHANGELOG.md @@ -1,15 +1,101 @@ # Release History + +## 6.0.0-beta.1 (2023-02-15) + +**Features** -## 5.0.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group Variables + - Added operation group VariableValues + - Added operation PolicyExemptions.update + - Added Interface Override + - Added Interface PolicyExemptionsUpdateOptionalParams + - Added Interface PolicyExemptionUpdate + - Added Interface PolicyVariableColumn + - Added Interface PolicyVariableValueColumnValue + - Added Interface ResourceSelector + - Added Interface Selector + - Added Interface Variable + - Added Interface VariableListResult + - Added Interface VariablesCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface VariablesCreateOrUpdateOptionalParams + - Added Interface VariablesDeleteAtManagementGroupOptionalParams + - Added Interface VariablesDeleteOptionalParams + - Added Interface VariablesGetAtManagementGroupOptionalParams + - Added Interface VariablesGetOptionalParams + - Added Interface VariablesListForManagementGroupNextOptionalParams + - Added Interface VariablesListForManagementGroupOptionalParams + - Added Interface VariablesListNextOptionalParams + - Added Interface VariablesListOptionalParams + - Added Interface VariableValue + - Added Interface VariableValueListResult + - Added Interface VariableValuesCreateOrUpdateAtManagementGroupOptionalParams + - Added Interface VariableValuesCreateOrUpdateOptionalParams + - Added Interface VariableValuesDeleteAtManagementGroupOptionalParams + - Added Interface VariableValuesDeleteOptionalParams + - Added Interface VariableValuesGetAtManagementGroupOptionalParams + - Added Interface VariableValuesGetOptionalParams + - Added Interface VariableValuesListForManagementGroupNextOptionalParams + - Added Interface VariableValuesListForManagementGroupOptionalParams + - Added Interface VariableValuesListNextOptionalParams + - Added Interface VariableValuesListOptionalParams + - Added Type Alias AssignmentScopeValidation + - Added Type Alias OverrideKind + - Added Type Alias PolicyExemptionsUpdateResponse + - Added Type Alias SelectorKind + - Added Type Alias VariablesCreateOrUpdateAtManagementGroupResponse + - Added Type Alias VariablesCreateOrUpdateResponse + - Added Type Alias VariablesGetAtManagementGroupResponse + - Added Type Alias VariablesGetResponse + - Added Type Alias VariablesListForManagementGroupNextResponse + - Added Type Alias VariablesListForManagementGroupResponse + - Added Type Alias VariablesListNextResponse + - Added Type Alias VariablesListResponse + - Added Type Alias VariableValuesCreateOrUpdateAtManagementGroupResponse + - Added Type Alias VariableValuesCreateOrUpdateResponse + - Added Type Alias VariableValuesGetAtManagementGroupResponse + - Added Type Alias VariableValuesGetResponse + - Added Type Alias VariableValuesListForManagementGroupNextResponse + - Added Type Alias VariableValuesListForManagementGroupResponse + - Added Type Alias VariableValuesListNextResponse + - Added Type Alias VariableValuesListResponse + - Interface PolicyAssignment has a new optional parameter overrides + - Interface PolicyAssignment has a new optional parameter resourceSelectors + - Interface PolicyAssignmentUpdate has a new optional parameter overrides + - Interface PolicyAssignmentUpdate has a new optional parameter resourceSelectors + - Interface PolicyExemption has a new optional parameter assignmentScopeValidation + - Interface PolicyExemption has a new optional parameter resourceSelectors + - Added Enum KnownAssignmentScopeValidation + - Added Enum KnownOverrideKind + - Added Enum KnownSelectorKind + +**Breaking 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** diff --git a/sdk/policy/arm-policy/LICENSE b/sdk/policy/arm-policy/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/policy/arm-policy/LICENSE +++ b/sdk/policy/arm-policy/LICENSE @@ -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 diff --git a/sdk/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index 09f248c27622..328b65c05222 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -6,7 +6,7 @@ To manage and control access to your resources, you can define customized polici [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-policy) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-policy) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/policy/arm-policy/_meta.json b/sdk/policy/arm-policy/_meta.json index c7ad3e56f301..58393c99e5e1 100644 --- a/sdk/policy/arm-policy/_meta.json +++ b/sdk/policy/arm-policy/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", + "commit": "5baccaa6c83a0da61689a016661e79425c840967", "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/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 476672905c8a..e1440b2c1ba8 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PolicyClient.", - "version": "5.0.4", + "version": "6.0.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -27,9 +27,9 @@ "types": "./types/arm-policy.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", "rollup": "^2.66.1", @@ -45,8 +45,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-managementgroups": "^2.0.1" + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy", "repository": { @@ -109,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/review/arm-policy.api.md b/sdk/policy/arm-policy/review/arm-policy.api.md index 25bb71105e59..a48d4c555536 100644 --- a/sdk/policy/arm-policy/review/arm-policy.api.md +++ b/sdk/policy/arm-policy/review/arm-policy.api.md @@ -51,6 +51,9 @@ export type AliasPatternType = "NotSpecified" | "Extract"; // @public export type AliasType = "NotSpecified" | "PlainText" | "Mask"; +// @public +export type AssignmentScopeValidation = string; + // @public export interface CloudError { error?: ErrorResponse; @@ -109,7 +112,6 @@ export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest; // @public export interface DataPolicyManifestsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -175,6 +177,12 @@ export enum KnownAliasPathTokenType { String = "String" } +// @public +export enum KnownAssignmentScopeValidation { + Default = "Default", + DoNotValidate = "DoNotValidate" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -195,6 +203,11 @@ export enum KnownExemptionCategory { Waiver = "Waiver" } +// @public +export enum KnownOverrideKind { + PolicyEffect = "policyEffect" +} + // @public export enum KnownParameterType { Array = "Array", @@ -214,12 +227,30 @@ export enum KnownPolicyType { Static = "Static" } +// @public +export enum KnownSelectorKind { + PolicyDefinitionReferenceId = "policyDefinitionReferenceId", + ResourceLocation = "resourceLocation", + ResourceType = "resourceType", + ResourceWithoutLocation = "resourceWithoutLocation" +} + // @public export interface NonComplianceMessage { message: string; policyDefinitionReferenceId?: string; } +// @public +export interface Override { + kind?: OverrideKind; + selectors?: Selector[]; + value?: string; +} + +// @public +export type OverrideKind = string; + // @public export interface ParameterDefinitionsValue { allowedValues?: any[]; @@ -257,10 +288,12 @@ export interface PolicyAssignment { readonly name?: string; nonComplianceMessages?: NonComplianceMessage[]; notScopes?: string[]; + overrides?: Override[]; parameters?: { [propertyName: string]: ParameterValuesValue; }; policyDefinitionId?: string; + resourceSelectors?: ResourceSelector[]; readonly scope?: string; readonly systemData?: SystemData; readonly type?: string; @@ -332,8 +365,6 @@ export type PolicyAssignmentsGetResponse = PolicyAssignment; // @public export interface PolicyAssignmentsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -350,8 +381,6 @@ export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentLi // @public export interface PolicyAssignmentsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -368,8 +397,6 @@ export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentList // @public export interface PolicyAssignmentsListForResourceNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -386,8 +413,6 @@ export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResul // @public export interface PolicyAssignmentsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -416,10 +441,12 @@ export interface PolicyAssignmentsUpdateOptionalParams extends coreClient.Operat // @public export type PolicyAssignmentsUpdateResponse = PolicyAssignment; -// @public (undocumented) +// @public export interface PolicyAssignmentUpdate { identity?: Identity; location?: string; + overrides?: Override[]; + resourceSelectors?: ResourceSelector[]; } // @public (undocumented) @@ -439,6 +466,10 @@ export class PolicyClient extends coreClient.ServiceClient { policySetDefinitions: PolicySetDefinitions; // (undocumented) subscriptionId: string; + // (undocumented) + variables: Variables; + // (undocumented) + variableValues: VariableValues; } // @public @@ -548,8 +579,6 @@ export type PolicyDefinitionsGetResponse = PolicyDefinition; // @public export interface PolicyDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -566,8 +595,6 @@ export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult; // @public export interface PolicyDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -584,8 +611,6 @@ export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionLis // @public export interface PolicyDefinitionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -602,6 +627,7 @@ export type PolicyDefinitionsListResponse = PolicyDefinitionListResult; // @public export interface PolicyExemption { + assignmentScopeValidation?: AssignmentScopeValidation; description?: string; displayName?: string; exemptionCategory: ExemptionCategory; @@ -611,6 +637,7 @@ export interface PolicyExemption { readonly name?: string; policyAssignmentId: string; policyDefinitionReferenceIds?: string[]; + resourceSelectors?: ResourceSelector[]; readonly systemData?: SystemData; readonly type?: string; } @@ -630,6 +657,7 @@ export interface PolicyExemptions { listForManagementGroup(managementGroupId: string, options?: PolicyExemptionsListForManagementGroupOptionalParams): PagedAsyncIterableIterator; listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: PolicyExemptionsListForResourceOptionalParams): PagedAsyncIterableIterator; listForResourceGroup(resourceGroupName: string, options?: PolicyExemptionsListForResourceGroupOptionalParams): PagedAsyncIterableIterator; + update(scope: string, policyExemptionName: string, parameters: PolicyExemptionUpdate, options?: PolicyExemptionsUpdateOptionalParams): Promise; } // @public @@ -652,7 +680,6 @@ export type PolicyExemptionsGetResponse = PolicyExemption; // @public export interface PolicyExemptionsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -668,7 +695,6 @@ export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionList // @public export interface PolicyExemptionsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -684,7 +710,6 @@ export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListRe // @public export interface PolicyExemptionsListForResourceNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -700,7 +725,6 @@ export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult; // @public export interface PolicyExemptionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -714,6 +738,19 @@ export interface PolicyExemptionsListOptionalParams extends coreClient.Operation // @public export type PolicyExemptionsListResponse = PolicyExemptionListResult; +// @public +export interface PolicyExemptionsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PolicyExemptionsUpdateResponse = PolicyExemption; + +// @public +export interface PolicyExemptionUpdate { + assignmentScopeValidation?: AssignmentScopeValidation; + resourceSelectors?: ResourceSelector[]; +} + // @public export interface PolicySetDefinition { description?: string; @@ -796,8 +833,6 @@ export type PolicySetDefinitionsGetResponse = PolicySetDefinition; // @public export interface PolicySetDefinitionsListBuiltInNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -814,8 +849,6 @@ export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListRes // @public export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -832,8 +865,6 @@ export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinit // @public export interface PolicySetDefinitionsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - top?: number; } // @public @@ -851,15 +882,42 @@ export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult; // @public export type PolicyType = string; +// @public +export interface PolicyVariableColumn { + columnName: string; +} + +// @public +export interface PolicyVariableValueColumnValue { + columnName: string; + columnValue: any; +} + // @public export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; +// @public +export interface ResourceSelector { + name?: string; + selectors?: Selector[]; +} + // @public export interface ResourceTypeAliases { aliases?: Alias[]; resourceType?: string; } +// @public +export interface Selector { + in?: string[]; + kind?: SelectorKind; + notIn?: string[]; +} + +// @public +export type SelectorKind = string; + // @public export interface SystemData { createdAt?: Date; @@ -876,6 +934,188 @@ export interface UserAssignedIdentitiesValue { readonly principalId?: string; } +// @public +export interface Variable { + columns: PolicyVariableColumn[]; + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface VariableListResult { + readonly nextLink?: string; + value?: Variable[]; +} + +// @public +export interface Variables { + createOrUpdate(variableName: string, parameters: Variable, options?: VariablesCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, variableName: string, parameters: Variable, options?: VariablesCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(variableName: string, options?: VariablesDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, variableName: string, options?: VariablesDeleteAtManagementGroupOptionalParams): Promise; + get(variableName: string, options?: VariablesGetOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, variableName: string, options?: VariablesGetAtManagementGroupOptionalParams): Promise; + list(options?: VariablesListOptionalParams): PagedAsyncIterableIterator; + listForManagementGroup(managementGroupId: string, options?: VariablesListForManagementGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VariablesCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesCreateOrUpdateAtManagementGroupResponse = Variable; + +// @public +export interface VariablesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesCreateOrUpdateResponse = Variable; + +// @public +export interface VariablesDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VariablesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VariablesGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesGetAtManagementGroupResponse = Variable; + +// @public +export interface VariablesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesGetResponse = Variable; + +// @public +export interface VariablesListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesListForManagementGroupNextResponse = VariableListResult; + +// @public +export interface VariablesListForManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesListForManagementGroupResponse = VariableListResult; + +// @public +export interface VariablesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesListNextResponse = VariableListResult; + +// @public +export interface VariablesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariablesListResponse = VariableListResult; + +// @public +export interface VariableValue { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; + values: PolicyVariableValueColumnValue[]; +} + +// @public +export interface VariableValueListResult { + readonly nextLink?: string; + value?: VariableValue[]; +} + +// @public +export interface VariableValues { + createOrUpdate(variableName: string, variableValueName: string, parameters: VariableValue, options?: VariableValuesCreateOrUpdateOptionalParams): Promise; + createOrUpdateAtManagementGroup(managementGroupId: string, variableName: string, variableValueName: string, parameters: VariableValue, options?: VariableValuesCreateOrUpdateAtManagementGroupOptionalParams): Promise; + delete(variableName: string, variableValueName: string, options?: VariableValuesDeleteOptionalParams): Promise; + deleteAtManagementGroup(managementGroupId: string, variableName: string, variableValueName: string, options?: VariableValuesDeleteAtManagementGroupOptionalParams): Promise; + get(variableName: string, variableValueName: string, options?: VariableValuesGetOptionalParams): Promise; + getAtManagementGroup(managementGroupId: string, variableName: string, variableValueName: string, options?: VariableValuesGetAtManagementGroupOptionalParams): Promise; + list(variableName: string, options?: VariableValuesListOptionalParams): PagedAsyncIterableIterator; + listForManagementGroup(managementGroupId: string, variableName: string, options?: VariableValuesListForManagementGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VariableValuesCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesCreateOrUpdateAtManagementGroupResponse = VariableValue; + +// @public +export interface VariableValuesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesCreateOrUpdateResponse = VariableValue; + +// @public +export interface VariableValuesDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VariableValuesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface VariableValuesGetAtManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesGetAtManagementGroupResponse = VariableValue; + +// @public +export interface VariableValuesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesGetResponse = VariableValue; + +// @public +export interface VariableValuesListForManagementGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesListForManagementGroupNextResponse = VariableValueListResult; + +// @public +export interface VariableValuesListForManagementGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesListForManagementGroupResponse = VariableValueListResult; + +// @public +export interface VariableValuesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesListNextResponse = VariableValueListResult; + +// @public +export interface VariableValuesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VariableValuesListResponse = VariableValueListResult; + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 3b908666e92e..d0db2c52841b 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -185,133 +185,6 @@ export interface DataPolicyManifestListResult { nextLink?: string; } -/** The policy assignment. */ -export interface PolicyAssignment { - /** - * The ID of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The name of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** The display name of the policy assignment. */ - displayName?: string; - /** The ID of the policy definition or policy set definition being assigned. */ - policyDefinitionId?: string; - /** - * The scope for the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scope?: string; - /** The policy's excluded scopes. */ - notScopes?: string[]; - /** The parameter values for the assigned policy rule. The keys are the parameter names. */ - parameters?: { [propertyName: string]: ParameterValuesValue }; - /** This message will be part of response in case of policy violation. */ - description?: string; - /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ - metadata?: any; - /** The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. */ - enforcementMode?: EnforcementMode; - /** The messages that describe why a resource is non-compliant with the policy. */ - nonComplianceMessages?: NonComplianceMessage[]; -} - -/** The value of a parameter. */ -export interface ParameterValuesValue { - /** The value of the parameter. */ - value?: any; -} - -/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ -export interface NonComplianceMessage { - /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ - message: string; - /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ - policyDefinitionReferenceId?: string; -} - -/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ -export interface Identity { - /** - * The principal ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of the resource identity. This property will only be provided for a system assigned identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ - type?: ResourceIdentityType; - /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -export interface UserAssignedIdentitiesValue { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -export interface PolicyAssignmentUpdate { - /** The location of the policy assignment. Only required when utilizing managed identity. */ - location?: string; - /** The managed identity associated with the policy assignment. */ - identity?: Identity; -} - -/** List of policy assignments. */ -export interface PolicyAssignmentListResult { - /** An array of policy assignments. */ - value?: PolicyAssignment[]; - /** The URL to use for getting the next set of results. */ - nextLink?: string; -} - /** The policy definition. */ export interface PolicyDefinition { /** @@ -376,6 +249,22 @@ export interface ParameterDefinitionsValueMetadata { assignPermissions?: boolean; } +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + /** List of policy definitions. */ export interface PolicyDefinitionListResult { /** An array of policy definitions. */ @@ -434,6 +323,12 @@ export interface PolicyDefinitionReference { groupNames?: string[]; } +/** The value of a parameter. */ +export interface ParameterValuesValue { + /** The value of the parameter. */ + value?: any; +} + /** The policy definition group. */ export interface PolicyDefinitionGroup { /** The name of the group. */ @@ -456,6 +351,148 @@ export interface PolicySetDefinitionListResult { nextLink?: string; } +/** The policy assignment. */ +export interface PolicyAssignment { + /** + * The ID of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The type of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The name of the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The display name of the policy assignment. */ + displayName?: string; + /** The ID of the policy definition or policy set definition being assigned. */ + policyDefinitionId?: string; + /** + * The scope for the policy assignment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scope?: string; + /** The policy's excluded scopes. */ + notScopes?: string[]; + /** The parameter values for the assigned policy rule. The keys are the parameter names. */ + parameters?: { [propertyName: string]: ParameterValuesValue }; + /** This message will be part of response in case of policy violation. */ + description?: string; + /** The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ + metadata?: any; + /** The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. */ + enforcementMode?: EnforcementMode; + /** The messages that describe why a resource is non-compliant with the policy. */ + nonComplianceMessages?: NonComplianceMessage[]; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; +} + +/** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ +export interface NonComplianceMessage { + /** A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results. */ + message: string; + /** The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment. */ + policyDefinitionReferenceId?: string; +} + +/** The resource selector to filter policies by resource properties. */ +export interface ResourceSelector { + /** The name of the resource selector. */ + name?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; +} + +/** The selector expression. */ +export interface Selector { + /** The selector kind. */ + kind?: SelectorKind; + /** The list of values to filter in. */ + in?: string[]; + /** The list of values to filter out. */ + notIn?: string[]; +} + +/** The policy property value override. */ +export interface Override { + /** The override kind. */ + kind?: OverrideKind; + /** The value to override the policy property. */ + value?: string; + /** The list of the selector expressions. */ + selectors?: Selector[]; +} + +/** Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity. */ +export interface Identity { + /** + * The principal ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the resource identity. This property will only be provided for a system assigned identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. This is the only required field when adding a system or user assigned identity to a resource. */ + type?: ResourceIdentityType; + /** The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentitiesValue; + }; +} + +export interface UserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** The policy assignment for Patch request. */ +export interface PolicyAssignmentUpdate { + /** The location of the policy assignment. Only required when utilizing managed identity. */ + location?: string; + /** The managed identity associated with the policy assignment. */ + identity?: Identity; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The policy property value override. */ + overrides?: Override[]; +} + +/** List of policy assignments. */ +export interface PolicyAssignmentListResult { + /** An array of policy assignments. */ + value?: PolicyAssignment[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + /** The policy exemption. */ export interface PolicyExemption { /** @@ -492,6 +529,18 @@ export interface PolicyExemption { description?: string; /** The policy exemption metadata. Metadata is an open ended object and is typically a collection of key value pairs. */ metadata?: any; + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The option whether validate the exemption is at or under the assignment scope. */ + assignmentScopeValidation?: AssignmentScopeValidation; +} + +/** The policy exemption for Patch request. */ +export interface PolicyExemptionUpdate { + /** The resource selector list to filter policies by resource properties. */ + resourceSelectors?: ResourceSelector[]; + /** The option whether validate the exemption is at or under the assignment scope. */ + assignmentScopeValidation?: AssignmentScopeValidation; } /** List of policy exemptions. */ @@ -505,6 +554,94 @@ export interface PolicyExemptionListResult { readonly nextLink?: string; } +/** The variable. */ +export interface Variable { + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The ID of the variable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the variable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource (Microsoft.Authorization/variables). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Variable column definitions. */ + columns: PolicyVariableColumn[]; +} + +/** The variable column. */ +export interface PolicyVariableColumn { + /** The name of this policy variable column. */ + columnName: string; +} + +/** List of variables. */ +export interface VariableListResult { + /** An array of variables. */ + value?: Variable[]; + /** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The variable value. */ +export interface VariableValue { + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * The ID of the variable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the variable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource (Microsoft.Authorization/variables/values). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Variable value column value array. */ + values: PolicyVariableValueColumnValue[]; +} + +/** The name value tuple for this variable value column. */ +export interface PolicyVariableValueColumnValue { + /** Column name for the variable value */ + columnName: string; + /** Column value for the variable value; this can be an integer, double, boolean, null or a string. */ + columnValue: any; +} + +/** List of variable values. */ +export interface VariableValueListResult { + /** An array of variable values. */ + value?: VariableValue[]; + /** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Known values of {@link AliasPathTokenType} that the service accepts. */ export enum KnownAliasPathTokenType { /** The token type is not specified. */ @@ -545,61 +682,19 @@ export type AliasPathTokenType = string; export enum KnownAliasPathAttributes { /** The token that the alias path is referring to has no attributes. */ None = "None", - /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ - Modifiable = "Modifiable" -} - -/** - * Defines values for AliasPathAttributes. \ - * {@link KnownAliasPathAttributes} can be used interchangeably with AliasPathAttributes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: The token that the alias path is referring to has no attributes. \ - * **Modifiable**: The token that the alias path is referring to is modifiable by policies with 'modify' effect. - */ -export type AliasPathAttributes = string; - -/** Known values of {@link EnforcementMode} that the service accepts. */ -export enum KnownEnforcementMode { - /** The policy effect is enforced during resource creation or update. */ - Default = "Default", - /** The policy effect is not enforced during resource creation or update. */ - DoNotEnforce = "DoNotEnforce" -} - -/** - * Defines values for EnforcementMode. \ - * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Default**: The policy effect is enforced during resource creation or update. \ - * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. - */ -export type EnforcementMode = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key" + /** The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ + Modifiable = "Modifiable" } /** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * Defines values for AliasPathAttributes. \ + * {@link KnownAliasPathAttributes} can be used interchangeably with AliasPathAttributes, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **None**: The token that the alias path is referring to has no attributes. \ + * **Modifiable**: The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ -export type CreatedByType = string; +export type AliasPathAttributes = string; /** Known values of {@link PolicyType} that the service accepts. */ export enum KnownPolicyType { @@ -658,6 +753,87 @@ export enum KnownParameterType { */ export type ParameterType = string; +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link EnforcementMode} that the service accepts. */ +export enum KnownEnforcementMode { + /** The policy effect is enforced during resource creation or update. */ + Default = "Default", + /** The policy effect is not enforced during resource creation or update. */ + DoNotEnforce = "DoNotEnforce" +} + +/** + * Defines values for EnforcementMode. \ + * {@link KnownEnforcementMode} can be used interchangeably with EnforcementMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: The policy effect is enforced during resource creation or update. \ + * **DoNotEnforce**: The policy effect is not enforced during resource creation or update. + */ +export type EnforcementMode = string; + +/** Known values of {@link SelectorKind} that the service accepts. */ +export enum KnownSelectorKind { + /** The selector kind to filter policies by the resource location. */ + ResourceLocation = "resourceLocation", + /** The selector kind to filter policies by the resource type. */ + ResourceType = "resourceType", + /** The selector kind to filter policies by the resource without location. */ + ResourceWithoutLocation = "resourceWithoutLocation", + /** The selector kind to filter policies by the policy definition reference ID. */ + PolicyDefinitionReferenceId = "policyDefinitionReferenceId" +} + +/** + * Defines values for SelectorKind. \ + * {@link KnownSelectorKind} can be used interchangeably with SelectorKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **resourceLocation**: The selector kind to filter policies by the resource location. \ + * **resourceType**: The selector kind to filter policies by the resource type. \ + * **resourceWithoutLocation**: The selector kind to filter policies by the resource without location. \ + * **policyDefinitionReferenceId**: The selector kind to filter policies by the policy definition reference ID. + */ +export type SelectorKind = string; + +/** Known values of {@link OverrideKind} that the service accepts. */ +export enum KnownOverrideKind { + /** It will override the policy effect type. */ + PolicyEffect = "policyEffect" +} + +/** + * Defines values for OverrideKind. \ + * {@link KnownOverrideKind} can be used interchangeably with OverrideKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **policyEffect**: It will override the policy effect type. + */ +export type OverrideKind = string; + /** Known values of {@link ExemptionCategory} that the service accepts. */ export enum KnownExemptionCategory { /** This category of exemptions usually means the scope is not applicable for the policy. */ @@ -675,6 +851,24 @@ export enum KnownExemptionCategory { * **Mitigated**: This category of exemptions usually means the mitigation actions have been applied to the scope. */ export type ExemptionCategory = string; + +/** Known values of {@link AssignmentScopeValidation} that the service accepts. */ +export enum KnownAssignmentScopeValidation { + /** This option will validate the exemption is at or under the assignment scope. */ + Default = "Default", + /** This option will bypass the validation the exemption scope is at or under the policy assignment scope. */ + DoNotValidate = "DoNotValidate" +} + +/** + * Defines values for AssignmentScopeValidation. \ + * {@link KnownAssignmentScopeValidation} can be used interchangeably with AssignmentScopeValidation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: This option will validate the exemption is at or under the assignment scope. \ + * **DoNotValidate**: This option will bypass the validation the exemption scope is at or under the policy assignment scope. + */ +export type AssignmentScopeValidation = string; /** Defines values for AliasPatternType. */ export type AliasPatternType = "NotSpecified" | "Extract"; /** Defines values for AliasType. */ @@ -701,165 +895,10 @@ export type DataPolicyManifestsListResponse = DataPolicyManifestListResult; /** Optional parameters. */ export interface DataPolicyManifestsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value. */ - filter?: string; -} - -/** Contains response data for the listNext operation. */ -export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the delete operation. */ -export type PolicyAssignmentsDeleteResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsCreateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type PolicyAssignmentsCreateResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PolicyAssignmentsGetResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type PolicyAssignmentsUpdateResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForResourceGroup operation. */ -export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForResource operation. */ -export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForManagementGroup operation. */ -export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the list operation. */ -export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsDeleteByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteById operation. */ -export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsCreateByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createById operation. */ -export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsGetByIdOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getById operation. */ -export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsUpdateByIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the updateById operation. */ -export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForResourceGroupNext operation. */ -export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForResourceNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForResourceNext operation. */ -export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListForManagementGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - -/** Contains response data for the listForManagementGroupNext operation. */ -export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; - -/** Optional parameters. */ -export interface PolicyAssignmentsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} - /** Contains response data for the listNext operation. */ -export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; +export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult; /** Optional parameters. */ export interface PolicyDefinitionsCreateOrUpdateOptionalParams @@ -942,36 +981,21 @@ export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionLis /** Optional parameters. */ export interface PolicyDefinitionsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type PolicyDefinitionsListNextResponse = PolicyDefinitionListResult; /** Optional parameters. */ export interface PolicyDefinitionsListBuiltInNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBuiltInNext operation. */ export type PolicyDefinitionsListBuiltInNextResponse = PolicyDefinitionListResult; /** Optional parameters. */ export interface PolicyDefinitionsListByManagementGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. */ - filter?: string; - /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByManagementGroupNext operation. */ export type PolicyDefinitionsListByManagementGroupNextResponse = PolicyDefinitionListResult; @@ -1057,39 +1081,156 @@ export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinit /** Optional parameters. */ export interface PolicySetDefinitionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionsListBuiltInNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBuiltInNext operation. */ +export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionListResult; + +/** Optional parameters. */ +export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByManagementGroupNext operation. */ +export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDefinitionListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type PolicyAssignmentsDeleteResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type PolicyAssignmentsCreateResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PolicyAssignmentsGetResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PolicyAssignmentsUpdateResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the listNext operation. */ -export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult; +/** Contains response data for the listForResourceGroup operation. */ +export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicySetDefinitionsListBuiltInNextOptionalParams +export interface PolicyAssignmentsListForResourceOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the listBuiltInNext operation. */ -export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionListResult; +/** Contains response data for the listForResource operation. */ +export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult; /** Optional parameters. */ -export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams +export interface PolicyAssignmentsListForManagementGroupOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. */ + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ filter?: string; /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ top?: number; } -/** Contains response data for the listByManagementGroupNext operation. */ -export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDefinitionListResult; +/** Contains response data for the listForManagementGroup operation. */ +export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. */ + filter?: string; + /** Maximum number of records to return. When the $top filter is not provided, it will return 500 records. */ + top?: number; +} + +/** Contains response data for the list operation. */ +export type PolicyAssignmentsListResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsDeleteByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the deleteById operation. */ +export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsCreateByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createById operation. */ +export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsGetByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getById operation. */ +export type PolicyAssignmentsGetByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsUpdateByIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateById operation. */ +export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForResourceGroupNext operation. */ +export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForResourceNext operation. */ +export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListForManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForManagementGroupNext operation. */ +export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignmentListResult; + +/** Optional parameters. */ +export interface PolicyAssignmentsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult; /** Optional parameters. */ export interface PolicyExemptionsDeleteOptionalParams @@ -1109,6 +1250,13 @@ export interface PolicyExemptionsGetOptionalParams /** Contains response data for the get operation. */ export type PolicyExemptionsGetResponse = PolicyExemption; +/** Optional parameters. */ +export interface PolicyExemptionsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PolicyExemptionsUpdateResponse = PolicyExemption; + /** Optional parameters. */ export interface PolicyExemptionsListOptionalParams extends coreClient.OperationOptions { @@ -1151,44 +1299,160 @@ export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionList /** Optional parameters. */ export interface PolicyExemptionsListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type PolicyExemptionsListNextResponse = PolicyExemptionListResult; /** Optional parameters. */ export interface PolicyExemptionsListForResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listForResourceGroupNext operation. */ export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionListResult; /** Optional parameters. */ export interface PolicyExemptionsListForResourceNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listForResourceNext operation. */ export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListResult; /** Optional parameters. */ export interface PolicyExemptionsListForManagementGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. If $filter=policyAssignmentId eq '{value}' is provided. the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listForManagementGroupNext operation. */ export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemptionListResult; +/** Optional parameters. */ +export interface VariablesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface VariablesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type VariablesCreateOrUpdateResponse = Variable; + +/** Optional parameters. */ +export interface VariablesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VariablesGetResponse = Variable; + +/** Optional parameters. */ +export interface VariablesDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface VariablesCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type VariablesCreateOrUpdateAtManagementGroupResponse = Variable; + +/** Optional parameters. */ +export interface VariablesGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtManagementGroup operation. */ +export type VariablesGetAtManagementGroupResponse = Variable; + +/** Optional parameters. */ +export interface VariablesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VariablesListResponse = VariableListResult; + +/** Optional parameters. */ +export interface VariablesListForManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForManagementGroup operation. */ +export type VariablesListForManagementGroupResponse = VariableListResult; + +/** Optional parameters. */ +export interface VariablesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VariablesListNextResponse = VariableListResult; + +/** Optional parameters. */ +export interface VariablesListForManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForManagementGroupNext operation. */ +export type VariablesListForManagementGroupNextResponse = VariableListResult; + +/** Optional parameters. */ +export interface VariableValuesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface VariableValuesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type VariableValuesCreateOrUpdateResponse = VariableValue; + +/** Optional parameters. */ +export interface VariableValuesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VariableValuesGetResponse = VariableValue; + +/** Optional parameters. */ +export interface VariableValuesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type VariableValuesListResponse = VariableValueListResult; + +/** Optional parameters. */ +export interface VariableValuesListForManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForManagementGroup operation. */ +export type VariableValuesListForManagementGroupResponse = VariableValueListResult; + +/** Optional parameters. */ +export interface VariableValuesDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface VariableValuesCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type VariableValuesCreateOrUpdateAtManagementGroupResponse = VariableValue; + +/** Optional parameters. */ +export interface VariableValuesGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAtManagementGroup operation. */ +export type VariableValuesGetAtManagementGroupResponse = VariableValue; + +/** Optional parameters. */ +export interface VariableValuesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type VariableValuesListNextResponse = VariableValueListResult; + +/** Optional parameters. */ +export interface VariableValuesListForManagementGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForManagementGroupNext operation. */ +export type VariableValuesListForManagementGroupNextResponse = VariableValueListResult; + /** Optional parameters. */ export interface PolicyClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index 118f4863c37e..0f3034c321d6 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -472,10 +472,10 @@ export const DataPolicyManifestListResult: coreClient.CompositeMapper = { } }; -export const PolicyAssignment: coreClient.CompositeMapper = { +export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignment", + className: "PolicyDefinition", modelProperties: { id: { serializedName: "id", @@ -484,13 +484,6 @@ export const PolicyAssignment: coreClient.CompositeMapper = { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, name: { serializedName: "name", readOnly: true, @@ -498,19 +491,13 @@ export const PolicyAssignment: coreClient.CompositeMapper = { name: "String" } }, - location: { - serializedName: "location", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } - }, systemData: { serializedName: "systemData", type: { @@ -518,73 +505,49 @@ export const PolicyAssignment: coreClient.CompositeMapper = { className: "SystemData" } }, - displayName: { - serializedName: "properties.displayName", + policyType: { + serializedName: "properties.policyType", type: { name: "String" } }, - policyDefinitionId: { - serializedName: "properties.policyDefinitionId", + mode: { + defaultValue: "Indexed", + serializedName: "properties.mode", type: { name: "String" } }, - scope: { - serializedName: "properties.scope", - readOnly: true, + displayName: { + serializedName: "properties.displayName", type: { name: "String" } }, - notScopes: { - serializedName: "properties.notScopes", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - parameters: { - serializedName: "properties.parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" } - } - } - }, description: { serializedName: "properties.description", type: { name: "String" } }, - metadata: { - serializedName: "properties.metadata", + policyRule: { + serializedName: "properties.policyRule", type: { name: "any" } }, - enforcementMode: { - defaultValue: "Default", - serializedName: "properties.enforcementMode", + metadata: { + serializedName: "properties.metadata", type: { - name: "String" + name: "any" } }, - nonComplianceMessages: { - serializedName: "properties.nonComplianceMessages", + parameters: { + serializedName: "properties.parameters", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NonComplianceMessage" - } + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterDefinitionsValue" } } } } @@ -592,102 +555,73 @@ export const PolicyAssignment: coreClient.CompositeMapper = { } }; -export const ParameterValuesValue: coreClient.CompositeMapper = { +export const ParameterDefinitionsValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ParameterValuesValue", + className: "ParameterDefinitionsValue", modelProperties: { - value: { - serializedName: "value", + type: { + serializedName: "type", type: { - name: "any" + name: "String" } - } - } - } -}; - -export const NonComplianceMessage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NonComplianceMessage", - modelProperties: { - message: { - serializedName: "message", - required: true, + }, + allowedValues: { + serializedName: "allowedValues", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "any" + } + } } }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", + defaultValue: { + serializedName: "defaultValue", type: { - name: "String" + name: "any" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Composite", + className: "ParameterDefinitionsValueMetadata" } } } } }; -export const Identity: coreClient.CompositeMapper = { +export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Identity", + className: "ParameterDefinitionsValueMetadata", + additionalProperties: { type: { name: "Object" } }, modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + displayName: { + serializedName: "displayName", type: { name: "String" } }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + description: { + serializedName: "description", type: { name: "String" } }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"] - } - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue" - } - } - } - } - } - } -}; - -export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + strongType: { + serializedName: "strongType", type: { name: "String" } }, - clientId: { - serializedName: "clientId", - readOnly: true, + assignPermissions: { + serializedName: "assignPermissions", type: { - name: "String" + name: "Boolean" } } } @@ -739,32 +673,10 @@ export const SystemData: coreClient.CompositeMapper = { } }; -export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyAssignmentUpdate", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" - } - } - } - } -}; - -export const PolicyAssignmentListResult: coreClient.CompositeMapper = { +export const PolicyDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyAssignmentListResult", + className: "PolicyDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -773,7 +685,7 @@ export const PolicyAssignmentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyAssignment" + className: "PolicyDefinition" } } } @@ -788,10 +700,10 @@ export const PolicyAssignmentListResult: coreClient.CompositeMapper = { } }; -export const PolicyDefinition: coreClient.CompositeMapper = { +export const PolicySetDefinition: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinition", + className: "PolicySetDefinition", modelProperties: { id: { serializedName: "id", @@ -827,13 +739,6 @@ export const PolicyDefinition: coreClient.CompositeMapper = { name: "String" } }, - mode: { - defaultValue: "Indexed", - serializedName: "properties.mode", - type: { - name: "String" - } - }, displayName: { serializedName: "properties.displayName", type: { @@ -846,12 +751,6 @@ export const PolicyDefinition: coreClient.CompositeMapper = { name: "String" } }, - policyRule: { - serializedName: "properties.policyRule", - type: { - name: "any" - } - }, metadata: { serializedName: "properties.metadata", type: { @@ -866,88 +765,537 @@ export const PolicyDefinition: coreClient.CompositeMapper = { type: { name: "Composite", className: "ParameterDefinitionsValue" } } } - } - } - } -}; - -export const ParameterDefinitionsValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ParameterDefinitionsValue", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } }, - allowedValues: { - serializedName: "allowedValues", + policyDefinitions: { + serializedName: "properties.policyDefinitions", type: { name: "Sequence", element: { type: { - name: "any" + name: "Composite", + className: "PolicyDefinitionReference" } } } }, - defaultValue: { - serializedName: "defaultValue", + policyDefinitionGroups: { + serializedName: "properties.policyDefinitionGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionGroup" + } + } + } + } + } + } +}; + +export const PolicyDefinitionReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionReference", + modelProperties: { + policyDefinitionId: { + serializedName: "policyDefinitionId", + required: true, + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterValuesValue" } + } + } + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + }, + groupNames: { + serializedName: "groupNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ParameterValuesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ParameterValuesValue", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "any" + } + } + } + } +}; + +export const PolicyDefinitionGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyDefinitionGroup", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + additionalMetadataId: { + serializedName: "additionalMetadataId", + type: { + name: "String" + } + } + } + } +}; + +export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicySetDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySetDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyAssignment", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + policyDefinitionId: { + serializedName: "properties.policyDefinitionId", + type: { + name: "String" + } + }, + scope: { + serializedName: "properties.scope", + readOnly: true, + type: { + name: "String" + } + }, + notScopes: { + serializedName: "properties.notScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "ParameterValuesValue" } + } + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "any" + } + }, + enforcementMode: { + defaultValue: "Default", + serializedName: "properties.enforcementMode", + type: { + name: "String" + } + }, + nonComplianceMessages: { + serializedName: "properties.nonComplianceMessages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NonComplianceMessage" + } + } + } + }, + resourceSelectors: { + serializedName: "properties.resourceSelectors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceSelector" + } + } + } + }, + overrides: { + serializedName: "properties.overrides", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override" + } + } + } + } + } + } +}; + +export const NonComplianceMessage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NonComplianceMessage", + modelProperties: { + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + policyDefinitionReferenceId: { + serializedName: "policyDefinitionReferenceId", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceSelector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceSelector", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + selectors: { + serializedName: "selectors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector" + } + } + } + } + } + } +}; + +export const Selector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Selector", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + in: { + serializedName: "in", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + notIn: { + serializedName: "notIn", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Override: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Override", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + }, + selectors: { + serializedName: "selectors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector" + } + } + } + } + } + } +}; + +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["SystemAssigned", "UserAssigned", "None"] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue" + } + } + } + } + } + } +}; + +export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, type: { - name: "any" + name: "String" } }, - metadata: { - serializedName: "metadata", + clientId: { + serializedName: "clientId", + readOnly: true, type: { - name: "Composite", - className: "ParameterDefinitionsValueMetadata" + name: "String" } } } } }; -export const ParameterDefinitionsValueMetadata: coreClient.CompositeMapper = { +export const PolicyAssignmentUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ParameterDefinitionsValueMetadata", - additionalProperties: { type: { name: "Object" } }, + className: "PolicyAssignmentUpdate", modelProperties: { - displayName: { - serializedName: "displayName", + location: { + serializedName: "location", type: { name: "String" } }, - description: { - serializedName: "description", + identity: { + serializedName: "identity", type: { - name: "String" + name: "Composite", + className: "Identity" } }, - strongType: { - serializedName: "strongType", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceSelector" + } + } } }, - assignPermissions: { - serializedName: "assignPermissions", + overrides: { + serializedName: "properties.overrides", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Override" + } + } } } } } }; -export const PolicyDefinitionListResult: coreClient.CompositeMapper = { +export const PolicyAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionListResult", + className: "PolicyAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -956,7 +1304,7 @@ export const PolicyDefinitionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyDefinition" + className: "PolicyAssignment" } } } @@ -971,11 +1319,18 @@ export const PolicyDefinitionListResult: coreClient.CompositeMapper = { } }; -export const PolicySetDefinition: coreClient.CompositeMapper = { +export const PolicyExemption: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinition", + className: "PolicyExemption", modelProperties: { + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, id: { serializedName: "id", readOnly: true, @@ -997,19 +1352,37 @@ export const PolicySetDefinition: coreClient.CompositeMapper = { name: "String" } }, - systemData: { - serializedName: "systemData", + policyAssignmentId: { + serializedName: "properties.policyAssignmentId", + required: true, type: { - name: "Composite", - className: "SystemData" + name: "String" } }, - policyType: { - serializedName: "properties.policyType", + policyDefinitionReferenceIds: { + serializedName: "properties.policyDefinitionReferenceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + exemptionCategory: { + serializedName: "properties.exemptionCategory", + required: true, type: { name: "String" } }, + expiresOn: { + serializedName: "properties.expiresOn", + type: { + name: "DateTime" + } + }, displayName: { serializedName: "properties.displayName", type: { @@ -1028,117 +1401,141 @@ export const PolicySetDefinition: coreClient.CompositeMapper = { name: "any" } }, - parameters: { - serializedName: "properties.parameters", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterDefinitionsValue" } - } - } - }, - policyDefinitions: { - serializedName: "properties.policyDefinitions", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { name: "Sequence", element: { type: { name: "Composite", - className: "PolicyDefinitionReference" + className: "ResourceSelector" } } } }, - policyDefinitionGroups: { - serializedName: "properties.policyDefinitionGroups", + assignmentScopeValidation: { + serializedName: "properties.assignmentScopeValidation", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyDefinitionGroup" - } - } + name: "String" } } } } }; -export const PolicyDefinitionReference: coreClient.CompositeMapper = { +export const PolicyExemptionUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionReference", + className: "PolicyExemptionUpdate", modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", - required: true, - type: { - name: "String" - } - }, - parameters: { - serializedName: "parameters", + resourceSelectors: { + serializedName: "properties.resourceSelectors", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ParameterValuesValue" } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceSelector" + } } } }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", + assignmentScopeValidation: { + serializedName: "properties.assignmentScopeValidation", type: { name: "String" } - }, - groupNames: { - serializedName: "groupNames", + } + } + } +}; + +export const PolicyExemptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyExemptionListResult", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PolicyExemption" } } } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } } } } }; -export const PolicyDefinitionGroup: coreClient.CompositeMapper = { +export const Variable: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyDefinitionGroup", + className: "Variable", modelProperties: { - name: { - serializedName: "name", - required: true, + systemData: { + serializedName: "systemData", type: { - name: "String" + name: "Composite", + className: "SystemData" } }, - displayName: { - serializedName: "displayName", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - category: { - serializedName: "category", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - additionalMetadataId: { - serializedName: "additionalMetadataId", + columns: { + serializedName: "properties.columns", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyVariableColumn" + } + } + } + } + } + } +}; + +export const PolicyVariableColumn: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyVariableColumn", + modelProperties: { + columnName: { + serializedName: "columnName", + required: true, type: { name: "String" } @@ -1147,10 +1544,10 @@ export const PolicyDefinitionGroup: coreClient.CompositeMapper = { } }; -export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { +export const VariableListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicySetDefinitionListResult", + className: "VariableListResult", modelProperties: { value: { serializedName: "value", @@ -1159,13 +1556,14 @@ export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicySetDefinition" + className: "Variable" } } } }, nextLink: { serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1174,10 +1572,10 @@ export const PolicySetDefinitionListResult: coreClient.CompositeMapper = { } }; -export const PolicyExemption: coreClient.CompositeMapper = { +export const VariableValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyExemption", + className: "VariableValue", modelProperties: { systemData: { serializedName: "systemData", @@ -1207,51 +1605,38 @@ export const PolicyExemption: coreClient.CompositeMapper = { name: "String" } }, - policyAssignmentId: { - serializedName: "properties.policyAssignmentId", + values: { + serializedName: "properties.values", required: true, - type: { - name: "String" - } - }, - policyDefinitionReferenceIds: { - serializedName: "properties.policyDefinitionReferenceIds", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PolicyVariableValueColumnValue" } } } - }, - exemptionCategory: { - serializedName: "properties.exemptionCategory", + } + } + } +}; + +export const PolicyVariableValueColumnValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyVariableValueColumnValue", + modelProperties: { + columnName: { + serializedName: "columnName", required: true, type: { name: "String" } }, - expiresOn: { - serializedName: "properties.expiresOn", - type: { - name: "DateTime" - } - }, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String" - } - }, - description: { - serializedName: "properties.description", - type: { - name: "String" - } - }, - metadata: { - serializedName: "properties.metadata", + columnValue: { + serializedName: "columnValue", + required: true, type: { name: "any" } @@ -1260,10 +1645,10 @@ export const PolicyExemption: coreClient.CompositeMapper = { } }; -export const PolicyExemptionListResult: coreClient.CompositeMapper = { +export const VariableValueListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PolicyExemptionListResult", + className: "VariableValueListResult", modelProperties: { value: { serializedName: "value", @@ -1272,7 +1657,7 @@ export const PolicyExemptionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "PolicyExemption" + className: "VariableValue" } } } diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index 89eaa4fbd9a6..428f8d574f42 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -12,11 +12,14 @@ import { OperationQueryParameter } from "@azure/core-client"; import { - PolicyAssignment as PolicyAssignmentMapper, - PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, PolicyDefinition as PolicyDefinitionMapper, PolicySetDefinition as PolicySetDefinitionMapper, - PolicyExemption as PolicyExemptionMapper + PolicyAssignment as PolicyAssignmentMapper, + PolicyAssignmentUpdate as PolicyAssignmentUpdateMapper, + PolicyExemption as PolicyExemptionMapper, + PolicyExemptionUpdate as PolicyExemptionUpdateMapper, + Variable as VariableMapper, + VariableValue as VariableValueMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -89,22 +92,27 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; -export const scope: OperationURLParameter = { - parameterPath: "scope", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "scope", - required: true, + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } - }, - skipEncoding: true + } }; -export const policyAssignmentName: OperationURLParameter = { - parameterPath: "policyAssignmentName", +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyDefinitionMapper +}; + +export const policyDefinitionName: OperationURLParameter = { + parameterPath: "policyDefinitionName", mapper: { - serializedName: "policyAssignmentName", + serializedName: "policyDefinitionName", required: true, type: { name: "String" @@ -124,37 +132,21 @@ export const apiVersion1: OperationQueryParameter = { } }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", + serializedName: "subscriptionId", + required: true, type: { name: "String" } } }; -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyAssignmentMapper -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyAssignmentUpdateMapper -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", mapper: { - constraints: { - Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), - MaxLength: 90, - MinLength: 1 - }, - serializedName: "resourceGroupName", + serializedName: "managementGroupId", required: true, type: { name: "String" @@ -176,10 +168,76 @@ export const top: OperationQueryParameter = { } }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: PolicySetDefinitionMapper +}; + +export const policySetDefinitionName: OperationURLParameter = { + parameterPath: "policySetDefinitionName", mapper: { - serializedName: "subscriptionId", + serializedName: "policySetDefinitionName", + required: true, + type: { + name: "String" + } + } +}; + +export const scope: OperationURLParameter = { + parameterPath: "scope", + mapper: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const policyAssignmentName: OperationURLParameter = { + parameterPath: "policyAssignmentName", + mapper: { + serializedName: "policyAssignmentName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion2: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-06-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyAssignmentUpdateMapper +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, type: { name: "String" @@ -233,17 +291,6 @@ export const resourceName: OperationURLParameter = { } }; -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", - mapper: { - serializedName: "managementGroupId", - required: true, - type: { - name: "String" - } - } -}; - export const policyAssignmentId: OperationURLParameter = { parameterPath: "policyAssignmentId", mapper: { @@ -256,31 +303,43 @@ export const policyAssignmentId: OperationURLParameter = { skipEncoding: true }; -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: PolicyDefinitionMapper +export const policyExemptionName: OperationURLParameter = { + parameterPath: "policyExemptionName", + mapper: { + serializedName: "policyExemptionName", + required: true, + type: { + name: "String" + } + } }; -export const policyDefinitionName: OperationURLParameter = { - parameterPath: "policyDefinitionName", +export const apiVersion3: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "policyDefinitionName", - required: true, + defaultValue: "2022-07-01-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const parameters3: OperationParameter = { +export const parameters4: OperationParameter = { parameterPath: "parameters", - mapper: PolicySetDefinitionMapper + mapper: PolicyExemptionMapper }; -export const policySetDefinitionName: OperationURLParameter = { - parameterPath: "policySetDefinitionName", +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: PolicyExemptionUpdateMapper +}; + +export const variableName: OperationURLParameter = { + parameterPath: "variableName", mapper: { - serializedName: "policySetDefinitionName", + serializedName: "variableName", required: true, type: { name: "String" @@ -288,30 +347,35 @@ export const policySetDefinitionName: OperationURLParameter = { } }; -export const policyExemptionName: OperationURLParameter = { - parameterPath: "policyExemptionName", +export const apiVersion4: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - serializedName: "policyExemptionName", - required: true, + defaultValue: "2022-08-01-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: VariableMapper +}; + +export const variableValueName: OperationURLParameter = { + parameterPath: "variableValueName", mapper: { - defaultValue: "2020-07-01-preview", - isConstant: true, - serializedName: "api-version", + serializedName: "variableValueName", + required: true, type: { name: "String" } } }; -export const parameters4: OperationParameter = { +export const parameters7: OperationParameter = { parameterPath: "parameters", - mapper: PolicyExemptionMapper + mapper: VariableValueMapper }; diff --git a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts index 83dc011f316b..9f4abd98aba3 100644 --- a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts +++ b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts @@ -184,7 +184,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index eff8c4c2a63a..b0d3415bd307 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -7,7 +7,9 @@ */ export * from "./dataPolicyManifests"; -export * from "./policyAssignments"; export * from "./policyDefinitions"; export * from "./policySetDefinitions"; +export * from "./policyAssignments"; export * from "./policyExemptions"; +export * from "./variables"; +export * from "./variableValues"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index ec9936e33a4a..fdae4d62390a 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -829,7 +829,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.scope, @@ -850,8 +850,8 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.scope, @@ -873,7 +873,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.scope, @@ -894,8 +894,8 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.scope, @@ -917,11 +917,11 @@ const listForResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion2], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -938,11 +938,11 @@ const listForResourceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion2], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, @@ -963,7 +963,7 @@ const listForManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], serializer @@ -980,7 +980,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], + queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -997,7 +997,7 @@ const deleteByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], serializer @@ -1013,8 +1013,8 @@ const createByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -1031,7 +1031,7 @@ const getByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept], serializer @@ -1047,8 +1047,8 @@ const updateByIdOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion2], urlParameters: [Parameters.$host, Parameters.policyAssignmentId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -1065,12 +1065,11 @@ const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -1086,12 +1085,11 @@ const listForResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, @@ -1111,7 +1109,6 @@ const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -1131,7 +1128,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index 29d4669b75cb..b5b2009d88a3 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -494,12 +494,12 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.subscriptionId ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -519,8 +519,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.subscriptionId ], headerParameters: [Parameters.accept], serializer @@ -540,8 +540,8 @@ const getOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.subscriptionId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.subscriptionId ], headerParameters: [Parameters.accept], serializer @@ -575,12 +575,12 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.managementGroupId ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -600,8 +600,8 @@ const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.managementGroupId ], headerParameters: [Parameters.accept], serializer @@ -621,8 +621,8 @@ const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, - Parameters.managementGroupId, - Parameters.policyDefinitionName + Parameters.policyDefinitionName, + Parameters.managementGroupId ], headerParameters: [Parameters.accept], serializer @@ -688,7 +688,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -708,7 +707,6 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer @@ -724,7 +722,6 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/policy/arm-policy/src/operations/policyExemptions.ts b/sdk/policy/arm-policy/src/operations/policyExemptions.ts index b2584258caf4..13000ef3bb9a 100644 --- a/sdk/policy/arm-policy/src/operations/policyExemptions.ts +++ b/sdk/policy/arm-policy/src/operations/policyExemptions.ts @@ -32,6 +32,9 @@ import { PolicyExemptionsCreateOrUpdateResponse, PolicyExemptionsGetOptionalParams, PolicyExemptionsGetResponse, + PolicyExemptionUpdate, + PolicyExemptionsUpdateOptionalParams, + PolicyExemptionsUpdateResponse, PolicyExemptionsListNextResponse, PolicyExemptionsListForResourceGroupNextResponse, PolicyExemptionsListForResourceNextResponse, @@ -458,6 +461,29 @@ export class PolicyExemptionsImpl implements PolicyExemptions { ); } + /** + * This operation updates a policy exemption with the given scope and name. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param parameters Parameters for policy exemption patch request. + * @param options The options parameters. + */ + update( + scope: string, + policyExemptionName: string, + parameters: PolicyExemptionUpdate, + options?: PolicyExemptionsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { scope, policyExemptionName, parameters, options }, + updateOperationSpec + ); + } + /** * This operation retrieves the list of all policy exemptions associated with the given subscription * that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', @@ -657,7 +683,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.scope, @@ -682,7 +708,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.scope, @@ -704,7 +730,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion2], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.scope, @@ -713,6 +739,29 @@ const getOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.PolicyExemption + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.scope, + Parameters.policyExemptionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyExemptions", @@ -725,7 +774,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], + queryParameters: [Parameters.filter, Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -742,11 +791,11 @@ const listForResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], + queryParameters: [Parameters.filter, Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -763,11 +812,11 @@ const listForResourceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], + queryParameters: [Parameters.filter, Parameters.apiVersion3], urlParameters: [ Parameters.$host, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, @@ -788,7 +837,7 @@ const listForManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], + queryParameters: [Parameters.filter, Parameters.apiVersion3], urlParameters: [Parameters.$host, Parameters.managementGroupId], headerParameters: [Parameters.accept], serializer @@ -804,7 +853,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -824,12 +872,11 @@ const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], headerParameters: [Parameters.accept], serializer @@ -845,12 +892,11 @@ const listForResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.resourceGroupName, Parameters.subscriptionId, + Parameters.resourceGroupName, Parameters.resourceProviderNamespace, Parameters.parentResourcePath, Parameters.resourceType, @@ -870,7 +916,6 @@ const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 41ddd5716f4a..799776947520 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -495,7 +495,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, @@ -612,7 +612,7 @@ const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, @@ -692,7 +692,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -712,7 +711,6 @@ const listBuiltInNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer @@ -728,7 +726,6 @@ const listByManagementGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.filter, Parameters.apiVersion1, Parameters.top], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/policy/arm-policy/src/operations/variableValues.ts b/sdk/policy/arm-policy/src/operations/variableValues.ts new file mode 100644 index 000000000000..689377357469 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/variableValues.ts @@ -0,0 +1,615 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { VariableValues } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClient } from "../policyClient"; +import { + VariableValue, + VariableValuesListNextOptionalParams, + VariableValuesListOptionalParams, + VariableValuesListResponse, + VariableValuesListForManagementGroupNextOptionalParams, + VariableValuesListForManagementGroupOptionalParams, + VariableValuesListForManagementGroupResponse, + VariableValuesDeleteOptionalParams, + VariableValuesCreateOrUpdateOptionalParams, + VariableValuesCreateOrUpdateResponse, + VariableValuesGetOptionalParams, + VariableValuesGetResponse, + VariableValuesDeleteAtManagementGroupOptionalParams, + VariableValuesCreateOrUpdateAtManagementGroupOptionalParams, + VariableValuesCreateOrUpdateAtManagementGroupResponse, + VariableValuesGetAtManagementGroupOptionalParams, + VariableValuesGetAtManagementGroupResponse, + VariableValuesListNextResponse, + VariableValuesListForManagementGroupNextResponse +} from "../models"; + +/// +/** Class containing VariableValues operations. */ +export class VariableValuesImpl implements VariableValues { + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class VariableValues class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves the list of all variable values associated with the given variable that is + * at a subscription level. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + public list( + variableName: string, + options?: VariableValuesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(variableName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(variableName, options, settings); + } + }; + } + + private async *listPagingPage( + variableName: string, + options?: VariableValuesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VariableValuesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(variableName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(variableName, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + variableName: string, + options?: VariableValuesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(variableName, options)) { + yield* page; + } + } + + /** + * This operation retrieves the list of all variable values applicable the variable indicated at the + * management group scope. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + public listForManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariableValuesListForManagementGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForManagementGroupPagingAll( + managementGroupId, + variableName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listForManagementGroupPagingPage( + managementGroupId, + variableName, + options, + settings + ); + } + }; + } + + private async *listForManagementGroupPagingPage( + managementGroupId: string, + variableName: string, + options?: VariableValuesListForManagementGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VariableValuesListForManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listForManagementGroup( + managementGroupId, + variableName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listForManagementGroupNext( + managementGroupId, + variableName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listForManagementGroupPagingAll( + managementGroupId: string, + variableName: string, + options?: VariableValuesListForManagementGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForManagementGroupPagingPage( + managementGroupId, + variableName, + options + )) { + yield* page; + } + } + + /** + * This operation deletes a variable value, given its name, the subscription it was created in, and the + * variable it belongs to. The scope of a variable value is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + delete( + variableName: string, + variableValueName: string, + options?: VariableValuesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, variableValueName, options }, + deleteOperationSpec + ); + } + + /** + * This operation creates or updates a variable value with the given subscription and name for a given + * variable. Variable values are scoped to the variable for which they are created for. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param parameters Parameters for the variable value. + * @param options The options parameters. + */ + createOrUpdate( + variableName: string, + variableValueName: string, + parameters: VariableValue, + options?: VariableValuesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, variableValueName, parameters, options }, + createOrUpdateOperationSpec + ); + } + + /** + * This operation retrieves a single variable value; given its name, subscription it was created at and + * the variable it's created for. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + get( + variableName: string, + variableValueName: string, + options?: VariableValuesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, variableValueName, options }, + getOperationSpec + ); + } + + /** + * This operation retrieves the list of all variable values associated with the given variable that is + * at a subscription level. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + private _list( + variableName: string, + options?: VariableValuesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, options }, + listOperationSpec + ); + } + + /** + * This operation retrieves the list of all variable values applicable the variable indicated at the + * management group scope. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + private _listForManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariableValuesListForManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, options }, + listForManagementGroupOperationSpec + ); + } + + /** + * This operation deletes a variable value, given its name, the management group it was created in, and + * the variable it belongs to. The scope of a variable value is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + options?: VariableValuesDeleteAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, variableValueName, options }, + deleteAtManagementGroupOperationSpec + ); + } + + /** + * This operation creates or updates a variable value with the given management group and name for a + * given variable. Variable values are scoped to the variable for which they are created for. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param parameters Parameters for the variable value. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + parameters: VariableValue, + options?: VariableValuesCreateOrUpdateAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + variableName, + variableValueName, + parameters, + options + }, + createOrUpdateAtManagementGroupOperationSpec + ); + } + + /** + * This operation retrieves a single variable value; given its name, management group it was created + * at and the variable it's created for. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + options?: VariableValuesGetAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, variableValueName, options }, + getAtManagementGroupOperationSpec + ); + } + + /** + * ListNext + * @param variableName The name of the variable to operate on. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + variableName: string, + nextLink: string, + options?: VariableValuesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListForManagementGroupNext + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param nextLink The nextLink from the previous successful call to the ListForManagementGroup method. + * @param options The options parameters. + */ + private _listForManagementGroupNext( + managementGroupId: string, + variableName: string, + nextLink: string, + options?: VariableValuesListForManagementGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, nextLink, options }, + listForManagementGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VariableValue + }, + 201: { + bodyMapper: Mappers.VariableValue + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValue + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}/values", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValueListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}/values", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValueListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VariableValue + }, + 201: { + bodyMapper: Mappers.VariableValue + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}/values/{variableValueName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValue + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName, + Parameters.variableValueName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValueListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableValueListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.managementGroupId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/policy/arm-policy/src/operations/variables.ts b/sdk/policy/arm-policy/src/operations/variables.ts new file mode 100644 index 000000000000..8213324a1619 --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/variables.ts @@ -0,0 +1,549 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Variables } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClient } from "../policyClient"; +import { + Variable, + VariablesListNextOptionalParams, + VariablesListOptionalParams, + VariablesListResponse, + VariablesListForManagementGroupNextOptionalParams, + VariablesListForManagementGroupOptionalParams, + VariablesListForManagementGroupResponse, + VariablesDeleteOptionalParams, + VariablesCreateOrUpdateOptionalParams, + VariablesCreateOrUpdateResponse, + VariablesGetOptionalParams, + VariablesGetResponse, + VariablesDeleteAtManagementGroupOptionalParams, + VariablesCreateOrUpdateAtManagementGroupOptionalParams, + VariablesCreateOrUpdateAtManagementGroupResponse, + VariablesGetAtManagementGroupOptionalParams, + VariablesGetAtManagementGroupResponse, + VariablesListNextResponse, + VariablesListForManagementGroupNextResponse +} from "../models"; + +/// +/** Class containing Variables operations. */ +export class VariablesImpl implements Variables { + private readonly client: PolicyClient; + + /** + * Initialize a new instance of the class Variables class. + * @param client Reference to the service client + */ + constructor(client: PolicyClient) { + this.client = client; + } + + /** + * This operation retrieves the list of all variables associated with the given subscription. + * @param options The options parameters. + */ + public list( + options?: VariablesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: VariablesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VariablesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: VariablesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * This operation retrieves the list of all variables applicable to the management group. + * @param managementGroupId The ID of the management group. + * @param options The options parameters. + */ + public listForManagementGroup( + managementGroupId: string, + options?: VariablesListForManagementGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForManagementGroupPagingAll( + managementGroupId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listForManagementGroupPagingPage( + managementGroupId, + options, + settings + ); + } + }; + } + + private async *listForManagementGroupPagingPage( + managementGroupId: string, + options?: VariablesListForManagementGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VariablesListForManagementGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listForManagementGroup(managementGroupId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listForManagementGroupNext( + managementGroupId, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listForManagementGroupPagingAll( + managementGroupId: string, + options?: VariablesListForManagementGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForManagementGroupPagingPage( + managementGroupId, + options + )) { + yield* page; + } + } + + /** + * This operation deletes a variable, given its name and the subscription it was created in. The scope + * of a variable is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + delete( + variableName: string, + options?: VariablesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, options }, + deleteOperationSpec + ); + } + + /** + * This operation creates or updates a variable with the given subscription and name. Policy variables + * can only be used by a policy definition at the scope they are created or below. + * @param variableName The name of the variable to operate on. + * @param parameters Parameters for the variable. + * @param options The options parameters. + */ + createOrUpdate( + variableName: string, + parameters: Variable, + options?: VariablesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, parameters, options }, + createOrUpdateOperationSpec + ); + } + + /** + * This operation retrieves a single variable, given its name and the subscription it was created at. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + get( + variableName: string, + options?: VariablesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { variableName, options }, + getOperationSpec + ); + } + + /** + * This operation deletes a variable, given its name and the management group it was created in. The + * scope of a variable is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariablesDeleteAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, options }, + deleteAtManagementGroupOperationSpec + ); + } + + /** + * This operation creates or updates a variable with the given management group and name. Policy + * variables can only be used by a policy definition at the scope they are created or below. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param parameters Parameters for the variable. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupId: string, + variableName: string, + parameters: Variable, + options?: VariablesCreateOrUpdateAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, parameters, options }, + createOrUpdateAtManagementGroupOperationSpec + ); + } + + /** + * This operation retrieves a single variable, given its name and the management group it was created + * at. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariablesGetAtManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, variableName, options }, + getAtManagementGroupOperationSpec + ); + } + + /** + * This operation retrieves the list of all variables associated with the given subscription. + * @param options The options parameters. + */ + private _list( + options?: VariablesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * This operation retrieves the list of all variables applicable to the management group. + * @param managementGroupId The ID of the management group. + * @param options The options parameters. + */ + private _listForManagementGroup( + managementGroupId: string, + options?: VariablesListForManagementGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, options }, + listForManagementGroupOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: VariablesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListForManagementGroupNext + * @param managementGroupId The ID of the management group. + * @param nextLink The nextLink from the previous successful call to the ListForManagementGroup method. + * @param options The options parameters. + */ + private _listForManagementGroupNext( + managementGroupId: string, + nextLink: string, + options?: VariablesListForManagementGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, nextLink, options }, + listForManagementGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Variable + }, + 201: { + bodyMapper: Mappers.Variable + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Variable + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Variable + }, + 201: { + bodyMapper: Mappers.Variable + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables/{variableName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Variable + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.variableName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/variables", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listForManagementGroupOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/variables", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion4], + urlParameters: [Parameters.$host, Parameters.managementGroupId], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VariableListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.managementGroupId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts index eff8c4c2a63a..b0d3415bd307 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/index.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/index.ts @@ -7,7 +7,9 @@ */ export * from "./dataPolicyManifests"; -export * from "./policyAssignments"; export * from "./policyDefinitions"; export * from "./policySetDefinitions"; +export * from "./policyAssignments"; export * from "./policyExemptions"; +export * from "./variables"; +export * from "./variableValues"; diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts b/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts index 7fdc61601594..9c9c1f83c9c5 100644 --- a/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts +++ b/sdk/policy/arm-policy/src/operationsInterfaces/policyExemptions.ts @@ -17,7 +17,10 @@ import { PolicyExemptionsCreateOrUpdateOptionalParams, PolicyExemptionsCreateOrUpdateResponse, PolicyExemptionsGetOptionalParams, - PolicyExemptionsGetResponse + PolicyExemptionsGetResponse, + PolicyExemptionUpdate, + PolicyExemptionsUpdateOptionalParams, + PolicyExemptionsUpdateResponse } from "../models"; /// @@ -148,4 +151,21 @@ export interface PolicyExemptions { policyExemptionName: string, options?: PolicyExemptionsGetOptionalParams ): Promise; + /** + * This operation updates a policy exemption with the given scope and name. + * @param scope The scope of the policy exemption. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyExemptionName The name of the policy exemption to delete. + * @param parameters Parameters for policy exemption patch request. + * @param options The options parameters. + */ + update( + scope: string, + policyExemptionName: string, + parameters: PolicyExemptionUpdate, + options?: PolicyExemptionsUpdateOptionalParams + ): Promise; } diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/variableValues.ts b/sdk/policy/arm-policy/src/operationsInterfaces/variableValues.ts new file mode 100644 index 000000000000..7587eea4f476 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/variableValues.ts @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + VariableValue, + VariableValuesListOptionalParams, + VariableValuesListForManagementGroupOptionalParams, + VariableValuesDeleteOptionalParams, + VariableValuesCreateOrUpdateOptionalParams, + VariableValuesCreateOrUpdateResponse, + VariableValuesGetOptionalParams, + VariableValuesGetResponse, + VariableValuesDeleteAtManagementGroupOptionalParams, + VariableValuesCreateOrUpdateAtManagementGroupOptionalParams, + VariableValuesCreateOrUpdateAtManagementGroupResponse, + VariableValuesGetAtManagementGroupOptionalParams, + VariableValuesGetAtManagementGroupResponse +} from "../models"; + +/// +/** Interface representing a VariableValues. */ +export interface VariableValues { + /** + * This operation retrieves the list of all variable values associated with the given variable that is + * at a subscription level. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + list( + variableName: string, + options?: VariableValuesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * This operation retrieves the list of all variable values applicable the variable indicated at the + * management group scope. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + listForManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariableValuesListForManagementGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * This operation deletes a variable value, given its name, the subscription it was created in, and the + * variable it belongs to. The scope of a variable value is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + delete( + variableName: string, + variableValueName: string, + options?: VariableValuesDeleteOptionalParams + ): Promise; + /** + * This operation creates or updates a variable value with the given subscription and name for a given + * variable. Variable values are scoped to the variable for which they are created for. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param parameters Parameters for the variable value. + * @param options The options parameters. + */ + createOrUpdate( + variableName: string, + variableValueName: string, + parameters: VariableValue, + options?: VariableValuesCreateOrUpdateOptionalParams + ): Promise; + /** + * This operation retrieves a single variable value; given its name, subscription it was created at and + * the variable it's created for. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + get( + variableName: string, + variableValueName: string, + options?: VariableValuesGetOptionalParams + ): Promise; + /** + * This operation deletes a variable value, given its name, the management group it was created in, and + * the variable it belongs to. The scope of a variable value is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + options?: VariableValuesDeleteAtManagementGroupOptionalParams + ): Promise; + /** + * This operation creates or updates a variable value with the given management group and name for a + * given variable. Variable values are scoped to the variable for which they are created for. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param parameters Parameters for the variable value. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + parameters: VariableValue, + options?: VariableValuesCreateOrUpdateAtManagementGroupOptionalParams + ): Promise; + /** + * This operation retrieves a single variable value; given its name, management group it was created + * at and the variable it's created for. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param variableValueName The name of the variable value to operate on. + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupId: string, + variableName: string, + variableValueName: string, + options?: VariableValuesGetAtManagementGroupOptionalParams + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/operationsInterfaces/variables.ts b/sdk/policy/arm-policy/src/operationsInterfaces/variables.ts new file mode 100644 index 000000000000..0eb917ec92d7 --- /dev/null +++ b/sdk/policy/arm-policy/src/operationsInterfaces/variables.ts @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Variable, + VariablesListOptionalParams, + VariablesListForManagementGroupOptionalParams, + VariablesDeleteOptionalParams, + VariablesCreateOrUpdateOptionalParams, + VariablesCreateOrUpdateResponse, + VariablesGetOptionalParams, + VariablesGetResponse, + VariablesDeleteAtManagementGroupOptionalParams, + VariablesCreateOrUpdateAtManagementGroupOptionalParams, + VariablesCreateOrUpdateAtManagementGroupResponse, + VariablesGetAtManagementGroupOptionalParams, + VariablesGetAtManagementGroupResponse +} from "../models"; + +/// +/** Interface representing a Variables. */ +export interface Variables { + /** + * This operation retrieves the list of all variables associated with the given subscription. + * @param options The options parameters. + */ + list( + options?: VariablesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * This operation retrieves the list of all variables applicable to the management group. + * @param managementGroupId The ID of the management group. + * @param options The options parameters. + */ + listForManagementGroup( + managementGroupId: string, + options?: VariablesListForManagementGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * This operation deletes a variable, given its name and the subscription it was created in. The scope + * of a variable is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + delete( + variableName: string, + options?: VariablesDeleteOptionalParams + ): Promise; + /** + * This operation creates or updates a variable with the given subscription and name. Policy variables + * can only be used by a policy definition at the scope they are created or below. + * @param variableName The name of the variable to operate on. + * @param parameters Parameters for the variable. + * @param options The options parameters. + */ + createOrUpdate( + variableName: string, + parameters: Variable, + options?: VariablesCreateOrUpdateOptionalParams + ): Promise; + /** + * This operation retrieves a single variable, given its name and the subscription it was created at. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + get( + variableName: string, + options?: VariablesGetOptionalParams + ): Promise; + /** + * This operation deletes a variable, given its name and the management group it was created in. The + * scope of a variable is the part of its ID preceding + * '/providers/Microsoft.Authorization/variables/{variableName}'. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + deleteAtManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariablesDeleteAtManagementGroupOptionalParams + ): Promise; + /** + * This operation creates or updates a variable with the given management group and name. Policy + * variables can only be used by a policy definition at the scope they are created or below. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param parameters Parameters for the variable. + * @param options The options parameters. + */ + createOrUpdateAtManagementGroup( + managementGroupId: string, + variableName: string, + parameters: Variable, + options?: VariablesCreateOrUpdateAtManagementGroupOptionalParams + ): Promise; + /** + * This operation retrieves a single variable, given its name and the management group it was created + * at. + * @param managementGroupId The ID of the management group. + * @param variableName The name of the variable to operate on. + * @param options The options parameters. + */ + getAtManagementGroup( + managementGroupId: string, + variableName: string, + options?: VariablesGetAtManagementGroupOptionalParams + ): Promise; +} diff --git a/sdk/policy/arm-policy/src/pagingHelper.ts b/sdk/policy/arm-policy/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/policy/arm-policy/src/pagingHelper.ts +++ b/sdk/policy/arm-policy/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index 55575a71c63a..ef88928b4b5a 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -11,17 +11,21 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { DataPolicyManifestsImpl, - PolicyAssignmentsImpl, PolicyDefinitionsImpl, PolicySetDefinitionsImpl, - PolicyExemptionsImpl + PolicyAssignmentsImpl, + PolicyExemptionsImpl, + VariablesImpl, + VariableValuesImpl } from "./operations"; import { DataPolicyManifests, - PolicyAssignments, PolicyDefinitions, PolicySetDefinitions, - PolicyExemptions + PolicyAssignments, + PolicyExemptions, + Variables, + VariableValues } from "./operationsInterfaces"; import { PolicyClientOptionalParams } from "./models"; @@ -56,7 +60,7 @@ export class PolicyClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-policy/5.0.4`; + const packageDetails = `azsdk-js-arm-policy/6.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -110,15 +114,19 @@ export class PolicyClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; this.dataPolicyManifests = new DataPolicyManifestsImpl(this); - this.policyAssignments = new PolicyAssignmentsImpl(this); this.policyDefinitions = new PolicyDefinitionsImpl(this); this.policySetDefinitions = new PolicySetDefinitionsImpl(this); + this.policyAssignments = new PolicyAssignmentsImpl(this); this.policyExemptions = new PolicyExemptionsImpl(this); + this.variables = new VariablesImpl(this); + this.variableValues = new VariableValuesImpl(this); } dataPolicyManifests: DataPolicyManifests; - policyAssignments: PolicyAssignments; policyDefinitions: PolicyDefinitions; policySetDefinitions: PolicySetDefinitions; + policyAssignments: PolicyAssignments; policyExemptions: PolicyExemptions; + variables: Variables; + variableValues: VariableValues; } diff --git a/sdk/policy/arm-policy/test/sampleTest.ts b/sdk/policy/arm-policy/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/policy/arm-policy/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/policy/arm-policy/tsconfig.json b/sdk/policy/arm-policy/tsconfig.json index bf4c4a024317..cd0af931e3e0 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -15,17 +15,14 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-policy": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts" ], "exclude": [ "node_modules"