From 85e80f54e1dc14b6807d787097d1784dddeb6459 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Sep 2024 21:22:53 +0000 Subject: [PATCH] CodeGen from PR 30741 in Azure/azure-rest-api-specs Merge 5aa3959fc8171e59e721a55a2fb44151dae96249 into 851123422e57b3d9549306b3ac6277ee1a85b876 --- common/config/rush/pnpm-lock.yaml | 9 +- .../arm-policyinsights/CHANGELOG.md | 128 +- sdk/policyinsights/arm-policyinsights/LICENSE | 2 +- .../arm-policyinsights/README.md | 4 +- .../arm-policyinsights/_meta.json | 8 +- .../arm-policyinsights/package.json | 75 +- .../review/arm-policyinsights.api.md | 1352 +------- .../arm-policyinsights/src/lroImpl.ts | 34 - .../arm-policyinsights/src/models/index.ts | 2386 ++------------ .../arm-policyinsights/src/models/mappers.ts | 2827 +---------------- .../src/models/parameters.ts | 541 +--- .../src/operations/attestations.ts | 1043 ------ .../src/operations/componentPolicyStates.ts | 376 --- .../src/operations/index.ts | 8 - .../src/operations/operations.ts | 59 - .../src/operations/policyEvents.ts | 1619 ---------- .../operations/policyMetadataOperations.ts | 182 -- .../src/operations/policyRestrictions.ts | 154 - .../src/operations/policyStates.ts | 2286 ------------- .../src/operations/policyTrackedResources.ts | 714 ----- .../src/operations/remediations.ts | 807 +++-- .../src/operationsInterfaces/attestations.ts | 212 -- .../componentPolicyStates.ts | 113 - .../src/operationsInterfaces/index.ts | 8 - .../src/operationsInterfaces/operations.ts | 21 - .../src/operationsInterfaces/policyEvents.ts | 134 - .../policyMetadataOperations.ts | 36 - .../policyRestrictions.ts | 54 - .../src/operationsInterfaces/policyStates.ts | 320 -- .../policyTrackedResources.ts | 68 - .../src/operationsInterfaces/remediations.ts | 50 +- .../arm-policyinsights/src/pagingHelper.ts | 2 +- .../src/policyInsightsClient.ts | 119 +- .../arm-policyinsights/test/sampleTest.ts | 43 + .../arm-policyinsights/tsconfig.json | 10 +- 35 files changed, 1058 insertions(+), 14746 deletions(-) delete mode 100644 sdk/policyinsights/arm-policyinsights/src/lroImpl.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/attestations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/componentPolicyStates.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/operations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/attestations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/componentPolicyStates.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/operations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyEvents.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyMetadataOperations.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyRestrictions.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyStates.ts delete mode 100644 sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyTrackedResources.ts create mode 100644 sdk/policyinsights/arm-policyinsights/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0c39bffa5ee4..e7f255b07649 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16732,7 +16732,7 @@ packages: dev: false file:projects/arm-mongocluster.tgz: - resolution: {integrity: sha512-5qfO0a31+swfnXGpyq3cmrbZ8Bj0tsLzx4frzixKRWNYsjpj3dbGiuLoIQDzcaw7mADeSVcXqduGOLAPxhtsdw==, tarball: file:projects/arm-mongocluster.tgz} + resolution: {integrity: sha512-EU8WPXxVnF2TP9sFdHD+Fhu0oD4WBj2gtulPY6pw393PtU2cp7IyaeETiBLyH2xxw4WRCyX1pjtNxADgOWpq1g==, tarball: file:projects/arm-mongocluster.tgz} name: '@rush-temp/arm-mongocluster' version: 0.0.0 dependencies: @@ -17529,7 +17529,7 @@ packages: dev: false file:projects/arm-policyinsights.tgz: - resolution: {integrity: sha512-oOT8OK3YGCj4z7xDVUbC0XgAc73YBSMMtmGIZjtR/kGA3FA8H8F4RN/1QiHT55aqm0hAL6wHJwFVricLaQg+4A==, tarball: file:projects/arm-policyinsights.tgz} + resolution: {integrity: sha512-FdCD31jDVAqSVMZbwMFDqn9MlzgcusyAeAEGUf5SkAYpQy+tjPI8qYNoab3jqudZT2r6ZhbJybLqQCNAgL2PGg==, tarball: file:projects/arm-policyinsights.tgz} name: '@rush-temp/arm-policyinsights' version: 0.0.0 dependencies: @@ -17548,9 +17548,10 @@ packages: mkdirp: 3.0.1 mocha: 10.7.3 rimraf: 5.0.10 - ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.6.2) + ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) tslib: 2.7.0 - typescript: 5.6.2 + tsx: 4.19.1 + typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: - '@swc/core' diff --git a/sdk/policyinsights/arm-policyinsights/CHANGELOG.md b/sdk/policyinsights/arm-policyinsights/CHANGELOG.md index d29045620a9f..13f532c836ff 100644 --- a/sdk/policyinsights/arm-policyinsights/CHANGELOG.md +++ b/sdk/policyinsights/arm-policyinsights/CHANGELOG.md @@ -1,15 +1,50 @@ # Release History - -## 6.0.0-beta.4 (Unreleased) - + +## 6.0.0 (2024-09-26) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Interface PolicyInsightsClientOptionalParams has a new optional parameter apiVersion + - Interface RemediationFilters has a new optional parameter resourceIds + - Added function getContinuationToken -### Other Changes +### Breaking Changes + - Removed operation group Attestations + - Removed operation group Operations + - Removed operation group PolicyEvents + - Removed operation group PolicyMetadataOperations + - Removed operation group PolicyRestrictions + - Removed operation group PolicyStates + - Removed operation group PolicyTrackedResources + - Class PolicyInsightsClient has a new signature + - Interface QueryOptions no longer has parameter apply + - Interface QueryOptions no longer has parameter expand + - Interface QueryOptions no longer has parameter from + - Interface QueryOptions no longer has parameter orderBy + - Interface QueryOptions no longer has parameter select + - Interface QueryOptions no longer has parameter skipToken + - Interface QueryOptions no longer has parameter to + - Interface RemediationsListDeploymentsAtManagementGroupNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListDeploymentsAtResourceGroupNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListDeploymentsAtResourceNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListDeploymentsAtSubscriptionNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListForManagementGroupNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListForResourceGroupNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListForResourceNextOptionalParams no longer has parameter queryOptions + - Interface RemediationsListForSubscriptionNextOptionalParams no longer has parameter queryOptions + - Class PolicyInsightsClient no longer has parameter attestations + - Class PolicyInsightsClient no longer has parameter operations + - Class PolicyInsightsClient no longer has parameter policyEvents + - Class PolicyInsightsClient no longer has parameter policyMetadataOperations + - Class PolicyInsightsClient no longer has parameter policyRestrictions + - Class PolicyInsightsClient no longer has parameter policyStates + - Class PolicyInsightsClient no longer has parameter policyTrackedResources + - Removed Enum KnownComplianceState + - Removed Enum KnownFieldRestrictionResult + - Removed Enum KnownPolicyStatesResource + + ## 6.0.0-beta.3 (2023-01-30) ### Features Added @@ -103,84 +138,7 @@ - Operation PolicyTrackedResources.listQueryResultsForResourceGroup has a new signature - Operation PolicyTrackedResources.listQueryResultsForSubscription has a new signature -## 6.0.0-beta.2 (2022-10-19) -### Features Added - - - Added operation PolicyRestrictions.checkAtManagementGroupScope - - Added Interface Attestation - - Added Interface CheckManagementGroupRestrictionsRequest - - Added Interface PolicyMetadataProperties - - Added Interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - - Added Type Alias PolicyEventsResourceType - - Added Type Alias PolicyRestrictionsCheckAtManagementGroupScopeResponse - - Added Type Alias PolicyStatesSummaryResourceType - - Added Type Alias PolicyTrackedResourcesResourceType - - Added Enum KnownPolicyEventsResourceType - - Added Enum KnownPolicyStatesSummaryResourceType - - Added Enum KnownPolicyTrackedResourcesResourceType - -### Breaking Changes - - - Operation PolicyEvents.listQueryResultsForManagementGroup has a new signature - - Operation PolicyEvents.listQueryResultsForPolicyDefinition has a new signature - - Operation PolicyEvents.listQueryResultsForPolicySetDefinition has a new signature - - Operation PolicyEvents.listQueryResultsForResource has a new signature - - Operation PolicyEvents.listQueryResultsForResourceGroup has a new signature - - Operation PolicyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment has a new signature - - Operation PolicyEvents.listQueryResultsForSubscription has a new signature - - Operation PolicyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment has a new signature - - Operation PolicyStates.summarizeForManagementGroup has a new signature - - Operation PolicyStates.summarizeForPolicyDefinition has a new signature - - Operation PolicyStates.summarizeForPolicySetDefinition has a new signature - - Operation PolicyStates.summarizeForResource has a new signature - - Operation PolicyStates.summarizeForResourceGroup has a new signature - - Operation PolicyStates.summarizeForResourceGroupLevelPolicyAssignment has a new signature - - Operation PolicyStates.summarizeForSubscription has a new signature - - Operation PolicyStates.summarizeForSubscriptionLevelPolicyAssignment has a new signature - - Operation PolicyTrackedResources.listQueryResultsForManagementGroup has a new signature - - Operation PolicyTrackedResources.listQueryResultsForResource has a new signature - - Operation PolicyTrackedResources.listQueryResultsForResourceGroup has a new signature - - Operation PolicyTrackedResources.listQueryResultsForSubscription has a new signature - -## 6.0.0-beta.1 (2022-03-31) - -### Features Added - - - Added operation PolicyRestrictions.checkAtManagementGroupScope - - Added Interface CheckManagementGroupRestrictionsRequest - - Added Interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - - Added Type Alias PolicyEventsResourceType - - Added Type Alias PolicyRestrictionsCheckAtManagementGroupScopeResponse - - Added Type Alias PolicyStatesSummaryResourceType - - Added Type Alias PolicyTrackedResourcesResourceType - - Added Enum KnownPolicyEventsResourceType - - Added Enum KnownPolicyStatesSummaryResourceType - - Added Enum KnownPolicyTrackedResourcesResourceType - -### Breaking Changes - - - Operation PolicyEvents.listQueryResultsForManagementGroup has a new signature - - Operation PolicyEvents.listQueryResultsForPolicyDefinition has a new signature - - Operation PolicyEvents.listQueryResultsForPolicySetDefinition has a new signature - - Operation PolicyEvents.listQueryResultsForResource has a new signature - - Operation PolicyEvents.listQueryResultsForResourceGroup has a new signature - - Operation PolicyEvents.listQueryResultsForResourceGroupLevelPolicyAssignment has a new signature - - Operation PolicyEvents.listQueryResultsForSubscription has a new signature - - Operation PolicyEvents.listQueryResultsForSubscriptionLevelPolicyAssignment has a new signature - - Operation PolicyStates.summarizeForManagementGroup has a new signature - - Operation PolicyStates.summarizeForPolicyDefinition has a new signature - - Operation PolicyStates.summarizeForPolicySetDefinition has a new signature - - Operation PolicyStates.summarizeForResource has a new signature - - Operation PolicyStates.summarizeForResourceGroup has a new signature - - Operation PolicyStates.summarizeForResourceGroupLevelPolicyAssignment has a new signature - - Operation PolicyStates.summarizeForSubscription has a new signature - - Operation PolicyStates.summarizeForSubscriptionLevelPolicyAssignment has a new signature - - Operation PolicyTrackedResources.listQueryResultsForManagementGroup has a new signature - - Operation PolicyTrackedResources.listQueryResultsForResource has a new signature - - Operation PolicyTrackedResources.listQueryResultsForResourceGroup has a new signature - - Operation PolicyTrackedResources.listQueryResultsForSubscription has a new signature - ## 5.0.0 (2022-01-24) The package of @azure/arm-policyinsights is using our next generation design principles since version 5.0.0, which contains breaking changes. @@ -189,4 +147,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/policyinsights/arm-policyinsights/LICENSE b/sdk/policyinsights/arm-policyinsights/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/policyinsights/arm-policyinsights/LICENSE +++ b/sdk/policyinsights/arm-policyinsights/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 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/policyinsights/arm-policyinsights/README.md b/sdk/policyinsights/arm-policyinsights/README.md index a2ecd29b405e..e5bf5c40999f 100644 --- a/sdk/policyinsights/arm-policyinsights/README.md +++ b/sdk/policyinsights/arm-policyinsights/README.md @@ -2,11 +2,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PolicyInsights client. -Query component policy states at varying resource scopes for Resource Provider mode policies. + [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-policyinsights) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/policyinsights/arm-policyinsights/_meta.json b/sdk/policyinsights/arm-policyinsights/_meta.json index f5fffa925508..fac6c25cd870 100644 --- a/sdk/policyinsights/arm-policyinsights/_meta.json +++ b/sdk/policyinsights/arm-policyinsights/_meta.json @@ -1,8 +1,8 @@ { - "commit": "78ec1b99699a4bf44869bd13f1b0ed7d92a99c27", + "commit": "c7c9bf74d1a3e72160c80c7c094c8ac608a19cc0", "readme": "specification/policyinsights/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\policyinsights\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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/policyinsights/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.14", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/policyinsights/arm-policyinsights/package.json b/sdk/policyinsights/arm-policyinsights/package.json index 598b9893d05d..1da9d970db73 100644 --- a/sdk/policyinsights/arm-policyinsights/package.json +++ b/sdk/policyinsights/arm-policyinsights/package.json @@ -3,17 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PolicyInsightsClient.", - "version": "6.0.0-beta.4", + "version": "6.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.6.1", - "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,23 +26,24 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-policyinsights.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", "@microsoft/api-extractor": "^7.31.1", - "@types/chai": "^4.2.8", + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "uglify-js": "^3.4.9", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "dotenv": "^16.0.0", - "mkdirp": "^3.0.1", - "mocha": "^10.0.0", - "rimraf": "^5.0.5", - "ts-node": "^10.0.0", - "typescript": "~5.6.2", - "uglify-js": "^3.4.9" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -71,31 +70,29 @@ "types/*" ], "scripts": { - "audit": "echo skipped", "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", - "update-snippets": "echo skipped" + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -107,13 +104,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-policyinsights?view=azure-node-preview" - } + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policyinsights/arm-policyinsights" } \ No newline at end of file diff --git a/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md b/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md index 93c77f70091d..f4b4a7481971 100644 --- a/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md +++ b/sdk/policyinsights/arm-policyinsights/review/arm-policyinsights.api.md @@ -7,1296 +7,65 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; - -// @public -export interface Attestation extends Resource { - assessmentDate?: Date; - comments?: string; - complianceState?: ComplianceState; - evidence?: AttestationEvidence[]; - expiresOn?: Date; - readonly lastComplianceStateChangeAt?: Date; - metadata?: Record; - owner?: string; - policyAssignmentId: string; - policyDefinitionReferenceId?: string; - readonly provisioningState?: string; - readonly systemData?: SystemData; -} - -// @public -export interface AttestationEvidence { - description?: string; - sourceUri?: string; -} - -// @public -export interface AttestationListResult { - readonly nextLink?: string; - readonly value?: Attestation[]; -} - -// @public -export interface Attestations { - beginCreateOrUpdateAtResource(resourceId: string, attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtResourceOptionalParams): Promise, AttestationsCreateOrUpdateAtResourceResponse>>; - beginCreateOrUpdateAtResourceAndWait(resourceId: string, attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtResourceOptionalParams): Promise; - beginCreateOrUpdateAtResourceGroup(resourceGroupName: string, attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams): Promise, AttestationsCreateOrUpdateAtResourceGroupResponse>>; - beginCreateOrUpdateAtResourceGroupAndWait(resourceGroupName: string, attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams): Promise; - beginCreateOrUpdateAtSubscription(attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams): Promise, AttestationsCreateOrUpdateAtSubscriptionResponse>>; - beginCreateOrUpdateAtSubscriptionAndWait(attestationName: string, parameters: Attestation, options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams): Promise; - deleteAtResource(resourceId: string, attestationName: string, options?: AttestationsDeleteAtResourceOptionalParams): Promise; - deleteAtResourceGroup(resourceGroupName: string, attestationName: string, options?: AttestationsDeleteAtResourceGroupOptionalParams): Promise; - deleteAtSubscription(attestationName: string, options?: AttestationsDeleteAtSubscriptionOptionalParams): Promise; - getAtResource(resourceId: string, attestationName: string, options?: AttestationsGetAtResourceOptionalParams): Promise; - getAtResourceGroup(resourceGroupName: string, attestationName: string, options?: AttestationsGetAtResourceGroupOptionalParams): Promise; - getAtSubscription(attestationName: string, options?: AttestationsGetAtSubscriptionOptionalParams): Promise; - listForResource(resourceId: string, options?: AttestationsListForResourceOptionalParams): PagedAsyncIterableIterator; - listForResourceGroup(resourceGroupName: string, options?: AttestationsListForResourceGroupOptionalParams): PagedAsyncIterableIterator; - listForSubscription(options?: AttestationsListForSubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface AttestationsCreateOrUpdateAtResourceGroupOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type AttestationsCreateOrUpdateAtResourceGroupResponse = Attestation; - -// @public -export interface AttestationsCreateOrUpdateAtResourceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type AttestationsCreateOrUpdateAtResourceResponse = Attestation; - -// @public -export interface AttestationsCreateOrUpdateAtSubscriptionOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type AttestationsCreateOrUpdateAtSubscriptionResponse = Attestation; - -// @public -export interface AttestationsDeleteAtResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AttestationsDeleteAtResourceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AttestationsDeleteAtSubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AttestationsGetAtResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsGetAtResourceGroupResponse = Attestation; - -// @public -export interface AttestationsGetAtResourceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsGetAtResourceResponse = Attestation; - -// @public -export interface AttestationsGetAtSubscriptionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsGetAtSubscriptionResponse = Attestation; - -// @public -export interface AttestationsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsListForResourceGroupNextResponse = AttestationListResult; - -// @public -export interface AttestationsListForResourceGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type AttestationsListForResourceGroupResponse = AttestationListResult; - -// @public -export interface AttestationsListForResourceNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsListForResourceNextResponse = AttestationListResult; - -// @public -export interface AttestationsListForResourceOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type AttestationsListForResourceResponse = AttestationListResult; - -// @public -export interface AttestationsListForSubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AttestationsListForSubscriptionNextResponse = AttestationListResult; - -// @public -export interface AttestationsListForSubscriptionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type AttestationsListForSubscriptionResponse = AttestationListResult; - -// @public -export interface CheckManagementGroupRestrictionsRequest { - pendingFields?: PendingField[]; - resourceDetails?: CheckRestrictionsResourceDetails; -} - -// @public -export interface CheckRestrictionsRequest { - pendingFields?: PendingField[]; - resourceDetails: CheckRestrictionsResourceDetails; -} - -// @public -export interface CheckRestrictionsResourceDetails { - apiVersion?: string; - resourceContent: Record; - scope?: string; -} - -// @public -export interface CheckRestrictionsResult { - readonly contentEvaluationResult?: CheckRestrictionsResultContentEvaluationResult; - readonly fieldRestrictions?: FieldRestrictions[]; -} - -// @public -export interface CheckRestrictionsResultContentEvaluationResult { - policyEvaluations?: PolicyEvaluationResult[]; -} - -// @public -export interface ComplianceDetail { - complianceState?: string; - count?: number; -} - -// @public -export type ComplianceState = string; - -// @public -export interface ComponentEventDetails { - [property: string]: any; - id?: string; - name?: string; - policyDefinitionAction?: string; - principalOid?: string; - tenantId?: string; - timestamp?: Date; - type?: string; -} - -// @public -export interface ComponentExpressionEvaluationDetails { - readonly expression?: string; - readonly expressionKind?: string; - readonly expressionValue?: Record; - readonly operator?: string; - readonly path?: string; - result?: string; - readonly targetValue?: Record; -} - -// @public -export interface ComponentPolicyEvaluationDetails { - readonly evaluatedExpressions?: ComponentExpressionEvaluationDetails[]; - reason?: string; -} - -// @public -export interface ComponentPolicyState { - [property: string]: any; - readonly complianceState?: string; - readonly componentId?: string; - readonly componentName?: string; - readonly componentType?: string; - readonly odataContext?: string; - readonly odataId?: string; - readonly policyAssignmentId?: string; - readonly policyAssignmentName?: string; - readonly policyAssignmentOwner?: string; - readonly policyAssignmentParameters?: string; - readonly policyAssignmentScope?: string; - readonly policyAssignmentVersion?: string; - readonly policyDefinitionAction?: string; - readonly policyDefinitionCategory?: string; - readonly policyDefinitionGroupNames?: string[]; - readonly policyDefinitionId?: string; - readonly policyDefinitionName?: string; - readonly policyDefinitionReferenceId?: string; - readonly policyDefinitionVersion?: string; - policyEvaluationDetails?: ComponentPolicyEvaluationDetails; - readonly policySetDefinitionCategory?: string; - readonly policySetDefinitionId?: string; - readonly policySetDefinitionName?: string; - readonly policySetDefinitionOwner?: string; - readonly policySetDefinitionParameters?: string; - readonly policySetDefinitionVersion?: string; - readonly resourceGroup?: string; - readonly resourceId?: string; - readonly resourceLocation?: string; - readonly resourceType?: string; - readonly subscriptionId?: string; - readonly timestamp?: Date; -} - -// @public -export interface ComponentPolicyStates { - listQueryResultsForPolicyDefinition(subscriptionId: string, policyDefinitionName: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams): Promise; - listQueryResultsForResource(resourceId: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForResourceOptionalParams): Promise; - listQueryResultsForResourceGroup(subscriptionId: string, resourceGroupName: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams): Promise; - listQueryResultsForResourceGroupLevelPolicyAssignment(subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams): Promise; - listQueryResultsForSubscription(subscriptionId: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams): Promise; - listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId: string, policyAssignmentName: string, componentPolicyStatesResource: ComponentPolicyStatesResource, options?: ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams): Promise; -} - -// @public -export interface ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams extends coreClient.OperationOptions { - apply?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForPolicyDefinitionResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - apply?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams extends coreClient.OperationOptions { - apply?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForResourceGroupResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesListQueryResultsForResourceOptionalParams extends coreClient.OperationOptions { - apply?: string; - expand?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForResourceResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - apply?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams extends coreClient.OperationOptions { - apply?: string; - filter?: string; - from?: Date; - orderBy?: string; - select?: string; - to?: Date; - top?: number; -} - -// @public -export type ComponentPolicyStatesListQueryResultsForSubscriptionResponse = ComponentPolicyStatesQueryResults; - -// @public -export interface ComponentPolicyStatesQueryResults { - odataContext?: string; - odataCount?: number; - value?: ComponentPolicyState[]; -} - -// @public -export type ComponentPolicyStatesResource = string; - -// @public -export interface ComponentStateDetails { - [property: string]: any; - complianceState?: string; - id?: string; - name?: string; - timestamp?: Date; - type?: string; -} - -// @public -export type CreatedByType = string; - -// @public -export interface ErrorDefinition { - readonly additionalInfo?: TypedErrorInfo[]; - readonly code?: string; - readonly details?: ErrorDefinition[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorDefinitionAutoGenerated { - readonly additionalInfo?: TypedErrorInfo[]; - readonly code?: string; - readonly details?: ErrorDefinitionAutoGenerated[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorDefinitionAutoGenerated2 { - readonly additionalInfo?: TypedErrorInfo[]; - readonly code?: string; - readonly details?: ErrorDefinitionAutoGenerated2[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponse { - error?: ErrorDefinition; -} - -// @public -export interface ErrorResponseAutoGenerated { - error?: ErrorDefinitionAutoGenerated; -} - -// @public -export interface ErrorResponseAutoGenerated2 { - error?: ErrorDefinitionAutoGenerated2; -} - -// @public -export interface ExpressionEvaluationDetails { - expression?: string; - readonly expressionKind?: string; - expressionValue?: Record; - operator?: string; - path?: string; - result?: string; - targetValue?: Record; -} - -// @public -export interface FieldRestriction { - readonly defaultValue?: string; - readonly policy?: PolicyReference; - readonly result?: FieldRestrictionResult; - readonly values?: string[]; -} - -// @public -export type FieldRestrictionResult = string; - -// @public -export interface FieldRestrictions { - readonly field?: string; - restrictions?: FieldRestriction[]; -} - -// @public -export function getContinuationToken(page: unknown): string | undefined; - -// @public -export interface IfNotExistsEvaluationDetails { - resourceId?: string; - totalResources?: number; -} - -// @public -export enum KnownComplianceState { - Compliant = "Compliant", - NonCompliant = "NonCompliant", - Unknown = "Unknown" -} - -// @public -export enum KnownComponentPolicyStatesResource { - Latest = "latest" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownFieldRestrictionResult { - Deny = "Deny", - Removed = "Removed", - Required = "Required" -} - -// @public -export enum KnownPolicyEventsResourceType { - Default = "default" -} - -// @public -export enum KnownPolicyStatesResource { - Default = "default", - Latest = "latest" -} - -// @public -export enum KnownPolicyStatesSummaryResourceType { - Latest = "latest" -} - -// @public -export enum KnownPolicyTrackedResourcesResourceType { - Default = "default" -} - -// @public -export enum KnownResourceDiscoveryMode { - ExistingNonCompliant = "ExistingNonCompliant", - ReEvaluateCompliance = "ReEvaluateCompliance" -} - -// @public -export interface Operation { - display?: OperationDisplay; - isDataAction?: boolean; - name?: string; -} - -// @public -export interface OperationDisplay { - description?: string; - operation?: string; - provider?: string; - resource?: string; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): Promise; -} - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListResponse = OperationsListResults; - -// @public -export interface OperationsListResults { - odataCount?: number; - value?: Operation[]; -} - -// @public -export interface PendingField { - field: string; - values?: string[]; -} - -// @public -export interface PolicyAssignmentSummary { - policyAssignmentId?: string; - policyDefinitions?: PolicyDefinitionSummary[]; - policyGroups?: PolicyGroupSummary[]; - policySetDefinitionId?: string; - results?: SummaryResults; -} - -// @public -export interface PolicyDefinitionSummary { - effect?: string; - policyDefinitionGroupNames?: string[]; - policyDefinitionId?: string; - policyDefinitionReferenceId?: string; - results?: SummaryResults; -} - -// @public -export interface PolicyDetails { - readonly policyAssignmentDisplayName?: string; - readonly policyAssignmentId?: string; - readonly policyAssignmentScope?: string; - readonly policyDefinitionId?: string; - readonly policyDefinitionReferenceId?: string; - readonly policySetDefinitionId?: string; -} - -// @public -export interface PolicyEvaluationDetails { - evaluatedExpressions?: ExpressionEvaluationDetails[]; - ifNotExistsDetails?: IfNotExistsEvaluationDetails; -} - -// @public -export interface PolicyEvaluationResult { - readonly evaluationDetails?: PolicyEvaluationDetails; - readonly evaluationResult?: string; - readonly policyInfo?: PolicyReference; -} - -// @public -export interface PolicyEvent { - [property: string]: any; - complianceState?: string; - components?: ComponentEventDetails[]; - effectiveParameters?: string; - isCompliant?: boolean; - managementGroupIds?: string; - odataContext?: string; - odataId?: string; - policyAssignmentId?: string; - policyAssignmentName?: string; - policyAssignmentOwner?: string; - policyAssignmentParameters?: string; - policyAssignmentScope?: string; - policyDefinitionAction?: string; - policyDefinitionCategory?: string; - policyDefinitionId?: string; - policyDefinitionName?: string; - policyDefinitionReferenceId?: string; - policySetDefinitionCategory?: string; - policySetDefinitionId?: string; - policySetDefinitionName?: string; - policySetDefinitionOwner?: string; - policySetDefinitionParameters?: string; - principalOid?: string; - resourceGroup?: string; - resourceId?: string; - resourceLocation?: string; - resourceTags?: string; - resourceType?: string; - subscriptionId?: string; - tenantId?: string; - timestamp?: Date; -} - -// @public -export interface PolicyEvents { - listQueryResultsForManagementGroup(policyEventsResource: PolicyEventsResourceType, managementGroupName: string, options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForPolicyDefinition(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, policyDefinitionName: string, options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForPolicySetDefinition(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, policySetDefinitionName: string, options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResource(policyEventsResource: PolicyEventsResourceType, resourceId: string, options?: PolicyEventsListQueryResultsForResourceOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResourceGroup(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, resourceGroupName: string, options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResourceGroupLevelPolicyAssignment(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForSubscription(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForSubscriptionLevelPolicyAssignment(policyEventsResource: PolicyEventsResourceType, subscriptionId: string, policyAssignmentName: string, options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PolicyEventsListQueryResultsForManagementGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForManagementGroupNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForManagementGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForManagementGroupResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForPolicyDefinitionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForPolicyDefinitionNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForPolicyDefinitionResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForPolicySetDefinitionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForPolicySetDefinitionResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForResourceGroupNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForResourceGroupResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForResourceNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForResourceOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForResourceResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForSubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyEventsListQueryResultsForSubscriptionNextResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsListQueryResultsForSubscriptionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyEventsListQueryResultsForSubscriptionResponse = PolicyEventsQueryResults; - -// @public -export interface PolicyEventsQueryResults { - odataContext?: string; - odataCount?: number; - odataNextLink?: string; - value?: PolicyEvent[]; -} - -// @public -export type PolicyEventsResourceType = string; - -// @public -export interface PolicyGroupSummary { - policyGroupName?: string; - results?: SummaryResults; -} - -// @public (undocumented) -export class PolicyInsightsClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyInsightsClientOptionalParams); - // (undocumented) - attestations: Attestations; - // (undocumented) - componentPolicyStates: ComponentPolicyStates; - // (undocumented) - operations: Operations; - // (undocumented) - policyEvents: PolicyEvents; - // (undocumented) - policyMetadataOperations: PolicyMetadataOperations; - // (undocumented) - policyRestrictions: PolicyRestrictions; - // (undocumented) - policyStates: PolicyStates; - // (undocumented) - policyTrackedResources: PolicyTrackedResources; - // (undocumented) - remediations: Remediations; - // (undocumented) - subscriptionId: string; -} - -// @public -export interface PolicyInsightsClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - endpoint?: string; -} - -// @public -export interface PolicyMetadata { - readonly additionalContentUrl?: string; - readonly category?: string; - readonly description?: string; - readonly id?: string; - readonly metadata?: Record; - readonly metadataId?: string; - readonly name?: string; - readonly owner?: string; - readonly requirements?: string; - readonly title?: string; - readonly type?: string; -} - -// @public -export interface PolicyMetadataCollection { - readonly nextLink?: string; - readonly value?: SlimPolicyMetadata[]; -} - -// @public -export interface PolicyMetadataGetResourceOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyMetadataGetResourceResponse = PolicyMetadata; - -// @public -export interface PolicyMetadataListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyMetadataListNextResponse = PolicyMetadataCollection; - -// @public -export interface PolicyMetadataListOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyMetadataListResponse = PolicyMetadataCollection; - -// @public -export interface PolicyMetadataOperations { - getResource(resourceName: string, options?: PolicyMetadataGetResourceOptionalParams): Promise; - list(options?: PolicyMetadataListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties { - readonly description?: string; - readonly requirements?: string; -} - -// @public -export interface PolicyMetadataSlimProperties { - readonly additionalContentUrl?: string; - readonly category?: string; - readonly metadata?: Record; - readonly metadataId?: string; - readonly owner?: string; - readonly title?: string; -} - -// @public -export interface PolicyReference { - readonly policyAssignmentId?: string; - readonly policyDefinitionId?: string; - readonly policyDefinitionReferenceId?: string; - readonly policySetDefinitionId?: string; -} - -// @public -export interface PolicyRestrictions { - checkAtManagementGroupScope(managementGroupId: string, parameters: CheckManagementGroupRestrictionsRequest, options?: PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams): Promise; - checkAtResourceGroupScope(resourceGroupName: string, parameters: CheckRestrictionsRequest, options?: PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams): Promise; - checkAtSubscriptionScope(parameters: CheckRestrictionsRequest, options?: PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams): Promise; -} - -// @public -export interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyRestrictionsCheckAtManagementGroupScopeResponse = CheckRestrictionsResult; - -// @public -export interface PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyRestrictionsCheckAtResourceGroupScopeResponse = CheckRestrictionsResult; - -// @public -export interface PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyRestrictionsCheckAtSubscriptionScopeResponse = CheckRestrictionsResult; - -// @public -export interface PolicyState { - [property: string]: any; - complianceState?: string; - components?: ComponentStateDetails[]; - effectiveParameters?: string; - isCompliant?: boolean; - managementGroupIds?: string; - odataContext?: string; - odataId?: string; - policyAssignmentId?: string; - policyAssignmentName?: string; - policyAssignmentOwner?: string; - policyAssignmentParameters?: string; - policyAssignmentScope?: string; - readonly policyAssignmentVersion?: string; - policyDefinitionAction?: string; - policyDefinitionCategory?: string; - policyDefinitionGroupNames?: string[]; - policyDefinitionId?: string; - policyDefinitionName?: string; - policyDefinitionReferenceId?: string; - readonly policyDefinitionVersion?: string; - policyEvaluationDetails?: PolicyEvaluationDetails; - policySetDefinitionCategory?: string; - policySetDefinitionId?: string; - policySetDefinitionName?: string; - policySetDefinitionOwner?: string; - policySetDefinitionParameters?: string; - readonly policySetDefinitionVersion?: string; - resourceGroup?: string; - resourceId?: string; - resourceLocation?: string; - resourceTags?: string; - resourceType?: string; - subscriptionId?: string; - timestamp?: Date; -} - -// @public -export interface PolicyStates { - beginTriggerResourceGroupEvaluation(subscriptionId: string, resourceGroupName: string, options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams): Promise, void>>; - beginTriggerResourceGroupEvaluationAndWait(subscriptionId: string, resourceGroupName: string, options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams): Promise; - beginTriggerSubscriptionEvaluation(subscriptionId: string, options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams): Promise, void>>; - beginTriggerSubscriptionEvaluationAndWait(subscriptionId: string, options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams): Promise; - listQueryResultsForManagementGroup(policyStatesResource: PolicyStatesResource, managementGroupName: string, options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForPolicyDefinition(policyStatesResource: PolicyStatesResource, subscriptionId: string, policyDefinitionName: string, options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForPolicySetDefinition(policyStatesResource: PolicyStatesResource, subscriptionId: string, policySetDefinitionName: string, options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResource(policyStatesResource: PolicyStatesResource, resourceId: string, options?: PolicyStatesListQueryResultsForResourceOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResourceGroup(policyStatesResource: PolicyStatesResource, subscriptionId: string, resourceGroupName: string, options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResourceGroupLevelPolicyAssignment(policyStatesResource: PolicyStatesResource, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForSubscription(policyStatesResource: PolicyStatesResource, subscriptionId: string, options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForSubscriptionLevelPolicyAssignment(policyStatesResource: PolicyStatesResource, subscriptionId: string, policyAssignmentName: string, options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams): PagedAsyncIterableIterator; - summarizeForManagementGroup(policyStatesSummaryResource: PolicyStatesSummaryResourceType, managementGroupName: string, options?: PolicyStatesSummarizeForManagementGroupOptionalParams): Promise; - summarizeForPolicyDefinition(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, policyDefinitionName: string, options?: PolicyStatesSummarizeForPolicyDefinitionOptionalParams): Promise; - summarizeForPolicySetDefinition(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, policySetDefinitionName: string, options?: PolicyStatesSummarizeForPolicySetDefinitionOptionalParams): Promise; - summarizeForResource(policyStatesSummaryResource: PolicyStatesSummaryResourceType, resourceId: string, options?: PolicyStatesSummarizeForResourceOptionalParams): Promise; - summarizeForResourceGroup(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, resourceGroupName: string, options?: PolicyStatesSummarizeForResourceGroupOptionalParams): Promise; - summarizeForResourceGroupLevelPolicyAssignment(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, resourceGroupName: string, policyAssignmentName: string, options?: PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams): Promise; - summarizeForSubscription(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, options?: PolicyStatesSummarizeForSubscriptionOptionalParams): Promise; - summarizeForSubscriptionLevelPolicyAssignment(policyStatesSummaryResource: PolicyStatesSummaryResourceType, subscriptionId: string, policyAssignmentName: string, options?: PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams): Promise; -} - -// @public -export interface PolicyStatesListQueryResultsForManagementGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForManagementGroupNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForManagementGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForManagementGroupResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForPolicyDefinitionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForPolicyDefinitionNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForPolicyDefinitionResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForPolicySetDefinitionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForPolicySetDefinitionNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForPolicySetDefinitionResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForResourceGroupNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForResourceGroupResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForResourceNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForResourceOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForResourceResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForSubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyStatesListQueryResultsForSubscriptionNextResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesListQueryResultsForSubscriptionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesListQueryResultsForSubscriptionResponse = PolicyStatesQueryResults; - -// @public -export interface PolicyStatesQueryResults { - odataContext?: string; - odataCount?: number; - odataNextLink?: string; - value?: PolicyState[]; -} - -// @public -export type PolicyStatesResource = string; - -// @public -export interface PolicyStatesSummarizeForManagementGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForManagementGroupResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForPolicyDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForPolicyDefinitionResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForPolicySetDefinitionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForPolicySetDefinitionResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForResourceGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} // @public -export type PolicyStatesSummarizeForResourceGroupResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForResourceOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForResourceResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse = SummarizeResults; - -// @public -export interface PolicyStatesSummarizeForSubscriptionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyStatesSummarizeForSubscriptionResponse = SummarizeResults; - -// @public -export type PolicyStatesSummaryResourceType = string; - -// @public -export interface PolicyStatesTriggerResourceGroupEvaluationOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PolicyStatesTriggerSubscriptionEvaluationOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PolicyTrackedResource { - readonly createdBy?: TrackedResourceModificationDetails; - readonly lastModifiedBy?: TrackedResourceModificationDetails; - readonly lastUpdateUtc?: Date; - readonly policyDetails?: PolicyDetails; - readonly trackedResourceId?: string; -} - -// @public -export interface PolicyTrackedResources { - listQueryResultsForManagementGroup(managementGroupName: string, policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResource(resourceId: string, policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForResourceGroup(resourceGroupName: string, policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams): PagedAsyncIterableIterator; - listQueryResultsForSubscription(policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PolicyTrackedResourcesListQueryResultsForManagementGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyTrackedResourcesListQueryResultsForManagementGroupNextResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyTrackedResourcesListQueryResultsForManagementGroupResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesListQueryResultsForResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyTrackedResourcesListQueryResultsForResourceGroupNextResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; -} - -// @public -export type PolicyTrackedResourcesListQueryResultsForResourceGroupResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesListQueryResultsForResourceNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PolicyTrackedResourcesListQueryResultsForResourceNextResponse = PolicyTrackedResourcesQueryResults; +export type CreatedByType = string; // @public -export interface PolicyTrackedResourcesListQueryResultsForResourceOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; +export interface ErrorDefinition { + readonly additionalInfo?: TypedErrorInfo[]; + readonly code?: string; + readonly details?: ErrorDefinition[]; + readonly message?: string; + readonly target?: string; } // @public -export type PolicyTrackedResourcesListQueryResultsForResourceResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesListQueryResultsForSubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface ErrorResponse { + error?: ErrorDefinition; } // @public -export type PolicyTrackedResourcesListQueryResultsForSubscriptionNextResponse = PolicyTrackedResourcesQueryResults; +export function getContinuationToken(page: unknown): string | undefined; // @public -export interface PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams extends coreClient.OperationOptions { - queryOptions?: QueryOptions; +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" } // @public -export type PolicyTrackedResourcesListQueryResultsForSubscriptionResponse = PolicyTrackedResourcesQueryResults; - -// @public -export interface PolicyTrackedResourcesQueryResults { - readonly nextLink?: string; - readonly value?: PolicyTrackedResource[]; +export enum KnownResourceDiscoveryMode { + ExistingNonCompliant = "ExistingNonCompliant", + ReEvaluateCompliance = "ReEvaluateCompliance" } -// @public -export type PolicyTrackedResourcesResourceType = string; - -// @public -export interface QueryFailure { - error?: QueryFailureError; +// @public (undocumented) +export class PolicyInsightsClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PolicyInsightsClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: PolicyInsightsClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + remediations: Remediations; + // (undocumented) + subscriptionId?: string; } // @public -export interface QueryFailureError { - readonly code?: string; - readonly message?: string; +export interface PolicyInsightsClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; } // @public export interface QueryOptions { - apply?: string; - expand?: string; filter?: string; - from?: Date; - orderBy?: string; - select?: string; - skipToken?: string; - to?: Date; top?: number; } @@ -1348,6 +117,7 @@ export interface RemediationDeploymentSummary { // @public export interface RemediationFilters { locations?: string[]; + resourceIds?: string[]; } // @public @@ -1621,54 +391,9 @@ export interface RemediationsListForSubscriptionOptionalParams extends coreClien // @public export type RemediationsListForSubscriptionResponse = RemediationListResult; -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly type?: string; -} - // @public export type ResourceDiscoveryMode = string; -// @public -export interface SlimPolicyMetadata { - readonly additionalContentUrl?: string; - readonly category?: string; - readonly id?: string; - readonly metadata?: Record; - readonly metadataId?: string; - readonly name?: string; - readonly owner?: string; - readonly title?: string; - readonly type?: string; -} - -// @public -export interface SummarizeResults { - odataContext?: string; - odataCount?: number; - value?: Summary[]; -} - -// @public -export interface Summary { - odataContext?: string; - odataId?: string; - policyAssignments?: PolicyAssignmentSummary[]; - results?: SummaryResults; -} - -// @public -export interface SummaryResults { - nonCompliantPolicies?: number; - nonCompliantResources?: number; - policyDetails?: ComplianceDetail[]; - policyGroupDetails?: ComplianceDetail[]; - queryResultsUri?: string; - resourceDetails?: ComplianceDetail[]; -} - // @public export interface SystemData { createdAt?: Date; @@ -1679,13 +404,6 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } -// @public -export interface TrackedResourceModificationDetails { - readonly deploymentId?: string; - readonly deploymentTime?: Date; - readonly policyDetails?: PolicyDetails; -} - // @public export interface TypedErrorInfo { readonly info?: any; diff --git a/sdk/policyinsights/arm-policyinsights/src/lroImpl.ts b/sdk/policyinsights/arm-policyinsights/src/lroImpl.ts deleted file mode 100644 index 518d5f053b4e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/lroImpl.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } -} diff --git a/sdk/policyinsights/arm-policyinsights/src/models/index.ts b/sdk/policyinsights/arm-policyinsights/src/models/index.ts index 15795227f608..177e94cfe30b 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/index.ts @@ -8,122 +8,6 @@ import * as coreClient from "@azure/core-client"; -/** Query results. */ -export interface PolicyTrackedResourcesQueryResults { - /** - * Query results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: PolicyTrackedResource[]; - /** - * The URL to get the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Policy tracked resource record. */ -export interface PolicyTrackedResource { - /** - * The ID of the policy tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly trackedResourceId?: string; - /** - * The details of the policy that require the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDetails?: PolicyDetails; - /** - * The details of the policy triggered deployment that created the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdBy?: TrackedResourceModificationDetails; - /** - * The details of the policy triggered deployment that modified the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastModifiedBy?: TrackedResourceModificationDetails; - /** - * Timestamp of the last update to the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastUpdateUtc?: Date; -} - -/** The policy details. */ -export interface PolicyDetails { - /** - * The ID of the policy definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionId?: string; - /** - * The ID of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentId?: string; - /** - * The display name of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentDisplayName?: string; - /** - * The scope of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentScope?: string; - /** - * The ID of the policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionId?: string; - /** - * The policy definition reference ID within the policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionReferenceId?: string; -} - -/** The details of the policy triggered deployment that created or modified the tracked resource. */ -export interface TrackedResourceModificationDetails { - /** - * The details of the policy that created or modified the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDetails?: PolicyDetails; - /** - * The ID of the deployment that created or modified the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deploymentId?: string; - /** - * Timestamp of the deployment that created or modified the tracked resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deploymentTime?: Date; -} - -/** Error response. */ -export interface QueryFailure { - /** Error definition. */ - error?: QueryFailureError; -} - -/** Error definition. */ -export interface QueryFailureError { - /** - * Service specific error code which serves as the substatus for the HTTP error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * Description of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; -} - /** List of deployments for a remediation. */ export interface RemediationDeploymentsListResult { /** @@ -255,7 +139,7 @@ export interface Remediation { /** The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified. */ resourceDiscoveryMode?: ResourceDiscoveryMode; /** - * The status of the remediation. + * The status of the remediation. This refers to the entire remediation task, not individual deployments. Allowed values are Evaluating, Canceled, Cancelling, Failed, Complete, or Succeeded. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; @@ -298,6 +182,8 @@ export interface Remediation { export interface RemediationFilters { /** The resource locations that will be remediated. */ locations?: string[]; + /** The IDs of the resources that will be remediated. Can specify at most 100 IDs. This filter cannot be used when ReEvaluateCompliance is set to ReEvaluateCompliance, and cannot be empty if provided. */ + resourceIds?: string[]; } /** The deployment status summary for all deployments created by the remediation. */ @@ -355,2217 +241,321 @@ export interface RemediationListResult { readonly nextLink?: string; } -/** Query results. */ -export interface PolicyEventsQueryResults { - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** OData entity count; represents the number of policy event records returned. */ - odataCount?: number; - /** Odata next link; URL to get the next set of results. */ - odataNextLink?: string; - /** Query results. */ - value?: PolicyEvent[]; +/** Parameter group */ +export interface QueryOptions { + /** Maximum number of records to return. */ + top?: number; + /** OData filter expression. */ + filter?: string; } -/** Policy event record. */ -export interface PolicyEvent { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** OData entity ID; always set to null since policy event records do not have an entity ID. */ - odataId?: string; - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** Timestamp for the policy event record. */ - timestamp?: Date; - /** Resource ID. */ - resourceId?: string; - /** Policy assignment ID. */ - policyAssignmentId?: string; - /** Policy definition ID. */ - policyDefinitionId?: string; - /** Effective parameters for the policy assignment. */ - effectiveParameters?: string; - /** Flag which states whether the resource is compliant against the policy assignment it was evaluated against. */ - isCompliant?: boolean; - /** Subscription ID. */ - subscriptionId?: string; - /** Resource type. */ - resourceType?: string; - /** Resource location. */ - resourceLocation?: string; - /** Resource group name. */ - resourceGroup?: string; - /** List of resource tags. */ - resourceTags?: string; - /** Policy assignment name. */ - policyAssignmentName?: string; - /** Policy assignment owner. */ - policyAssignmentOwner?: string; - /** Policy assignment parameters. */ - policyAssignmentParameters?: string; - /** Policy assignment scope. */ - policyAssignmentScope?: string; - /** Policy definition name. */ - policyDefinitionName?: string; - /** Policy definition action, i.e. effect. */ - policyDefinitionAction?: string; - /** Policy definition category. */ - policyDefinitionCategory?: string; - /** Policy set definition ID, if the policy assignment is for a policy set. */ - policySetDefinitionId?: string; - /** Policy set definition name, if the policy assignment is for a policy set. */ - policySetDefinitionName?: string; - /** Policy set definition owner, if the policy assignment is for a policy set. */ - policySetDefinitionOwner?: string; - /** Policy set definition category, if the policy assignment is for a policy set. */ - policySetDefinitionCategory?: string; - /** Policy set definition parameters, if the policy assignment is for a policy set. */ - policySetDefinitionParameters?: string; - /** Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under. */ - managementGroupIds?: string; - /** Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. */ - policyDefinitionReferenceId?: string; - /** Compliance state of the resource. */ - complianceState?: string; - /** Tenant ID for the policy event record. */ - tenantId?: string; - /** Principal object ID for the user who initiated the resource operation that triggered the policy event. */ - principalOid?: string; - /** Components events records populated only when URL contains $expand=components clause. */ - components?: ComponentEventDetails[]; +/** Known values of {@link ResourceDiscoveryMode} that the service accepts. */ +export enum KnownResourceDiscoveryMode { + /** Remediate resources that are already known to be non-compliant. */ + ExistingNonCompliant = "ExistingNonCompliant", + /** Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant. The resourceIds filter cannot be used in this mode. */ + ReEvaluateCompliance = "ReEvaluateCompliance", } -/** Component event details. */ -export interface ComponentEventDetails { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** Component Id. */ - id?: string; - /** Component type. */ - type?: string; - /** Component name. */ - name?: string; - /** Timestamp for component policy event record. */ - timestamp?: Date; - /** Tenant ID for the policy event record. */ - tenantId?: string; - /** Principal object ID for the user who initiated the resource component operation that triggered the policy event. */ - principalOid?: string; - /** Policy definition action, i.e. effect. */ - policyDefinitionAction?: string; -} +/** + * Defines values for ResourceDiscoveryMode. \ + * {@link KnownResourceDiscoveryMode} can be used interchangeably with ResourceDiscoveryMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ExistingNonCompliant**: Remediate resources that are already known to be non-compliant. \ + * **ReEvaluateCompliance**: Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant. The resourceIds filter cannot be used in this mode. + */ +export type ResourceDiscoveryMode = string; -/** Query results. */ -export interface PolicyStatesQueryResults { - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** OData entity count; represents the number of policy state records returned. */ - odataCount?: number; - /** Odata next link; URL to get the next set of results. */ - odataNextLink?: string; - /** Query results. */ - value?: PolicyState[]; +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", } -/** Policy state record. */ -export interface PolicyState { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** OData entity ID; always set to null since policy state records do not have an entity ID. */ - odataId?: string; - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** Timestamp for the policy state record. */ - timestamp?: Date; - /** Resource ID. */ - resourceId?: string; - /** Policy assignment ID. */ - policyAssignmentId?: string; - /** Policy definition ID. */ - policyDefinitionId?: string; - /** Effective parameters for the policy assignment. */ - effectiveParameters?: string; - /** Flag which states whether the resource is compliant against the policy assignment it was evaluated against. This property is deprecated; please use ComplianceState instead. */ - isCompliant?: boolean; - /** Subscription ID. */ - subscriptionId?: string; - /** Resource type. */ - resourceType?: string; - /** Resource location. */ - resourceLocation?: string; - /** Resource group name. */ - resourceGroup?: string; - /** List of resource tags. */ - resourceTags?: string; - /** Policy assignment name. */ - policyAssignmentName?: string; - /** Policy assignment owner. */ - policyAssignmentOwner?: string; - /** Policy assignment parameters. */ - policyAssignmentParameters?: string; - /** Policy assignment scope. */ - policyAssignmentScope?: string; - /** Policy definition name. */ - policyDefinitionName?: string; - /** Policy definition action, i.e. effect. */ - policyDefinitionAction?: string; - /** Policy definition category. */ - policyDefinitionCategory?: string; - /** Policy set definition ID, if the policy assignment is for a policy set. */ - policySetDefinitionId?: string; - /** Policy set definition name, if the policy assignment is for a policy set. */ - policySetDefinitionName?: string; - /** Policy set definition owner, if the policy assignment is for a policy set. */ - policySetDefinitionOwner?: string; - /** Policy set definition category, if the policy assignment is for a policy set. */ - policySetDefinitionCategory?: string; - /** Policy set definition parameters, if the policy assignment is for a policy set. */ - policySetDefinitionParameters?: string; - /** Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under. */ - managementGroupIds?: string; - /** Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. */ - policyDefinitionReferenceId?: string; - /** Compliance state of the resource. */ - complianceState?: string; - /** Policy evaluation details. */ - policyEvaluationDetails?: PolicyEvaluationDetails; - /** Policy definition group names. */ - policyDefinitionGroupNames?: string[]; - /** Components state compliance records populated only when URL contains $expand=components clause. */ - components?: ComponentStateDetails[]; - /** - * Evaluated policy definition version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionVersion?: string; - /** - * Evaluated policy set definition version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionVersion?: string; - /** - * Evaluated policy assignment version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentVersion?: string; -} +/** + * 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; -/** Policy evaluation details. */ -export interface PolicyEvaluationDetails { - /** Details of the evaluated expressions. */ - evaluatedExpressions?: ExpressionEvaluationDetails[]; - /** Evaluation details of IfNotExists effect. */ - ifNotExistsDetails?: IfNotExistsEvaluationDetails; +/** Optional parameters. */ +export interface RemediationsListDeploymentsAtManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Parameter group */ + queryOptions?: QueryOptions; } -/** Evaluation details of policy language expressions. */ -export interface ExpressionEvaluationDetails { - /** Evaluation result. */ - result?: string; - /** Expression evaluated. */ - expression?: string; - /** - * The kind of expression that was evaluated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly expressionKind?: string; - /** Property path if the expression is a field or an alias. */ - path?: string; - /** Value of the expression. */ - expressionValue?: Record; - /** Target value to be compared with the expression value. */ - targetValue?: Record; - /** Operator to compare the expression value and the target value. */ - operator?: string; -} +/** Contains response data for the listDeploymentsAtManagementGroup operation. */ +export type RemediationsListDeploymentsAtManagementGroupResponse = + RemediationDeploymentsListResult; -/** Evaluation details of IfNotExists effect. */ -export interface IfNotExistsEvaluationDetails { - /** ID of the last evaluated resource for IfNotExists effect. */ - resourceId?: string; - /** Total number of resources to which the existence condition is applicable. */ - totalResources?: number; -} +/** Optional parameters. */ +export interface RemediationsCancelAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} -/** Component state details. */ -export interface ComponentStateDetails { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** Component Id. */ - id?: string; - /** Component type. */ - type?: string; - /** Component name. */ - name?: string; - /** Component compliance evaluation timestamp. */ - timestamp?: Date; - /** Component compliance state. */ - complianceState?: string; -} +/** Contains response data for the cancelAtManagementGroup operation. */ +export type RemediationsCancelAtManagementGroupResponse = Remediation; -/** Summarize action results. */ -export interface SummarizeResults { - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** OData entity count; represents the number of summaries returned; always set to 1. */ - odataCount?: number; - /** Summarize action results. */ - value?: Summary[]; +/** Optional parameters. */ +export interface RemediationsListForManagementGroupOptionalParams + extends coreClient.OperationOptions { + /** Parameter group */ + queryOptions?: QueryOptions; } -/** Summary results. */ -export interface Summary { - /** OData entity ID; always set to null since summaries do not have an entity ID. */ - odataId?: string; - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** Compliance summary for all policy assignments. */ - results?: SummaryResults; - /** Policy assignments summary. */ - policyAssignments?: PolicyAssignmentSummary[]; -} +/** Contains response data for the listForManagementGroup operation. */ +export type RemediationsListForManagementGroupResponse = RemediationListResult; -/** Compliance summary on a particular summary level. */ -export interface SummaryResults { - /** HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the compliance summary. This property will not be available by default in future API versions, but could be queried explicitly. */ - queryResultsUri?: string; - /** Number of non-compliant resources. */ - nonCompliantResources?: number; - /** Number of non-compliant policies. */ - nonCompliantPolicies?: number; - /** The resources summary at this level. */ - resourceDetails?: ComplianceDetail[]; - /** The policy artifact summary at this level. For query scope level, it represents policy assignment summary. For policy assignment level, it represents policy definitions summary. */ - policyDetails?: ComplianceDetail[]; - /** The policy definition group summary at this level. */ - policyGroupDetails?: ComplianceDetail[]; -} +/** Optional parameters. */ +export interface RemediationsCreateOrUpdateAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} -/** The compliance state rollup. */ -export interface ComplianceDetail { - /** The compliance state. */ - complianceState?: string; - /** Summarized count value for this compliance state. */ - count?: number; -} +/** Contains response data for the createOrUpdateAtManagementGroup operation. */ +export type RemediationsCreateOrUpdateAtManagementGroupResponse = Remediation; -/** Policy assignment summary. */ -export interface PolicyAssignmentSummary { - /** Policy assignment ID. */ - policyAssignmentId?: string; - /** Policy set definition ID, if the policy assignment is for a policy set. */ - policySetDefinitionId?: string; - /** Compliance summary for the policy assignment. */ - results?: SummaryResults; - /** Policy definitions summary. */ - policyDefinitions?: PolicyDefinitionSummary[]; - /** Policy definition group summary. */ - policyGroups?: PolicyGroupSummary[]; -} +/** Optional parameters. */ +export interface RemediationsGetAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} -/** Policy definition summary. */ -export interface PolicyDefinitionSummary { - /** Policy definition ID. */ - policyDefinitionId?: string; - /** Policy definition reference ID. */ - policyDefinitionReferenceId?: string; - /** Policy definition group names. */ - policyDefinitionGroupNames?: string[]; - /** Policy effect, i.e. policy definition action. */ - effect?: string; - /** Compliance summary for the policy definition. */ - results?: SummaryResults; -} +/** Contains response data for the getAtManagementGroup operation. */ +export type RemediationsGetAtManagementGroupResponse = Remediation; -/** Policy definition group summary. */ -export interface PolicyGroupSummary { - /** Policy group name. */ - policyGroupName?: string; - /** Compliance summary for the policy definition group. */ - results?: SummaryResults; -} +/** Optional parameters. */ +export interface RemediationsDeleteAtManagementGroupOptionalParams + extends coreClient.OperationOptions {} -/** Policy metadata resource definition. */ -export interface PolicyMetadata { - /** - * The ID of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The name of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The policy metadata identifier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadataId?: string; - /** - * The category of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly category?: string; - /** - * The title of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly title?: string; - /** - * The owner of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly owner?: string; - /** - * Url for getting additional content about the resource metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalContentUrl?: string; - /** - * Additional metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: Record; - /** - * The description of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * The requirements of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requirements?: string; -} +/** Contains response data for the deleteAtManagementGroup operation. */ +export type RemediationsDeleteAtManagementGroupResponse = Remediation; -/** The properties of the policy metadata, excluding properties containing large strings */ -export interface PolicyMetadataSlimProperties { - /** - * The policy metadata identifier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadataId?: string; - /** - * The category of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly category?: string; - /** - * The title of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly title?: string; - /** - * The owner of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly owner?: string; - /** - * Url for getting additional content about the resource metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalContentUrl?: string; - /** - * Additional metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: Record; +/** Optional parameters. */ +export interface RemediationsListDeploymentsAtSubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Parameter group */ + queryOptions?: QueryOptions; } -/** Error response. */ -export interface ErrorResponseAutoGenerated { - /** The error details. */ - error?: ErrorDefinitionAutoGenerated; +/** Contains response data for the listDeploymentsAtSubscription operation. */ +export type RemediationsListDeploymentsAtSubscriptionResponse = + RemediationDeploymentsListResult; + +/** Optional parameters. */ +export interface RemediationsCancelAtSubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the cancelAtSubscription operation. */ +export type RemediationsCancelAtSubscriptionResponse = Remediation; + +/** Optional parameters. */ +export interface RemediationsListForSubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Parameter group */ + queryOptions?: QueryOptions; } -/** Error definition. */ -export interface ErrorDefinitionAutoGenerated { - /** - * Service specific error code which serves as the substatus for the HTTP error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * Description of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The target of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * Internal error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDefinitionAutoGenerated[]; - /** - * Additional scenario specific error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: TypedErrorInfo[]; -} - -/** Collection of policy metadata resources. */ -export interface PolicyMetadataCollection { - /** - * Array of policy metadata definitions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: SlimPolicyMetadata[]; - /** - * The URL to get the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Slim version of policy metadata resource definition, excluding properties with large strings */ -export interface SlimPolicyMetadata { - /** - * The ID of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The type of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The name of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The policy metadata identifier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadataId?: string; - /** - * The category of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly category?: string; - /** - * The title of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly title?: string; - /** - * The owner of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly owner?: string; - /** - * Url for getting additional content about the resource metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalContentUrl?: string; - /** - * Additional metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly metadata?: Record; -} - -/** The check policy restrictions parameters describing the resource that is being evaluated. */ -export interface CheckRestrictionsRequest { - /** The information about the resource that will be evaluated. */ - resourceDetails: CheckRestrictionsResourceDetails; - /** The list of fields and values that should be evaluated for potential restrictions. */ - pendingFields?: PendingField[]; -} - -/** The information about the resource that will be evaluated. */ -export interface CheckRestrictionsResourceDetails { - /** The resource content. This should include whatever properties are already known and can be a partial set of all resource properties. */ - resourceContent: Record; - /** The api-version of the resource content. */ - apiVersion?: string; - /** The scope where the resource is being created. For example, if the resource is a child resource this would be the parent resource's resource ID. */ - scope?: string; -} - -/** A field that should be evaluated against Azure Policy to determine restrictions. */ -export interface PendingField { - /** The name of the field. This can be a top-level property like 'name' or 'type' or an Azure Policy field alias. */ - field: string; - /** The list of potential values for the field that should be evaluated against Azure Policy. */ - values?: string[]; -} - -/** The result of a check policy restrictions evaluation on a resource. */ -export interface CheckRestrictionsResult { - /** - * The restrictions that will be placed on various fields in the resource by policy. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly fieldRestrictions?: FieldRestrictions[]; - /** - * Evaluation results for the provided partial resource content. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly contentEvaluationResult?: CheckRestrictionsResultContentEvaluationResult; -} - -/** The restrictions that will be placed on a field in the resource by policy. */ -export interface FieldRestrictions { - /** - * The name of the field. This can be a top-level property like 'name' or 'type' or an Azure Policy field alias. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly field?: string; - /** The restrictions placed on that field by policy. */ - restrictions?: FieldRestriction[]; -} - -/** The restrictions on a field imposed by a specific policy. */ -export interface FieldRestriction { - /** - * The type of restriction that is imposed on the field. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly result?: FieldRestrictionResult; - /** - * The value that policy will set for the field if the user does not provide a value. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultValue?: string; - /** - * The values that policy either requires or denies for the field. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly values?: string[]; - /** - * The details of the policy that is causing the field restriction. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policy?: PolicyReference; -} - -/** Resource identifiers for a policy. */ -export interface PolicyReference { - /** - * The resource identifier of the policy definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionId?: string; - /** - * The resource identifier of the policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionId?: string; - /** - * The reference identifier of a specific policy definition within a policy set definition. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionReferenceId?: string; - /** - * The resource identifier of the policy assignment. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentId?: string; -} - -/** Evaluation results for the provided partial resource content. */ -export interface CheckRestrictionsResultContentEvaluationResult { - /** Policy evaluation results against the given resource content. This will indicate if the partial content that was provided will be denied as-is. */ - policyEvaluations?: PolicyEvaluationResult[]; -} - -/** The result of a non-compliant policy evaluation against the given resource content. */ -export interface PolicyEvaluationResult { - /** - * The details of the policy that was evaluated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyInfo?: PolicyReference; - /** - * The result of the policy evaluation against the resource. This will typically be 'NonCompliant' but may contain other values if errors were encountered. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly evaluationResult?: string; - /** - * The detailed results of the policy expressions and values that were evaluated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly evaluationDetails?: PolicyEvaluationDetails; -} - -/** The check policy restrictions parameters describing the resource that is being evaluated. */ -export interface CheckManagementGroupRestrictionsRequest { - /** The information about the resource that will be evaluated. */ - resourceDetails?: CheckRestrictionsResourceDetails; - /** The list of fields and values that should be evaluated for potential restrictions. */ - pendingFields?: PendingField[]; -} - -/** Query results. */ -export interface ComponentPolicyStatesQueryResults { - /** OData context string; used by OData clients to resolve type information based on metadata. */ - odataContext?: string; - /** OData entity count; represents the number of policy state records returned. */ - odataCount?: number; - /** Query results. */ - value?: ComponentPolicyState[]; -} - -/** Component Policy State record. */ -export interface ComponentPolicyState { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** - * OData entity ID; always set to null since component policy state records do not have an entity ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly odataId?: string; - /** - * OData context string; used by OData clients to resolve type information based on metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly odataContext?: string; - /** - * Timestamp for the component policy state record. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timestamp?: Date; - /** - * Component Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly componentId?: string; - /** - * Component type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly componentType?: string; - /** - * Component name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly componentName?: string; - /** - * Resource ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceId?: string; - /** - * Policy assignment ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentId?: string; - /** - * Policy definition ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionId?: string; - /** - * Subscription ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly subscriptionId?: string; - /** - * Resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: string; - /** - * Resource location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceLocation?: string; - /** - * Resource group name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceGroup?: string; - /** - * Policy assignment name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentName?: string; - /** - * Policy assignment owner. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentOwner?: string; - /** - * Policy assignment parameters. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentParameters?: string; - /** - * Policy assignment scope. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentScope?: string; - /** - * Policy definition name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionName?: string; - /** - * Policy definition action, i.e. effect. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionAction?: string; - /** - * Policy definition category. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionCategory?: string; - /** - * Policy set definition ID, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionId?: string; - /** - * Policy set definition name, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionName?: string; - /** - * Policy set definition owner, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionOwner?: string; - /** - * Policy set definition category, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionCategory?: string; - /** - * Policy set definition parameters, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionParameters?: string; - /** - * Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionReferenceId?: string; - /** - * Compliance state of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly complianceState?: string; - /** Policy evaluation details. This is only included in the response if the request contains $expand=PolicyEvaluationDetails. */ - policyEvaluationDetails?: ComponentPolicyEvaluationDetails; - /** - * Policy definition group names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionGroupNames?: string[]; - /** - * Evaluated policy definition version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyDefinitionVersion?: string; - /** - * Evaluated policy set definition version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policySetDefinitionVersion?: string; - /** - * Evaluated policy assignment version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyAssignmentVersion?: string; -} - -/** Policy evaluation details. */ -export interface ComponentPolicyEvaluationDetails { - /** - * Details of the evaluated expressions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly evaluatedExpressions?: ComponentExpressionEvaluationDetails[]; - /** Additional textual reason for the evaluation outcome. */ - reason?: string; -} - -/** Evaluation details of policy language expressions. */ -export interface ComponentExpressionEvaluationDetails { - /** Evaluation result. */ - result?: string; - /** - * Expression evaluated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly expression?: string; - /** - * The kind of expression that was evaluated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly expressionKind?: string; - /** - * Property path if the expression is a field or an alias. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly path?: string; - /** - * Value of the expression. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly expressionValue?: Record; - /** - * Target value to be compared with the expression value. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetValue?: Record; - /** - * Operator to compare the expression value and the target value. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operator?: string; -} - -/** List of available operations. */ -export interface OperationsListResults { - /** OData entity count; represents the number of operations returned. */ - odataCount?: number; - /** List of available operations. */ - value?: Operation[]; -} - -/** Operation definition. */ -export interface Operation { - /** Operation name. */ - name?: string; - /** Indicates whether the operation is a data action */ - isDataAction?: boolean; - /** Display metadata associated with the operation. */ - display?: OperationDisplay; -} - -/** Display metadata associated with the operation. */ -export interface OperationDisplay { - /** Resource provider name. */ - provider?: string; - /** Resource name on which the operation is performed. */ - resource?: string; - /** Operation name. */ - operation?: string; - /** Operation description. */ - description?: string; -} - -/** List of attestations. */ -export interface AttestationListResult { - /** - * Array of attestation definitions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Attestation[]; - /** - * The URL to get the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** A piece of evidence supporting the compliance state set in the attestation. */ -export interface AttestationEvidence { - /** The description for this piece of evidence. */ - description?: string; - /** The URI location of the evidence. */ - sourceUri?: string; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; -} - -/** Error response. */ -export interface ErrorResponseAutoGenerated2 { - /** The error details. */ - error?: ErrorDefinitionAutoGenerated2; -} - -/** Error definition. */ -export interface ErrorDefinitionAutoGenerated2 { - /** - * Service specific error code which serves as the substatus for the HTTP error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * Description of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The target of the error. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * Internal error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDefinitionAutoGenerated2[]; - /** - * Additional scenario specific error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: TypedErrorInfo[]; -} - -/** The properties of the policy metadata. */ -export interface PolicyMetadataProperties extends PolicyMetadataSlimProperties { - /** - * The description of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * The requirements of the policy metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requirements?: string; -} - -/** An attestation resource. */ -export interface Attestation extends Resource { - /** - * 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 resource ID of the policy assignment that the attestation is setting the state for. */ - policyAssignmentId: string; - /** The policy definition reference ID from a policy set definition that the attestation is setting the state for. If the policy assignment assigns a policy set definition the attestation can choose a definition within the set definition with this property or omit this and set the state for the entire set definition. */ - policyDefinitionReferenceId?: string; - /** The compliance state that should be set on the resource. */ - complianceState?: ComplianceState; - /** The time the compliance state should expire. */ - expiresOn?: Date; - /** The person responsible for setting the state of the resource. This value is typically an Azure Active Directory object ID. */ - owner?: string; - /** Comments describing why this attestation was created. */ - comments?: string; - /** The evidence supporting the compliance state set in this attestation. */ - evidence?: AttestationEvidence[]; - /** - * The status of the attestation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The time the compliance state was last changed in this attestation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastComplianceStateChangeAt?: Date; - /** The time the evidence was assessed */ - assessmentDate?: Date; - /** Additional metadata for this attestation */ - metadata?: Record; -} - -/** Parameter group */ -export interface QueryOptions { - /** Maximum number of records to return. */ - top?: number; - /** OData filter expression. */ - filter?: string; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData apply expression for aggregations. */ - apply?: string; - /** Skiptoken is only provided if a previous response returned a partial result as a part of nextLink element. */ - skipToken?: string; - /** The $expand query parameter. For example, to expand components use $expand=components */ - expand?: string; -} - -/** Known values of {@link PolicyTrackedResourcesResourceType} that the service accepts. */ -export enum KnownPolicyTrackedResourcesResourceType { - /** Default */ - Default = "default" -} - -/** - * Defines values for PolicyTrackedResourcesResourceType. \ - * {@link KnownPolicyTrackedResourcesResourceType} can be used interchangeably with PolicyTrackedResourcesResourceType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **default** - */ -export type PolicyTrackedResourcesResourceType = string; - -/** Known values of {@link ResourceDiscoveryMode} that the service accepts. */ -export enum KnownResourceDiscoveryMode { - /** Remediate resources that are already known to be non-compliant. */ - ExistingNonCompliant = "ExistingNonCompliant", - /** Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant. */ - ReEvaluateCompliance = "ReEvaluateCompliance" -} - -/** - * Defines values for ResourceDiscoveryMode. \ - * {@link KnownResourceDiscoveryMode} can be used interchangeably with ResourceDiscoveryMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ExistingNonCompliant**: Remediate resources that are already known to be non-compliant. \ - * **ReEvaluateCompliance**: Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant. - */ -export type ResourceDiscoveryMode = 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 PolicyEventsResourceType} that the service accepts. */ -export enum KnownPolicyEventsResourceType { - /** Default */ - Default = "default" -} - -/** - * Defines values for PolicyEventsResourceType. \ - * {@link KnownPolicyEventsResourceType} can be used interchangeably with PolicyEventsResourceType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **default** - */ -export type PolicyEventsResourceType = string; - -/** Known values of {@link PolicyStatesResource} that the service accepts. */ -export enum KnownPolicyStatesResource { - /** Default */ - Default = "default", - /** Latest */ - Latest = "latest" -} - -/** - * Defines values for PolicyStatesResource. \ - * {@link KnownPolicyStatesResource} can be used interchangeably with PolicyStatesResource, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **default** \ - * **latest** - */ -export type PolicyStatesResource = string; - -/** Known values of {@link PolicyStatesSummaryResourceType} that the service accepts. */ -export enum KnownPolicyStatesSummaryResourceType { - /** Latest */ - Latest = "latest" -} - -/** - * Defines values for PolicyStatesSummaryResourceType. \ - * {@link KnownPolicyStatesSummaryResourceType} can be used interchangeably with PolicyStatesSummaryResourceType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **latest** - */ -export type PolicyStatesSummaryResourceType = string; - -/** Known values of {@link FieldRestrictionResult} that the service accepts. */ -export enum KnownFieldRestrictionResult { - /** The field and/or values are required by policy. */ - Required = "Required", - /** The field will be removed by policy. */ - Removed = "Removed", - /** The field and/or values will be denied by policy. */ - Deny = "Deny" -} - -/** - * Defines values for FieldRestrictionResult. \ - * {@link KnownFieldRestrictionResult} can be used interchangeably with FieldRestrictionResult, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Required**: The field and\/or values are required by policy. \ - * **Removed**: The field will be removed by policy. \ - * **Deny**: The field and\/or values will be denied by policy. - */ -export type FieldRestrictionResult = string; - -/** Known values of {@link ComponentPolicyStatesResource} that the service accepts. */ -export enum KnownComponentPolicyStatesResource { - /** Latest */ - Latest = "latest" -} - -/** - * Defines values for ComponentPolicyStatesResource. \ - * {@link KnownComponentPolicyStatesResource} can be used interchangeably with ComponentPolicyStatesResource, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **latest** - */ -export type ComponentPolicyStatesResource = string; - -/** Known values of {@link ComplianceState} that the service accepts. */ -export enum KnownComplianceState { - /** The resource is in compliance with the policy. */ - Compliant = "Compliant", - /** The resource is not in compliance with the policy. */ - NonCompliant = "NonCompliant", - /** The compliance state of the resource is not known. */ - Unknown = "Unknown" -} - -/** - * Defines values for ComplianceState. \ - * {@link KnownComplianceState} can be used interchangeably with ComplianceState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Compliant**: The resource is in compliance with the policy. \ - * **NonCompliant**: The resource is not in compliance with the policy. \ - * **Unknown**: The compliance state of the resource is not known. - */ -export type ComplianceState = string; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForManagementGroup operation. */ -export type PolicyTrackedResourcesListQueryResultsForManagementGroupResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForSubscription operation. */ -export type PolicyTrackedResourcesListQueryResultsForSubscriptionResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResourceGroup operation. */ -export type PolicyTrackedResourcesListQueryResultsForResourceGroupResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResource operation. */ -export type PolicyTrackedResourcesListQueryResultsForResourceResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForManagementGroupNext operation. */ -export type PolicyTrackedResourcesListQueryResultsForManagementGroupNextResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForSubscriptionNext operation. */ -export type PolicyTrackedResourcesListQueryResultsForSubscriptionNextResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceGroupNext operation. */ -export type PolicyTrackedResourcesListQueryResultsForResourceGroupNextResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface PolicyTrackedResourcesListQueryResultsForResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceNext operation. */ -export type PolicyTrackedResourcesListQueryResultsForResourceNextResponse = PolicyTrackedResourcesQueryResults; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listDeploymentsAtManagementGroup operation. */ -export type RemediationsListDeploymentsAtManagementGroupResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsCancelAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancelAtManagementGroup operation. */ -export type RemediationsCancelAtManagementGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForManagementGroup operation. */ -export type RemediationsListForManagementGroupResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsCreateOrUpdateAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateAtManagementGroup operation. */ -export type RemediationsCreateOrUpdateAtManagementGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsGetAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtManagementGroup operation. */ -export type RemediationsGetAtManagementGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsDeleteAtManagementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteAtManagementGroup operation. */ -export type RemediationsDeleteAtManagementGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listDeploymentsAtSubscription operation. */ -export type RemediationsListDeploymentsAtSubscriptionResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsCancelAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancelAtSubscription operation. */ -export type RemediationsCancelAtSubscriptionResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForSubscription operation. */ -export type RemediationsListForSubscriptionResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsCreateOrUpdateAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateAtSubscription operation. */ -export type RemediationsCreateOrUpdateAtSubscriptionResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsGetAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtSubscription operation. */ -export type RemediationsGetAtSubscriptionResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsDeleteAtSubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteAtSubscription operation. */ -export type RemediationsDeleteAtSubscriptionResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listDeploymentsAtResourceGroup operation. */ -export type RemediationsListDeploymentsAtResourceGroupResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsCancelAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancelAtResourceGroup operation. */ -export type RemediationsCancelAtResourceGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForResourceGroup operation. */ -export type RemediationsListForResourceGroupResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsCreateOrUpdateAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateAtResourceGroup operation. */ -export type RemediationsCreateOrUpdateAtResourceGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsGetAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtResourceGroup operation. */ -export type RemediationsGetAtResourceGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsDeleteAtResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteAtResourceGroup operation. */ -export type RemediationsDeleteAtResourceGroupResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listDeploymentsAtResource operation. */ -export type RemediationsListDeploymentsAtResourceResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsCancelAtResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancelAtResource operation. */ -export type RemediationsCancelAtResourceResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForResource operation. */ -export type RemediationsListForResourceResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsCreateOrUpdateAtResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdateAtResource operation. */ -export type RemediationsCreateOrUpdateAtResourceResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsGetAtResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAtResource operation. */ -export type RemediationsGetAtResourceResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsDeleteAtResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the deleteAtResource operation. */ -export type RemediationsDeleteAtResourceResponse = Remediation; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDeploymentsAtManagementGroupNext operation. */ -export type RemediationsListDeploymentsAtManagementGroupNextResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsListForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForManagementGroupNext operation. */ -export type RemediationsListForManagementGroupNextResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDeploymentsAtSubscriptionNext operation. */ -export type RemediationsListDeploymentsAtSubscriptionNextResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsListForSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForSubscriptionNext operation. */ -export type RemediationsListForSubscriptionNextResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDeploymentsAtResourceGroupNext operation. */ -export type RemediationsListDeploymentsAtResourceGroupNextResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsListForResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForResourceGroupNext operation. */ -export type RemediationsListForResourceGroupNextResponse = RemediationListResult; - -/** Optional parameters. */ -export interface RemediationsListDeploymentsAtResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDeploymentsAtResourceNext operation. */ -export type RemediationsListDeploymentsAtResourceNextResponse = RemediationDeploymentsListResult; - -/** Optional parameters. */ -export interface RemediationsListForResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listForResourceNext operation. */ -export type RemediationsListForResourceNextResponse = RemediationListResult; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForManagementGroup operation. */ -export type PolicyEventsListQueryResultsForManagementGroupResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForSubscription operation. */ -export type PolicyEventsListQueryResultsForSubscriptionResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResourceGroup operation. */ -export type PolicyEventsListQueryResultsForResourceGroupResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResource operation. */ -export type PolicyEventsListQueryResultsForResourceResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForPolicySetDefinition operation. */ -export type PolicyEventsListQueryResultsForPolicySetDefinitionResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForPolicyDefinition operation. */ -export type PolicyEventsListQueryResultsForPolicyDefinitionResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignment operation. */ -export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignment operation. */ -export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForManagementGroupNext operation. */ -export type PolicyEventsListQueryResultsForManagementGroupNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForSubscriptionNext operation. */ -export type PolicyEventsListQueryResultsForSubscriptionNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceGroupNext operation. */ -export type PolicyEventsListQueryResultsForResourceGroupNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceNext operation. */ -export type PolicyEventsListQueryResultsForResourceNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForPolicySetDefinitionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. */ -export type PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForPolicyDefinitionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForPolicyDefinitionNext operation. */ -export type PolicyEventsListQueryResultsForPolicyDefinitionNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignmentNext operation. */ -export type PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignmentNext operation. */ -export type PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyEventsQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForManagementGroup operation. */ -export type PolicyStatesListQueryResultsForManagementGroupResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesSummarizeForManagementGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the summarizeForManagementGroup operation. */ -export type PolicyStatesSummarizeForManagementGroupResponse = SummarizeResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForSubscription operation. */ -export type PolicyStatesListQueryResultsForSubscriptionResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesSummarizeForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the summarizeForSubscription operation. */ -export type PolicyStatesSummarizeForSubscriptionResponse = SummarizeResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResourceGroup operation. */ -export type PolicyStatesListQueryResultsForResourceGroupResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesSummarizeForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the summarizeForResourceGroup operation. */ -export type PolicyStatesSummarizeForResourceGroupResponse = SummarizeResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForResource operation. */ -export type PolicyStatesListQueryResultsForResourceResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesSummarizeForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the summarizeForResource operation. */ -export type PolicyStatesSummarizeForResourceResponse = SummarizeResults; - -/** Optional parameters. */ -export interface PolicyStatesTriggerSubscriptionEvaluationOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface PolicyStatesTriggerResourceGroupEvaluationOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listQueryResultsForPolicySetDefinition operation. */ -export type PolicyStatesListQueryResultsForPolicySetDefinitionResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesSummarizeForPolicySetDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the summarizeForPolicySetDefinition operation. */ -export type PolicyStatesSummarizeForPolicySetDefinitionResponse = SummarizeResults; +/** Contains response data for the listForSubscription operation. */ +export type RemediationsListForSubscriptionResponse = RemediationListResult; /** Optional parameters. */ -export interface PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} +export interface RemediationsCreateOrUpdateAtSubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listQueryResultsForPolicyDefinition operation. */ -export type PolicyStatesListQueryResultsForPolicyDefinitionResponse = PolicyStatesQueryResults; +/** Contains response data for the createOrUpdateAtSubscription operation. */ +export type RemediationsCreateOrUpdateAtSubscriptionResponse = Remediation; /** Optional parameters. */ -export interface PolicyStatesSummarizeForPolicyDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} +export interface RemediationsGetAtSubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the summarizeForPolicyDefinition operation. */ -export type PolicyStatesSummarizeForPolicyDefinitionResponse = SummarizeResults; +/** Contains response data for the getAtSubscription operation. */ +export type RemediationsGetAtSubscriptionResponse = Remediation; /** Optional parameters. */ -export interface PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} +export interface RemediationsDeleteAtSubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignment operation. */ -export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = PolicyStatesQueryResults; +/** Contains response data for the deleteAtSubscription operation. */ +export type RemediationsDeleteAtSubscriptionResponse = Remediation; /** Optional parameters. */ -export interface PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams +export interface RemediationsListDeploymentsAtResourceGroupOptionalParams extends coreClient.OperationOptions { /** Parameter group */ queryOptions?: QueryOptions; } -/** Contains response data for the summarizeForSubscriptionLevelPolicyAssignment operation. */ -export type PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse = SummarizeResults; +/** Contains response data for the listDeploymentsAtResourceGroup operation. */ +export type RemediationsListDeploymentsAtResourceGroupResponse = + RemediationDeploymentsListResult; /** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} +export interface RemediationsCancelAtResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignment operation. */ -export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = PolicyStatesQueryResults; +/** Contains response data for the cancelAtResourceGroup operation. */ +export type RemediationsCancelAtResourceGroupResponse = Remediation; /** Optional parameters. */ -export interface PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams +export interface RemediationsListForResourceGroupOptionalParams extends coreClient.OperationOptions { /** Parameter group */ queryOptions?: QueryOptions; } -/** Contains response data for the summarizeForResourceGroupLevelPolicyAssignment operation. */ -export type PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse = SummarizeResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForManagementGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForManagementGroupNext operation. */ -export type PolicyStatesListQueryResultsForManagementGroupNextResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForSubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForSubscriptionNext operation. */ -export type PolicyStatesListQueryResultsForSubscriptionNextResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceGroupNext operation. */ -export type PolicyStatesListQueryResultsForResourceGroupNextResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForResourceNext operation. */ -export type PolicyStatesListQueryResultsForResourceNextResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForPolicySetDefinitionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForPolicySetDefinitionNext operation. */ -export type PolicyStatesListQueryResultsForPolicySetDefinitionNextResponse = PolicyStatesQueryResults; - -/** Optional parameters. */ -export interface PolicyStatesListQueryResultsForPolicyDefinitionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listQueryResultsForPolicyDefinitionNext operation. */ -export type PolicyStatesListQueryResultsForPolicyDefinitionNextResponse = PolicyStatesQueryResults; +/** Contains response data for the listForResourceGroup operation. */ +export type RemediationsListForResourceGroupResponse = RemediationListResult; /** Optional parameters. */ -export interface PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams +export interface RemediationsCreateOrUpdateAtResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignmentNext operation. */ -export type PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults; +/** Contains response data for the createOrUpdateAtResourceGroup operation. */ +export type RemediationsCreateOrUpdateAtResourceGroupResponse = Remediation; /** Optional parameters. */ -export interface PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams +export interface RemediationsGetAtResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignmentNext operation. */ -export type PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse = PolicyStatesQueryResults; +/** Contains response data for the getAtResourceGroup operation. */ +export type RemediationsGetAtResourceGroupResponse = Remediation; /** Optional parameters. */ -export interface PolicyMetadataGetResourceOptionalParams +export interface RemediationsDeleteAtResourceGroupOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getResource operation. */ -export type PolicyMetadataGetResourceResponse = PolicyMetadata; +/** Contains response data for the deleteAtResourceGroup operation. */ +export type RemediationsDeleteAtResourceGroupResponse = Remediation; /** Optional parameters. */ -export interface PolicyMetadataListOptionalParams +export interface RemediationsListDeploymentsAtResourceOptionalParams extends coreClient.OperationOptions { /** Parameter group */ queryOptions?: QueryOptions; } -/** Contains response data for the list operation. */ -export type PolicyMetadataListResponse = PolicyMetadataCollection; - -/** Optional parameters. */ -export interface PolicyMetadataListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type PolicyMetadataListNextResponse = PolicyMetadataCollection; - -/** Optional parameters. */ -export interface PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkAtSubscriptionScope operation. */ -export type PolicyRestrictionsCheckAtSubscriptionScopeResponse = CheckRestrictionsResult; - -/** Optional parameters. */ -export interface PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkAtResourceGroupScope operation. */ -export type PolicyRestrictionsCheckAtResourceGroupScopeResponse = CheckRestrictionsResult; - -/** Optional parameters. */ -export interface PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkAtManagementGroupScope operation. */ -export type PolicyRestrictionsCheckAtManagementGroupScopeResponse = CheckRestrictionsResult; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; -} - -/** Contains response data for the listQueryResultsForSubscription operation. */ -export type ComponentPolicyStatesListQueryResultsForSubscriptionResponse = ComponentPolicyStatesQueryResults; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; -} - -/** Contains response data for the listQueryResultsForResourceGroup operation. */ -export type ComponentPolicyStatesListQueryResultsForResourceGroupResponse = ComponentPolicyStatesQueryResults; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForResourceOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; - /** The $expand query parameter. */ - expand?: string; -} - -/** Contains response data for the listQueryResultsForResource operation. */ -export type ComponentPolicyStatesListQueryResultsForResourceResponse = ComponentPolicyStatesQueryResults; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; -} - -/** Contains response data for the listQueryResultsForPolicyDefinition operation. */ -export type ComponentPolicyStatesListQueryResultsForPolicyDefinitionResponse = ComponentPolicyStatesQueryResults; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; -} - -/** Contains response data for the listQueryResultsForSubscriptionLevelPolicyAssignment operation. */ -export type ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse = ComponentPolicyStatesQueryResults; - -/** Optional parameters. */ -export interface ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of records to return. */ - top?: number; - /** Ordering expression using OData notation. One or more comma-separated column names with an optional "desc" (the default) or "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". */ - orderBy?: string; - /** Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". */ - select?: string; - /** ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day). */ - from?: Date; - /** ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time. */ - to?: Date; - /** OData filter expression. */ - filter?: string; - /** OData apply expression for aggregations. */ - apply?: string; -} - -/** Contains response data for the listQueryResultsForResourceGroupLevelPolicyAssignment operation. */ -export type ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse = ComponentPolicyStatesQueryResults; +/** Contains response data for the listDeploymentsAtResource operation. */ +export type RemediationsListDeploymentsAtResourceResponse = + RemediationDeploymentsListResult; /** Optional parameters. */ -export interface OperationsListOptionalParams +export interface RemediationsCancelAtResourceOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationsListResults; +/** Contains response data for the cancelAtResource operation. */ +export type RemediationsCancelAtResourceResponse = Remediation; /** Optional parameters. */ -export interface AttestationsListForSubscriptionOptionalParams +export interface RemediationsListForResourceOptionalParams extends coreClient.OperationOptions { /** Parameter group */ queryOptions?: QueryOptions; } -/** Contains response data for the listForSubscription operation. */ -export type AttestationsListForSubscriptionResponse = AttestationListResult; - -/** Optional parameters. */ -export interface AttestationsCreateOrUpdateAtSubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdateAtSubscription operation. */ -export type AttestationsCreateOrUpdateAtSubscriptionResponse = Attestation; +/** Contains response data for the listForResource operation. */ +export type RemediationsListForResourceResponse = RemediationListResult; /** Optional parameters. */ -export interface AttestationsGetAtSubscriptionOptionalParams +export interface RemediationsCreateOrUpdateAtResourceOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getAtSubscription operation. */ -export type AttestationsGetAtSubscriptionResponse = Attestation; +/** Contains response data for the createOrUpdateAtResource operation. */ +export type RemediationsCreateOrUpdateAtResourceResponse = Remediation; /** Optional parameters. */ -export interface AttestationsDeleteAtSubscriptionOptionalParams +export interface RemediationsGetAtResourceOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface AttestationsListForResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForResourceGroup operation. */ -export type AttestationsListForResourceGroupResponse = AttestationListResult; +/** Contains response data for the getAtResource operation. */ +export type RemediationsGetAtResourceResponse = Remediation; /** Optional parameters. */ -export interface AttestationsCreateOrUpdateAtResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} +export interface RemediationsDeleteAtResourceOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the createOrUpdateAtResourceGroup operation. */ -export type AttestationsCreateOrUpdateAtResourceGroupResponse = Attestation; +/** Contains response data for the deleteAtResource operation. */ +export type RemediationsDeleteAtResourceResponse = Remediation; /** Optional parameters. */ -export interface AttestationsGetAtResourceGroupOptionalParams +export interface RemediationsListDeploymentsAtManagementGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getAtResourceGroup operation. */ -export type AttestationsGetAtResourceGroupResponse = Attestation; +/** Contains response data for the listDeploymentsAtManagementGroupNext operation. */ +export type RemediationsListDeploymentsAtManagementGroupNextResponse = + RemediationDeploymentsListResult; /** Optional parameters. */ -export interface AttestationsDeleteAtResourceGroupOptionalParams +export interface RemediationsListForManagementGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface AttestationsListForResourceOptionalParams - extends coreClient.OperationOptions { - /** Parameter group */ - queryOptions?: QueryOptions; -} - -/** Contains response data for the listForResource operation. */ -export type AttestationsListForResourceResponse = AttestationListResult; +/** Contains response data for the listForManagementGroupNext operation. */ +export type RemediationsListForManagementGroupNextResponse = + RemediationListResult; /** Optional parameters. */ -export interface AttestationsCreateOrUpdateAtResourceOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} +export interface RemediationsListDeploymentsAtSubscriptionNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the createOrUpdateAtResource operation. */ -export type AttestationsCreateOrUpdateAtResourceResponse = Attestation; +/** Contains response data for the listDeploymentsAtSubscriptionNext operation. */ +export type RemediationsListDeploymentsAtSubscriptionNextResponse = + RemediationDeploymentsListResult; /** Optional parameters. */ -export interface AttestationsGetAtResourceOptionalParams +export interface RemediationsListForSubscriptionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getAtResource operation. */ -export type AttestationsGetAtResourceResponse = Attestation; +/** Contains response data for the listForSubscriptionNext operation. */ +export type RemediationsListForSubscriptionNextResponse = RemediationListResult; /** Optional parameters. */ -export interface AttestationsDeleteAtResourceOptionalParams +export interface RemediationsListDeploymentsAtResourceGroupNextOptionalParams extends coreClient.OperationOptions {} +/** Contains response data for the listDeploymentsAtResourceGroupNext operation. */ +export type RemediationsListDeploymentsAtResourceGroupNextResponse = + RemediationDeploymentsListResult; + /** Optional parameters. */ -export interface AttestationsListForSubscriptionNextOptionalParams +export interface RemediationsListForResourceGroupNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForSubscriptionNext operation. */ -export type AttestationsListForSubscriptionNextResponse = AttestationListResult; +/** Contains response data for the listForResourceGroupNext operation. */ +export type RemediationsListForResourceGroupNextResponse = + RemediationListResult; /** Optional parameters. */ -export interface AttestationsListForResourceGroupNextOptionalParams +export interface RemediationsListDeploymentsAtResourceNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listForResourceGroupNext operation. */ -export type AttestationsListForResourceGroupNextResponse = AttestationListResult; +/** Contains response data for the listDeploymentsAtResourceNext operation. */ +export type RemediationsListDeploymentsAtResourceNextResponse = + RemediationDeploymentsListResult; /** Optional parameters. */ -export interface AttestationsListForResourceNextOptionalParams +export interface RemediationsListForResourceNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listForResourceNext operation. */ -export type AttestationsListForResourceNextResponse = AttestationListResult; +export type RemediationsListForResourceNextResponse = RemediationListResult; /** Optional parameters. */ export interface PolicyInsightsClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts index e67767353f32..ed820698630e 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/mappers.ts @@ -8,199 +8,6 @@ import * as coreClient from "@azure/core-client"; -export const PolicyTrackedResourcesQueryResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyTrackedResourcesQueryResults", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyTrackedResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PolicyTrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyTrackedResource", - modelProperties: { - trackedResourceId: { - serializedName: "trackedResourceId", - readOnly: true, - type: { - name: "String" - } - }, - policyDetails: { - serializedName: "policyDetails", - type: { - name: "Composite", - className: "PolicyDetails" - } - }, - createdBy: { - serializedName: "createdBy", - type: { - name: "Composite", - className: "TrackedResourceModificationDetails" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "Composite", - className: "TrackedResourceModificationDetails" - } - }, - lastUpdateUtc: { - serializedName: "lastUpdateUtc", - readOnly: true, - type: { - name: "DateTime" - } - } - } - } -}; - -export const PolicyDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyDetails", - modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentId: { - serializedName: "policyAssignmentId", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentDisplayName: { - serializedName: "policyAssignmentDisplayName", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentScope: { - serializedName: "policyAssignmentScope", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const TrackedResourceModificationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResourceModificationDetails", - modelProperties: { - policyDetails: { - serializedName: "policyDetails", - type: { - name: "Composite", - className: "PolicyDetails" - } - }, - deploymentId: { - serializedName: "deploymentId", - readOnly: true, - type: { - name: "String" - } - }, - deploymentTime: { - serializedName: "deploymentTime", - readOnly: true, - type: { - name: "DateTime" - } - } - } - } -}; - -export const QueryFailure: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QueryFailure", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "QueryFailureError" - } - } - } - } -}; - -export const QueryFailureError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QueryFailureError", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const RemediationDeploymentsListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -214,20 +21,20 @@ export const RemediationDeploymentsListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RemediationDeployment" - } - } - } + className: "RemediationDeployment", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const RemediationDeployment: coreClient.CompositeMapper = { @@ -239,53 +46,53 @@ export const RemediationDeployment: coreClient.CompositeMapper = { serializedName: "remediatedResourceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, deploymentId: { serializedName: "deploymentId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, status: { serializedName: "status", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resourceLocation: { serializedName: "resourceLocation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, error: { serializedName: "error", type: { name: "Composite", - className: "ErrorDefinition" - } + className: "ErrorDefinition", + }, }, createdOn: { serializedName: "createdOn", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastUpdatedOn: { serializedName: "lastUpdatedOn", readOnly: true, type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const ErrorDefinition: coreClient.CompositeMapper = { @@ -297,22 +104,22 @@ export const ErrorDefinition: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -322,10 +129,10 @@ export const ErrorDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDefinition" - } - } - } + className: "ErrorDefinition", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -335,13 +142,13 @@ export const ErrorDefinition: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "TypedErrorInfo" - } - } - } - } - } - } + className: "TypedErrorInfo", + }, + }, + }, + }, + }, + }, }; export const TypedErrorInfo: coreClient.CompositeMapper = { @@ -353,18 +160,18 @@ export const TypedErrorInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { - name: "any" - } - } - } - } + name: "any", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -376,11 +183,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDefinition" - } - } - } - } + className: "ErrorDefinition", + }, + }, + }, + }, }; export const Remediation: coreClient.CompositeMapper = { @@ -392,118 +199,118 @@ export const Remediation: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, policyAssignmentId: { serializedName: "properties.policyAssignmentId", type: { - name: "String" - } + name: "String", + }, }, policyDefinitionReferenceId: { serializedName: "properties.policyDefinitionReferenceId", type: { - name: "String" - } + name: "String", + }, }, resourceDiscoveryMode: { serializedName: "properties.resourceDiscoveryMode", type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, createdOn: { serializedName: "properties.createdOn", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastUpdatedOn: { serializedName: "properties.lastUpdatedOn", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, filters: { serializedName: "properties.filters", type: { name: "Composite", - className: "RemediationFilters" - } + className: "RemediationFilters", + }, }, deploymentStatus: { serializedName: "properties.deploymentStatus", type: { name: "Composite", - className: "RemediationDeploymentSummary" - } + className: "RemediationDeploymentSummary", + }, }, statusMessage: { serializedName: "properties.statusMessage", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, correlationId: { serializedName: "properties.correlationId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resourceCount: { serializedName: "properties.resourceCount", type: { - name: "Number" - } + name: "Number", + }, }, parallelDeployments: { serializedName: "properties.parallelDeployments", type: { - name: "Number" - } + name: "Number", + }, }, failureThreshold: { serializedName: "properties.failureThreshold", type: { name: "Composite", - className: "RemediationPropertiesFailureThreshold" - } - } - } - } + className: "RemediationPropertiesFailureThreshold", + }, + }, + }, + }, }; export const RemediationFilters: coreClient.CompositeMapper = { @@ -517,13 +324,24 @@ export const RemediationFilters: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + resourceIds: { + serializedName: "resourceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; export const RemediationDeploymentSummary: coreClient.CompositeMapper = { @@ -535,41 +353,42 @@ export const RemediationDeploymentSummary: coreClient.CompositeMapper = { serializedName: "totalDeployments", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, successfulDeployments: { serializedName: "successfulDeployments", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, failedDeployments: { serializedName: "failedDeployments", readOnly: true, type: { - name: "Number" - } - } - } - } -}; - -export const RemediationPropertiesFailureThreshold: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RemediationPropertiesFailureThreshold", - modelProperties: { - percentage: { - serializedName: "percentage", - type: { - name: "Number" - } - } - } - } -}; + name: "Number", + }, + }, + }, + }, +}; + +export const RemediationPropertiesFailureThreshold: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RemediationPropertiesFailureThreshold", + modelProperties: { + percentage: { + serializedName: "percentage", + type: { + name: "Number", + }, + }, + }, + }, + }; export const SystemData: coreClient.CompositeMapper = { type: { @@ -579,41 +398,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const RemediationListResult: coreClient.CompositeMapper = { @@ -629,2348 +448,18 @@ export const RemediationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Remediation" - } - } - } + className: "Remediation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const PolicyEventsQueryResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyEventsQueryResults", - modelProperties: { - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - odataCount: { - constraints: { - InclusiveMinimum: 0 + name: "String", }, - serializedName: "@odata\\.count", - type: { - name: "Number" - } - }, - odataNextLink: { - serializedName: "@odata\\.nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyEvent" - } - } - } - } - } - } -}; - -export const PolicyEvent: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyEvent", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - odataId: { - serializedName: "@odata\\.id", - type: { - name: "String" - } - }, - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - resourceId: { - serializedName: "resourceId", - type: { - name: "String" - } - }, - policyAssignmentId: { - serializedName: "policyAssignmentId", - type: { - name: "String" - } - }, - policyDefinitionId: { - serializedName: "policyDefinitionId", - type: { - name: "String" - } - }, - effectiveParameters: { - serializedName: "effectiveParameters", - type: { - name: "String" - } - }, - isCompliant: { - serializedName: "isCompliant", - type: { - name: "Boolean" - } - }, - subscriptionId: { - serializedName: "subscriptionId", - type: { - name: "String" - } - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - }, - resourceLocation: { - serializedName: "resourceLocation", - type: { - name: "String" - } - }, - resourceGroup: { - serializedName: "resourceGroup", - type: { - name: "String" - } - }, - resourceTags: { - serializedName: "resourceTags", - type: { - name: "String" - } - }, - policyAssignmentName: { - serializedName: "policyAssignmentName", - type: { - name: "String" - } - }, - policyAssignmentOwner: { - serializedName: "policyAssignmentOwner", - type: { - name: "String" - } - }, - policyAssignmentParameters: { - serializedName: "policyAssignmentParameters", - type: { - name: "String" - } - }, - policyAssignmentScope: { - serializedName: "policyAssignmentScope", - type: { - name: "String" - } - }, - policyDefinitionName: { - serializedName: "policyDefinitionName", - type: { - name: "String" - } - }, - policyDefinitionAction: { - serializedName: "policyDefinitionAction", - type: { - name: "String" - } - }, - policyDefinitionCategory: { - serializedName: "policyDefinitionCategory", - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - type: { - name: "String" - } - }, - policySetDefinitionName: { - serializedName: "policySetDefinitionName", - type: { - name: "String" - } - }, - policySetDefinitionOwner: { - serializedName: "policySetDefinitionOwner", - type: { - name: "String" - } - }, - policySetDefinitionCategory: { - serializedName: "policySetDefinitionCategory", - type: { - name: "String" - } - }, - policySetDefinitionParameters: { - serializedName: "policySetDefinitionParameters", - type: { - name: "String" - } - }, - managementGroupIds: { - serializedName: "managementGroupIds", - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - type: { - name: "String" - } - }, - complianceState: { - serializedName: "complianceState", - type: { - name: "String" - } - }, - tenantId: { - serializedName: "tenantId", - type: { - name: "String" - } }, - principalOid: { - serializedName: "principalOid", - type: { - name: "String" - } - }, - components: { - serializedName: "components", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComponentEventDetails" - } - } - } - } - } - } -}; - -export const ComponentEventDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentEventDetails", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - tenantId: { - serializedName: "tenantId", - type: { - name: "String" - } - }, - principalOid: { - serializedName: "principalOid", - type: { - name: "String" - } - }, - policyDefinitionAction: { - serializedName: "policyDefinitionAction", - type: { - name: "String" - } - } - } - } -}; - -export const PolicyStatesQueryResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyStatesQueryResults", - modelProperties: { - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - odataCount: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "@odata\\.count", - type: { - name: "Number" - } - }, - odataNextLink: { - serializedName: "@odata\\.nextLink", - type: { - name: "String" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyState" - } - } - } - } - } - } -}; - -export const PolicyState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyState", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - odataId: { - serializedName: "@odata\\.id", - type: { - name: "String" - } - }, - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - resourceId: { - serializedName: "resourceId", - type: { - name: "String" - } - }, - policyAssignmentId: { - serializedName: "policyAssignmentId", - type: { - name: "String" - } - }, - policyDefinitionId: { - serializedName: "policyDefinitionId", - type: { - name: "String" - } - }, - effectiveParameters: { - serializedName: "effectiveParameters", - type: { - name: "String" - } - }, - isCompliant: { - serializedName: "isCompliant", - type: { - name: "Boolean" - } - }, - subscriptionId: { - serializedName: "subscriptionId", - type: { - name: "String" - } - }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - }, - resourceLocation: { - serializedName: "resourceLocation", - type: { - name: "String" - } - }, - resourceGroup: { - serializedName: "resourceGroup", - type: { - name: "String" - } - }, - resourceTags: { - serializedName: "resourceTags", - type: { - name: "String" - } - }, - policyAssignmentName: { - serializedName: "policyAssignmentName", - type: { - name: "String" - } - }, - policyAssignmentOwner: { - serializedName: "policyAssignmentOwner", - type: { - name: "String" - } - }, - policyAssignmentParameters: { - serializedName: "policyAssignmentParameters", - type: { - name: "String" - } - }, - policyAssignmentScope: { - serializedName: "policyAssignmentScope", - type: { - name: "String" - } - }, - policyDefinitionName: { - serializedName: "policyDefinitionName", - type: { - name: "String" - } - }, - policyDefinitionAction: { - serializedName: "policyDefinitionAction", - type: { - name: "String" - } - }, - policyDefinitionCategory: { - serializedName: "policyDefinitionCategory", - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - type: { - name: "String" - } - }, - policySetDefinitionName: { - serializedName: "policySetDefinitionName", - type: { - name: "String" - } - }, - policySetDefinitionOwner: { - serializedName: "policySetDefinitionOwner", - type: { - name: "String" - } - }, - policySetDefinitionCategory: { - serializedName: "policySetDefinitionCategory", - type: { - name: "String" - } - }, - policySetDefinitionParameters: { - serializedName: "policySetDefinitionParameters", - type: { - name: "String" - } - }, - managementGroupIds: { - serializedName: "managementGroupIds", - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - type: { - name: "String" - } - }, - complianceState: { - serializedName: "complianceState", - type: { - name: "String" - } - }, - policyEvaluationDetails: { - serializedName: "policyEvaluationDetails", - type: { - name: "Composite", - className: "PolicyEvaluationDetails" - } - }, - policyDefinitionGroupNames: { - serializedName: "policyDefinitionGroupNames", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - components: { - serializedName: "components", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComponentStateDetails" - } - } - } - }, - policyDefinitionVersion: { - serializedName: "policyDefinitionVersion", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionVersion: { - serializedName: "policySetDefinitionVersion", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentVersion: { - serializedName: "policyAssignmentVersion", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PolicyEvaluationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyEvaluationDetails", - modelProperties: { - evaluatedExpressions: { - serializedName: "evaluatedExpressions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ExpressionEvaluationDetails" - } - } - } - }, - ifNotExistsDetails: { - serializedName: "ifNotExistsDetails", - type: { - name: "Composite", - className: "IfNotExistsEvaluationDetails" - } - } - } - } -}; - -export const ExpressionEvaluationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExpressionEvaluationDetails", - modelProperties: { - result: { - serializedName: "result", - type: { - name: "String" - } - }, - expression: { - serializedName: "expression", - type: { - name: "String" - } - }, - expressionKind: { - serializedName: "expressionKind", - readOnly: true, - type: { - name: "String" - } - }, - path: { - serializedName: "path", - type: { - name: "String" - } - }, - expressionValue: { - serializedName: "expressionValue", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - targetValue: { - serializedName: "targetValue", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - operator: { - serializedName: "operator", - type: { - name: "String" - } - } - } - } -}; - -export const IfNotExistsEvaluationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IfNotExistsEvaluationDetails", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String" - } - }, - totalResources: { - serializedName: "totalResources", - type: { - name: "Number" - } - } - } - } -}; - -export const ComponentStateDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentStateDetails", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - name: { - serializedName: "name", - type: { - name: "String" - } - }, - timestamp: { - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - complianceState: { - serializedName: "complianceState", - type: { - name: "String" - } - } - } - } -}; - -export const SummarizeResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SummarizeResults", - modelProperties: { - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - odataCount: { - constraints: { - InclusiveMaximum: 1, - InclusiveMinimum: 1 - }, - serializedName: "@odata\\.count", - type: { - name: "Number" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Summary" - } - } - } - } - } - } -}; - -export const Summary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Summary", - modelProperties: { - odataId: { - serializedName: "@odata\\.id", - type: { - name: "String" - } - }, - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - results: { - serializedName: "results", - type: { - name: "Composite", - className: "SummaryResults" - } - }, - policyAssignments: { - serializedName: "policyAssignments", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyAssignmentSummary" - } - } - } - } - } - } -}; - -export const SummaryResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SummaryResults", - modelProperties: { - queryResultsUri: { - serializedName: "queryResultsUri", - type: { - name: "String" - } - }, - nonCompliantResources: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "nonCompliantResources", - type: { - name: "Number" - } - }, - nonCompliantPolicies: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "nonCompliantPolicies", - type: { - name: "Number" - } - }, - resourceDetails: { - serializedName: "resourceDetails", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComplianceDetail" - } - } - } - }, - policyDetails: { - serializedName: "policyDetails", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComplianceDetail" - } - } - } - }, - policyGroupDetails: { - serializedName: "policyGroupDetails", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComplianceDetail" - } - } - } - } - } - } -}; - -export const ComplianceDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComplianceDetail", - modelProperties: { - complianceState: { - serializedName: "complianceState", - type: { - name: "String" - } - }, - count: { - serializedName: "count", - type: { - name: "Number" - } - } - } - } -}; - -export const PolicyAssignmentSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyAssignmentSummary", - modelProperties: { - policyAssignmentId: { - serializedName: "policyAssignmentId", - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - type: { - name: "String" - } - }, - results: { - serializedName: "results", - type: { - name: "Composite", - className: "SummaryResults" - } - }, - policyDefinitions: { - serializedName: "policyDefinitions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyDefinitionSummary" - } - } - } - }, - policyGroups: { - serializedName: "policyGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyGroupSummary" - } - } - } - } - } - } -}; - -export const PolicyDefinitionSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyDefinitionSummary", - modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - type: { - name: "String" - } - }, - policyDefinitionGroupNames: { - serializedName: "policyDefinitionGroupNames", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - effect: { - serializedName: "effect", - type: { - name: "String" - } - }, - results: { - serializedName: "results", - type: { - name: "Composite", - className: "SummaryResults" - } - } - } - } -}; - -export const PolicyGroupSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyGroupSummary", - modelProperties: { - policyGroupName: { - serializedName: "policyGroupName", - type: { - name: "String" - } - }, - results: { - serializedName: "results", - type: { - name: "Composite", - className: "SummaryResults" - } - } - } - } -}; - -export const PolicyMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyMetadata", - 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" - } - }, - metadataId: { - serializedName: "properties.metadataId", - readOnly: true, - type: { - name: "String" - } - }, - category: { - serializedName: "properties.category", - readOnly: true, - type: { - name: "String" - } - }, - title: { - serializedName: "properties.title", - readOnly: true, - type: { - name: "String" - } - }, - owner: { - serializedName: "properties.owner", - readOnly: true, - type: { - name: "String" - } - }, - additionalContentUrl: { - serializedName: "properties.additionalContentUrl", - readOnly: true, - type: { - name: "String" - } - }, - metadata: { - serializedName: "properties.metadata", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - description: { - serializedName: "properties.description", - readOnly: true, - type: { - name: "String" - } - }, - requirements: { - serializedName: "properties.requirements", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const PolicyMetadataSlimProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyMetadataSlimProperties", - modelProperties: { - metadataId: { - serializedName: "metadataId", - readOnly: true, - type: { - name: "String" - } - }, - category: { - serializedName: "category", - readOnly: true, - type: { - name: "String" - } - }, - title: { - serializedName: "title", - readOnly: true, - type: { - name: "String" - } - }, - owner: { - serializedName: "owner", - readOnly: true, - type: { - name: "String" - } - }, - additionalContentUrl: { - serializedName: "additionalContentUrl", - readOnly: true, - type: { - name: "String" - } - }, - metadata: { - serializedName: "metadata", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated" - } - } - } - } -}; - -export const ErrorDefinitionAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TypedErrorInfo" - } - } - } - } - } - } -}; - -export const PolicyMetadataCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyMetadataCollection", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SlimPolicyMetadata" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const SlimPolicyMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SlimPolicyMetadata", - 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" - } - }, - metadataId: { - serializedName: "properties.metadataId", - readOnly: true, - type: { - name: "String" - } - }, - category: { - serializedName: "properties.category", - readOnly: true, - type: { - name: "String" - } - }, - title: { - serializedName: "properties.title", - readOnly: true, - type: { - name: "String" - } - }, - owner: { - serializedName: "properties.owner", - readOnly: true, - type: { - name: "String" - } - }, - additionalContentUrl: { - serializedName: "properties.additionalContentUrl", - readOnly: true, - type: { - name: "String" - } - }, - metadata: { - serializedName: "properties.metadata", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const CheckRestrictionsRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckRestrictionsRequest", - modelProperties: { - resourceDetails: { - serializedName: "resourceDetails", - type: { - name: "Composite", - className: "CheckRestrictionsResourceDetails" - } - }, - pendingFields: { - serializedName: "pendingFields", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PendingField" - } - } - } - } - } - } -}; - -export const CheckRestrictionsResourceDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckRestrictionsResourceDetails", - modelProperties: { - resourceContent: { - serializedName: "resourceContent", - required: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - apiVersion: { - serializedName: "apiVersion", - type: { - name: "String" - } - }, - scope: { - serializedName: "scope", - type: { - name: "String" - } - } - } - } -}; - -export const PendingField: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PendingField", - modelProperties: { - field: { - serializedName: "field", - required: true, - type: { - name: "String" - } - }, - values: { - serializedName: "values", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const CheckRestrictionsResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckRestrictionsResult", - modelProperties: { - fieldRestrictions: { - serializedName: "fieldRestrictions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FieldRestrictions" - } - } - } - }, - contentEvaluationResult: { - serializedName: "contentEvaluationResult", - type: { - name: "Composite", - className: "CheckRestrictionsResultContentEvaluationResult" - } - } - } - } -}; - -export const FieldRestrictions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FieldRestrictions", - modelProperties: { - field: { - serializedName: "field", - readOnly: true, - type: { - name: "String" - } - }, - restrictions: { - serializedName: "restrictions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FieldRestriction" - } - } - } - } - } - } -}; - -export const FieldRestriction: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FieldRestriction", - modelProperties: { - result: { - serializedName: "result", - readOnly: true, - type: { - name: "String" - } - }, - defaultValue: { - serializedName: "defaultValue", - readOnly: true, - type: { - name: "String" - } - }, - values: { - serializedName: "values", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - policy: { - serializedName: "policy", - type: { - name: "Composite", - className: "PolicyReference" - } - } - } - } -}; - -export const PolicyReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyReference", - modelProperties: { - policyDefinitionId: { - serializedName: "policyDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentId: { - serializedName: "policyAssignmentId", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const CheckRestrictionsResultContentEvaluationResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckRestrictionsResultContentEvaluationResult", - modelProperties: { - policyEvaluations: { - serializedName: "policyEvaluations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyEvaluationResult" - } - } - } - } - } - } -}; - -export const PolicyEvaluationResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyEvaluationResult", - modelProperties: { - policyInfo: { - serializedName: "policyInfo", - type: { - name: "Composite", - className: "PolicyReference" - } - }, - evaluationResult: { - serializedName: "evaluationResult", - readOnly: true, - type: { - name: "String" - } - }, - evaluationDetails: { - serializedName: "evaluationDetails", - type: { - name: "Composite", - className: "PolicyEvaluationDetails" - } - } - } - } -}; - -export const CheckManagementGroupRestrictionsRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckManagementGroupRestrictionsRequest", - modelProperties: { - resourceDetails: { - serializedName: "resourceDetails", - type: { - name: "Composite", - className: "CheckRestrictionsResourceDetails" - } - }, - pendingFields: { - serializedName: "pendingFields", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PendingField" - } - } - } - } - } - } -}; - -export const ComponentPolicyStatesQueryResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentPolicyStatesQueryResults", - modelProperties: { - odataContext: { - serializedName: "@odata\\.context", - type: { - name: "String" - } - }, - odataCount: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "@odata\\.count", - type: { - name: "Number" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComponentPolicyState" - } - } - } - } - } - } -}; - -export const ComponentPolicyState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentPolicyState", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - odataId: { - serializedName: "@odata\\.id", - readOnly: true, - type: { - name: "String" - } - }, - odataContext: { - serializedName: "@odata\\.context", - readOnly: true, - type: { - name: "String" - } - }, - timestamp: { - serializedName: "timestamp", - readOnly: true, - type: { - name: "DateTime" - } - }, - componentId: { - serializedName: "componentId", - readOnly: true, - type: { - name: "String" - } - }, - componentType: { - serializedName: "componentType", - readOnly: true, - type: { - name: "String" - } - }, - componentName: { - serializedName: "componentName", - readOnly: true, - type: { - name: "String" - } - }, - resourceId: { - serializedName: "resourceId", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentId: { - serializedName: "policyAssignmentId", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionId: { - serializedName: "policyDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - subscriptionId: { - serializedName: "subscriptionId", - readOnly: true, - type: { - name: "String" - } - }, - resourceType: { - serializedName: "resourceType", - readOnly: true, - type: { - name: "String" - } - }, - resourceLocation: { - serializedName: "resourceLocation", - readOnly: true, - type: { - name: "String" - } - }, - resourceGroup: { - serializedName: "resourceGroup", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentName: { - serializedName: "policyAssignmentName", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentOwner: { - serializedName: "policyAssignmentOwner", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentParameters: { - serializedName: "policyAssignmentParameters", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentScope: { - serializedName: "policyAssignmentScope", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionName: { - serializedName: "policyDefinitionName", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionAction: { - serializedName: "policyDefinitionAction", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionCategory: { - serializedName: "policyDefinitionCategory", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionId: { - serializedName: "policySetDefinitionId", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionName: { - serializedName: "policySetDefinitionName", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionOwner: { - serializedName: "policySetDefinitionOwner", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionCategory: { - serializedName: "policySetDefinitionCategory", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionParameters: { - serializedName: "policySetDefinitionParameters", - readOnly: true, - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "policyDefinitionReferenceId", - readOnly: true, - type: { - name: "String" - } - }, - complianceState: { - serializedName: "complianceState", - readOnly: true, - type: { - name: "String" - } - }, - policyEvaluationDetails: { - serializedName: "policyEvaluationDetails", - type: { - name: "Composite", - className: "ComponentPolicyEvaluationDetails" - } - }, - policyDefinitionGroupNames: { - serializedName: "policyDefinitionGroupNames", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - policyDefinitionVersion: { - serializedName: "policyDefinitionVersion", - readOnly: true, - type: { - name: "String" - } - }, - policySetDefinitionVersion: { - serializedName: "policySetDefinitionVersion", - readOnly: true, - type: { - name: "String" - } - }, - policyAssignmentVersion: { - serializedName: "policyAssignmentVersion", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ComponentPolicyEvaluationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentPolicyEvaluationDetails", - modelProperties: { - evaluatedExpressions: { - serializedName: "evaluatedExpressions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ComponentExpressionEvaluationDetails" - } - } - } - }, - reason: { - serializedName: "reason", - type: { - name: "String" - } - } - } - } -}; - -export const ComponentExpressionEvaluationDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComponentExpressionEvaluationDetails", - modelProperties: { - result: { - serializedName: "result", - type: { - name: "String" - } - }, - expression: { - serializedName: "expression", - readOnly: true, - type: { - name: "String" - } - }, - expressionKind: { - serializedName: "expressionKind", - readOnly: true, - type: { - name: "String" - } - }, - path: { - serializedName: "path", - readOnly: true, - type: { - name: "String" - } - }, - expressionValue: { - serializedName: "expressionValue", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - targetValue: { - serializedName: "targetValue", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - operator: { - serializedName: "operator", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const OperationsListResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationsListResults", - modelProperties: { - odataCount: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "@odata\\.count", - type: { - name: "Number" - } - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } - } - } - } - } -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const AttestationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AttestationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Attestation" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const AttestationEvidence: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AttestationEvidence", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String" - } - }, - sourceUri: { - serializedName: "sourceUri", - type: { - name: "String" - } - } - } - } -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponseAutoGenerated2: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseAutoGenerated2", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated2" - } - } - } - } -}; - -export const ErrorDefinitionAutoGenerated2: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated2", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDefinitionAutoGenerated2" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TypedErrorInfo" - } - } - } - } - } - } -}; - -export const PolicyMetadataProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyMetadataProperties", - modelProperties: { - ...PolicyMetadataSlimProperties.type.modelProperties, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - }, - requirements: { - serializedName: "requirements", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const Attestation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Attestation", - modelProperties: { - ...Resource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, - policyAssignmentId: { - serializedName: "properties.policyAssignmentId", - required: true, - type: { - name: "String" - } - }, - policyDefinitionReferenceId: { - serializedName: "properties.policyDefinitionReferenceId", - type: { - name: "String" - } - }, - complianceState: { - serializedName: "properties.complianceState", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "properties.expiresOn", - type: { - name: "DateTime" - } - }, - owner: { - serializedName: "properties.owner", - type: { - name: "String" - } - }, - comments: { - serializedName: "properties.comments", - type: { - name: "String" - } - }, - evidence: { - serializedName: "properties.evidence", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AttestationEvidence" - } - } - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - lastComplianceStateChangeAt: { - serializedName: "properties.lastComplianceStateChangeAt", - readOnly: true, - type: { - name: "DateTime" - } - }, - assessmentDate: { - serializedName: "properties.assessmentDate", - type: { - name: "DateTime" - } - }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + }, + }, }; diff --git a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts index 5e44031a555a..c8cede84a764 100644 --- a/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts +++ b/sdk/policyinsights/arm-policyinsights/src/models/parameters.ts @@ -9,14 +9,9 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; -import { - Remediation as RemediationMapper, - CheckRestrictionsRequest as CheckRestrictionsRequestMapper, - CheckManagementGroupRestrictionsRequest as CheckManagementGroupRestrictionsRequestMapper, - Attestation as AttestationMapper -} from "../models/mappers"; +import { Remediation as RemediationMapper } from "../models/mappers"; export const accept: OperationParameter = { parameterPath: "accept", @@ -25,9 +20,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -36,10 +31,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const managementGroupsNamespace: OperationURLParameter = { @@ -49,146 +44,66 @@ export const managementGroupsNamespace: OperationURLParameter = { isConstant: true, serializedName: "managementGroupsNamespace", type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const managementGroupName: OperationURLParameter = { - parameterPath: "managementGroupName", +export const managementGroupId: OperationURLParameter = { + parameterPath: "managementGroupId", mapper: { - serializedName: "managementGroupName", + serializedName: "managementGroupId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const policyTrackedResourcesResource: OperationURLParameter = { - parameterPath: "policyTrackedResourcesResource", +export const remediationName: OperationURLParameter = { + parameterPath: "remediationName", mapper: { - serializedName: "policyTrackedResourcesResource", + serializedName: "remediationName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const top: OperationQueryParameter = { parameterPath: ["options", "queryOptions", "top"], mapper: { constraints: { - InclusiveMinimum: 0 + InclusiveMinimum: 0, }, serializedName: "$top", type: { - name: "Number" - } - } -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - } + name: "Number", + }, + }, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-07-01-preview", + defaultValue: "2024-10-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "String" - } - } -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - serializedName: "resourceGroupName", - required: true, - type: { - name: "String" - } - } -}; - -export const resourceId: OperationURLParameter = { - parameterPath: "resourceId", - mapper: { - serializedName: "resourceId", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const filter: OperationQueryParameter = { + parameterPath: ["options", "queryOptions", "filter"], mapper: { - serializedName: "nextLink", - required: true, + serializedName: "$filter", type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true -}; - -export const managementGroupId: OperationURLParameter = { - parameterPath: "managementGroupId", - mapper: { - serializedName: "managementGroupId", - required: true, - type: { - name: "String" - } - } -}; - -export const remediationName: OperationURLParameter = { - parameterPath: "remediationName", - mapper: { - serializedName: "remediationName", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-10-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } }; export const contentType: OperationParameter = { @@ -198,398 +113,58 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: RemediationMapper -}; - -export const policyEventsResource: OperationURLParameter = { - parameterPath: "policyEventsResource", - mapper: { - serializedName: "policyEventsResource", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2019-10-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } + mapper: RemediationMapper, }; -export const orderBy: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "orderBy"], - mapper: { - serializedName: "$orderby", - type: { - name: "String" - } - } -}; - -export const select: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "select"], - mapper: { - serializedName: "$select", - type: { - name: "String" - } - } -}; - -export const from: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "from"], - mapper: { - serializedName: "$from", - type: { - name: "DateTime" - } - } -}; - -export const to: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "to"], - mapper: { - serializedName: "$to", - type: { - name: "DateTime" - } - } -}; - -export const apply: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "apply"], - mapper: { - serializedName: "$apply", - type: { - name: "String" - } - } -}; - -export const skipToken: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "skipToken"], - mapper: { - serializedName: "$skiptoken", - type: { - name: "String" - } - } -}; - -export const subscriptionId1: OperationURLParameter = { +export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } -}; - -export const expand: OperationQueryParameter = { - parameterPath: ["options", "queryOptions", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String" - } - } -}; - -export const authorizationNamespace: OperationURLParameter = { - parameterPath: "authorizationNamespace", - mapper: { - defaultValue: "Microsoft.Authorization", - isConstant: true, - serializedName: "authorizationNamespace", - type: { - name: "String" - } - } -}; - -export const policySetDefinitionName: OperationURLParameter = { - parameterPath: "policySetDefinitionName", - mapper: { - serializedName: "policySetDefinitionName", - required: true, - type: { - name: "String" - } - } -}; - -export const policyDefinitionName: OperationURLParameter = { - parameterPath: "policyDefinitionName", - mapper: { - serializedName: "policyDefinitionName", - required: true, - type: { - name: "String" - } - } -}; - -export const policyAssignmentName: OperationURLParameter = { - parameterPath: "policyAssignmentName", - mapper: { - serializedName: "policyAssignmentName", - required: true, - type: { - name: "String" - } - } -}; - -export const policyStatesResource: OperationURLParameter = { - parameterPath: "policyStatesResource", - mapper: { - serializedName: "policyStatesResource", - required: true, - type: { - name: "String" - } - } -}; - -export const policyStatesSummaryResource: OperationURLParameter = { - parameterPath: "policyStatesSummaryResource", - mapper: { - serializedName: "policyStatesSummaryResource", - required: true, - type: { - name: "String" - } - } -}; - -export const resourceName: OperationURLParameter = { - parameterPath: "resourceName", - mapper: { - serializedName: "resourceName", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: CheckRestrictionsRequestMapper -}; - -export const apiVersion3: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-03-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } }; -export const resourceGroupName1: OperationURLParameter = { +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - constraints: { - MaxLength: 90, - MinLength: 1 - }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: CheckManagementGroupRestrictionsRequestMapper -}; - -export const componentPolicyStatesResource: OperationURLParameter = { - parameterPath: "componentPolicyStatesResource", - mapper: { - serializedName: "componentPolicyStatesResource", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion4: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-04-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const top1: OperationQueryParameter = { - parameterPath: ["options", "top"], - mapper: { - constraints: { - InclusiveMinimum: 0 + name: "String", }, - serializedName: "$top", - type: { - name: "Number" - } - } -}; - -export const orderBy1: OperationQueryParameter = { - parameterPath: ["options", "orderBy"], - mapper: { - serializedName: "$orderby", - type: { - name: "String" - } - } -}; - -export const select1: OperationQueryParameter = { - parameterPath: ["options", "select"], - mapper: { - serializedName: "$select", - type: { - name: "String" - } - } -}; - -export const from1: OperationQueryParameter = { - parameterPath: ["options", "from"], - mapper: { - serializedName: "$from", - type: { - name: "DateTime" - } - } -}; - -export const to1: OperationQueryParameter = { - parameterPath: ["options", "to"], - mapper: { - serializedName: "$to", - type: { - name: "DateTime" - } - } -}; - -export const filter1: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String" - } - } -}; - -export const apply1: OperationQueryParameter = { - parameterPath: ["options", "apply"], - mapper: { - serializedName: "$apply", - type: { - name: "String" - } - } -}; - -export const expand1: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String" - } - } + }, }; -export const policyDefinitionName1: OperationURLParameter = { - parameterPath: "policyDefinitionName", +export const resourceId: OperationURLParameter = { + parameterPath: "resourceId", mapper: { - constraints: { - Pattern: new RegExp("^[^<>%&:\\\\?/#]*$"), - MaxLength: 64, - MinLength: 1 - }, - serializedName: "policyDefinitionName", + serializedName: "resourceId", required: true, type: { - name: "String" - } - } -}; - -export const policyAssignmentName1: OperationURLParameter = { - parameterPath: "policyAssignmentName", - mapper: { - constraints: { - Pattern: new RegExp("^[^<>%&:\\\\?/#]*$"), - MaxLength: 64, - MinLength: 1 + name: "String", }, - serializedName: "policyAssignmentName", - required: true, - type: { - name: "String" - } - } -}; - -export const apiVersion5: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2022-09-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: AttestationMapper + }, + skipEncoding: true, }; -export const attestationName: OperationURLParameter = { - parameterPath: "attestationName", +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - serializedName: "attestationName", + serializedName: "nextLink", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, + skipEncoding: true, }; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/attestations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/attestations.ts deleted file mode 100644 index c9d18df0ce72..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/attestations.ts +++ /dev/null @@ -1,1043 +0,0 @@ -/* - * 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 { Attestations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - Attestation, - AttestationsListForSubscriptionNextOptionalParams, - AttestationsListForSubscriptionOptionalParams, - AttestationsListForSubscriptionResponse, - AttestationsListForResourceGroupNextOptionalParams, - AttestationsListForResourceGroupOptionalParams, - AttestationsListForResourceGroupResponse, - AttestationsListForResourceNextOptionalParams, - AttestationsListForResourceOptionalParams, - AttestationsListForResourceResponse, - AttestationsCreateOrUpdateAtSubscriptionOptionalParams, - AttestationsCreateOrUpdateAtSubscriptionResponse, - AttestationsGetAtSubscriptionOptionalParams, - AttestationsGetAtSubscriptionResponse, - AttestationsDeleteAtSubscriptionOptionalParams, - AttestationsCreateOrUpdateAtResourceGroupOptionalParams, - AttestationsCreateOrUpdateAtResourceGroupResponse, - AttestationsGetAtResourceGroupOptionalParams, - AttestationsGetAtResourceGroupResponse, - AttestationsDeleteAtResourceGroupOptionalParams, - AttestationsCreateOrUpdateAtResourceOptionalParams, - AttestationsCreateOrUpdateAtResourceResponse, - AttestationsGetAtResourceOptionalParams, - AttestationsGetAtResourceResponse, - AttestationsDeleteAtResourceOptionalParams, - AttestationsListForSubscriptionNextResponse, - AttestationsListForResourceGroupNextResponse, - AttestationsListForResourceNextResponse -} from "../models"; - -/// -/** Class containing Attestations operations. */ -export class AttestationsImpl implements Attestations { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class Attestations class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Gets all attestations for the subscription. - * @param options The options parameters. - */ - public listForSubscription( - options?: AttestationsListForSubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForSubscriptionPagingAll(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.listForSubscriptionPagingPage(options, settings); - } - }; - } - - private async *listForSubscriptionPagingPage( - options?: AttestationsListForSubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: AttestationsListForSubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForSubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForSubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForSubscriptionPagingAll( - options?: AttestationsListForSubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForSubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Gets all attestations for the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listForResourceGroup( - resourceGroupName: string, - options?: AttestationsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourceGroupPagingAll(resourceGroupName, 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.listForResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listForResourceGroupPagingPage( - resourceGroupName: string, - options?: AttestationsListForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: AttestationsListForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourceGroupPagingAll( - resourceGroupName: string, - options?: AttestationsListForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Gets all attestations for a resource. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - public listForResource( - resourceId: string, - options?: AttestationsListForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listForResourcePagingAll(resourceId, 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.listForResourcePagingPage(resourceId, options, settings); - } - }; - } - - private async *listForResourcePagingPage( - resourceId: string, - options?: AttestationsListForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: AttestationsListForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listForResource(resourceId, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listForResourceNext( - resourceId, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listForResourcePagingAll( - resourceId: string, - options?: AttestationsListForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listForResourcePagingPage( - resourceId, - options - )) { - yield* page; - } - } - - /** - * Gets all attestations for the subscription. - * @param options The options parameters. - */ - private _listForSubscription( - options?: AttestationsListForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listForSubscriptionOperationSpec - ); - } - - /** - * Creates or updates an attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscription( - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtSubscriptionResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { attestationName, parameters, options }, - createOrUpdateAtSubscriptionOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates an attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtSubscriptionAndWait( - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdateAtSubscription( - attestationName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Gets an existing attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtSubscription( - attestationName: string, - options?: AttestationsGetAtSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { attestationName, options }, - getAtSubscriptionOperationSpec - ); - } - - /** - * Deletes an existing attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtSubscription( - attestationName: string, - options?: AttestationsDeleteAtSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { attestationName, options }, - deleteAtSubscriptionOperationSpec - ); - } - - /** - * Gets all attestations for the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listForResourceGroup( - resourceGroupName: string, - options?: AttestationsListForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listForResourceGroupOperationSpec - ); - } - - /** - * Creates or updates an attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResourceGroup( - resourceGroupName: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtResourceGroupResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceGroupName, attestationName, parameters, options }, - createOrUpdateAtResourceGroupOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates an attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdateAtResourceGroup( - resourceGroupName, - attestationName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Gets an existing attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtResourceGroup( - resourceGroupName: string, - attestationName: string, - options?: AttestationsGetAtResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, attestationName, options }, - getAtResourceGroupOperationSpec - ); - } - - /** - * Deletes an existing attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtResourceGroup( - resourceGroupName: string, - attestationName: string, - options?: AttestationsDeleteAtResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, attestationName, options }, - deleteAtResourceGroupOperationSpec - ); - } - - /** - * Gets all attestations for a resource. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - private _listForResource( - resourceId: string, - options?: AttestationsListForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, options }, - listForResourceOperationSpec - ); - } - - /** - * Creates or updates an attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResource( - resourceId: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtResourceResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceId, attestationName, parameters, options }, - createOrUpdateAtResourceOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates an attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - async beginCreateOrUpdateAtResourceAndWait( - resourceId: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdateAtResource( - resourceId, - attestationName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Gets an existing attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtResource( - resourceId: string, - attestationName: string, - options?: AttestationsGetAtResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, attestationName, options }, - getAtResourceOperationSpec - ); - } - - /** - * Deletes an existing attestation at individual resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtResource( - resourceId: string, - attestationName: string, - options?: AttestationsDeleteAtResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, attestationName, options }, - deleteAtResourceOperationSpec - ); - } - - /** - * ListForSubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListForSubscription method. - * @param options The options parameters. - */ - private _listForSubscriptionNext( - nextLink: string, - options?: AttestationsListForSubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listForSubscriptionNextOperationSpec - ); - } - - /** - * ListForResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListForResourceGroup method. - * @param options The options parameters. - */ - private _listForResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: AttestationsListForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec - ); - } - - /** - * ListForResourceNext - * @param resourceId Resource ID. - * @param nextLink The nextLink from the previous successful call to the ListForResource method. - * @param options The options parameters. - */ - private _listForResourceNext( - resourceId: string, - nextLink: string, - options?: AttestationsListForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, nextLink, options }, - listForResourceNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - 201: { - bodyMapper: Mappers.Attestation - }, - 202: { - bodyMapper: Mappers.Attestation - }, - 204: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - 201: { - bodyMapper: Mappers.Attestation - }, - 202: { - bodyMapper: Mappers.Attestation - }, - 204: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.attestationName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceOperationSpec: coreClient.OperationSpec = { - path: "/{resourceId}/providers/Microsoft.PolicyInsights/attestations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion5], - urlParameters: [Parameters.$host, Parameters.resourceId], - headerParameters: [Parameters.accept], - serializer -}; -const createOrUpdateAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - 201: { - bodyMapper: Mappers.Attestation - }, - 202: { - bodyMapper: Mappers.Attestation - }, - 204: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const getAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Attestation - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - queryParameters: [Parameters.apiVersion5], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.attestationName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - Parameters.resourceGroupName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AttestationListResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated2 - } - }, - urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/componentPolicyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operations/componentPolicyStates.ts deleted file mode 100644 index 51fcb5446666..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/componentPolicyStates.ts +++ /dev/null @@ -1,376 +0,0 @@ -/* - * 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 { ComponentPolicyStates } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - ComponentPolicyStatesResource, - ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams, - ComponentPolicyStatesListQueryResultsForSubscriptionResponse, - ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceGroupResponse, - ComponentPolicyStatesListQueryResultsForResourceOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceResponse, - ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, - ComponentPolicyStatesListQueryResultsForPolicyDefinitionResponse, - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse, - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse -} from "../models"; - -/** Class containing ComponentPolicyStates operations. */ -export class ComponentPolicyStatesImpl implements ComponentPolicyStates { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class ComponentPolicyStates class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Queries component policy states under subscription scope. - * @param subscriptionId Microsoft Azure subscription ID. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForSubscription( - subscriptionId: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { subscriptionId, componentPolicyStatesResource, options }, - listQueryResultsForSubscriptionOperationSpec - ); - } - - /** - * Queries component policy states under resource group scope. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResourceGroup( - subscriptionId: string, - resourceGroupName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - subscriptionId, - resourceGroupName, - componentPolicyStatesResource, - options - }, - listQueryResultsForResourceGroupOperationSpec - ); - } - - /** - * Queries component policy states for the resource. - * @param resourceId Resource ID. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResource( - resourceId: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, componentPolicyStatesResource, options }, - listQueryResultsForResourceOperationSpec - ); - } - - /** - * Queries component policy states for the subscription level policy definition. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForPolicyDefinition( - subscriptionId: string, - policyDefinitionName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - subscriptionId, - policyDefinitionName, - componentPolicyStatesResource, - options - }, - listQueryResultsForPolicyDefinitionOperationSpec - ); - } - - /** - * Queries component policy states for the subscription level policy assignment. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForSubscriptionLevelPolicyAssignment( - subscriptionId: string, - policyAssignmentName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise< - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - subscriptionId, - policyAssignmentName, - componentPolicyStatesResource, - options - }, - listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec - ); - } - - /** - * Queries component policy states for the resource group level policy assignment. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResourceGroupLevelPolicyAssignment( - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - subscriptionId, - resourceGroupName, - policyAssignmentName, - componentPolicyStatesResource, - options - }, - listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listQueryResultsForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1 - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.componentPolicyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1 - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.componentPolicyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1, - Parameters.expand1 - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.componentPolicyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicyDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1 - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.componentPolicyStatesResource, - Parameters.policyDefinitionName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1 - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.componentPolicyStatesResource, - Parameters.policyAssignmentName1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/componentPolicyStates/{componentPolicyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ComponentPolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [ - Parameters.apiVersion4, - Parameters.top1, - Parameters.orderBy1, - Parameters.select1, - Parameters.from1, - Parameters.to1, - Parameters.filter1, - Parameters.apply1 - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.componentPolicyStatesResource, - Parameters.policyAssignmentName1 - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts index d6c77636fbd3..30f031b20459 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/index.ts @@ -6,12 +6,4 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./policyTrackedResources"; export * from "./remediations"; -export * from "./policyEvents"; -export * from "./policyStates"; -export * from "./policyMetadataOperations"; -export * from "./policyRestrictions"; -export * from "./componentPolicyStates"; -export * from "./operations"; -export * from "./attestations"; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts deleted file mode 100644 index e9b279e4f4c5..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/operations.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - OperationsListOptionalParams, - OperationsListResponse -} from "../models"; - -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Lists available operations. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.PolicyInsights/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationsListResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts deleted file mode 100644 index 1202d36e4886..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyEvents.ts +++ /dev/null @@ -1,1619 +0,0 @@ -/* - * 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 { PolicyEvents } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - PolicyEvent, - PolicyEventsResourceType, - PolicyEventsListQueryResultsForManagementGroupNextOptionalParams, - PolicyEventsListQueryResultsForManagementGroupOptionalParams, - PolicyEventsListQueryResultsForManagementGroupResponse, - PolicyEventsListQueryResultsForSubscriptionNextOptionalParams, - PolicyEventsListQueryResultsForSubscriptionOptionalParams, - PolicyEventsListQueryResultsForSubscriptionResponse, - PolicyEventsListQueryResultsForResourceGroupNextOptionalParams, - PolicyEventsListQueryResultsForResourceGroupOptionalParams, - PolicyEventsListQueryResultsForResourceGroupResponse, - PolicyEventsListQueryResultsForResourceNextOptionalParams, - PolicyEventsListQueryResultsForResourceOptionalParams, - PolicyEventsListQueryResultsForResourceResponse, - PolicyEventsListQueryResultsForPolicySetDefinitionNextOptionalParams, - PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams, - PolicyEventsListQueryResultsForPolicySetDefinitionResponse, - PolicyEventsListQueryResultsForPolicyDefinitionNextOptionalParams, - PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams, - PolicyEventsListQueryResultsForPolicyDefinitionResponse, - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams, - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse, - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams, - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse, - PolicyEventsListQueryResultsForManagementGroupNextResponse, - PolicyEventsListQueryResultsForSubscriptionNextResponse, - PolicyEventsListQueryResultsForResourceGroupNextResponse, - PolicyEventsListQueryResultsForResourceNextResponse, - PolicyEventsListQueryResultsForPolicySetDefinitionNextResponse, - PolicyEventsListQueryResultsForPolicyDefinitionNextResponse, - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse, - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse -} from "../models"; - -/// -/** Class containing PolicyEvents operations. */ -export class PolicyEventsImpl implements PolicyEvents { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class PolicyEvents class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Queries policy events for the resources under the management group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - public listQueryResultsForManagementGroup( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForManagementGroupPagingAll( - policyEventsResource, - managementGroupName, - 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.listQueryResultsForManagementGroupPagingPage( - policyEventsResource, - managementGroupName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForManagementGroupPagingPage( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForManagementGroup( - policyEventsResource, - managementGroupName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForManagementGroupNext( - policyEventsResource, - managementGroupName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForManagementGroupPagingAll( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForManagementGroupPagingPage( - policyEventsResource, - managementGroupName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the resources under the subscription. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - public listQueryResultsForSubscription( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForSubscriptionPagingAll( - policyEventsResource, - subscriptionId, - 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.listQueryResultsForSubscriptionPagingPage( - policyEventsResource, - subscriptionId, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForSubscriptionPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForSubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForSubscription( - policyEventsResource, - subscriptionId, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForSubscriptionNext( - policyEventsResource, - subscriptionId, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForSubscriptionPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForSubscriptionPagingPage( - policyEventsResource, - subscriptionId, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the resources under the resource group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - public listQueryResultsForResourceGroup( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourceGroupPagingAll( - policyEventsResource, - subscriptionId, - resourceGroupName, - 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.listQueryResultsForResourceGroupPagingPage( - policyEventsResource, - subscriptionId, - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourceGroupPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResourceGroup( - policyEventsResource, - subscriptionId, - resourceGroupName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceGroupNext( - policyEventsResource, - subscriptionId, - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourceGroupPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourceGroupPagingPage( - policyEventsResource, - subscriptionId, - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the resource. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - public listQueryResultsForResource( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - options?: PolicyEventsListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourcePagingAll( - policyEventsResource, - resourceId, - 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.listQueryResultsForResourcePagingPage( - policyEventsResource, - resourceId, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourcePagingPage( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - options?: PolicyEventsListQueryResultsForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResource( - policyEventsResource, - resourceId, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceNext( - policyEventsResource, - resourceId, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourcePagingAll( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - options?: PolicyEventsListQueryResultsForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourcePagingPage( - policyEventsResource, - resourceId, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the subscription level policy set definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - public listQueryResultsForPolicySetDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForPolicySetDefinitionPagingAll( - policyEventsResource, - subscriptionId, - policySetDefinitionName, - 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.listQueryResultsForPolicySetDefinitionPagingPage( - policyEventsResource, - subscriptionId, - policySetDefinitionName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForPolicySetDefinitionPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForPolicySetDefinitionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForPolicySetDefinition( - policyEventsResource, - subscriptionId, - policySetDefinitionName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForPolicySetDefinitionNext( - policyEventsResource, - subscriptionId, - policySetDefinitionName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForPolicySetDefinitionPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForPolicySetDefinitionPagingPage( - policyEventsResource, - subscriptionId, - policySetDefinitionName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the subscription level policy definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - public listQueryResultsForPolicyDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForPolicyDefinitionPagingAll( - policyEventsResource, - subscriptionId, - policyDefinitionName, - 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.listQueryResultsForPolicyDefinitionPagingPage( - policyEventsResource, - subscriptionId, - policyDefinitionName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForPolicyDefinitionPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForPolicyDefinitionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForPolicyDefinition( - policyEventsResource, - subscriptionId, - policyDefinitionName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForPolicyDefinitionNext( - policyEventsResource, - subscriptionId, - policyDefinitionName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForPolicyDefinitionPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForPolicyDefinitionPagingPage( - policyEventsResource, - subscriptionId, - policyDefinitionName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the subscription level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - public listQueryResultsForSubscriptionLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingAll( - policyEventsResource, - subscriptionId, - policyAssignmentName, - 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.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyEventsResource, - subscriptionId, - policyAssignmentName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForSubscriptionLevelPolicyAssignment( - policyEventsResource, - subscriptionId, - policyAssignmentName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForSubscriptionLevelPolicyAssignmentNext( - policyEventsResource, - subscriptionId, - policyAssignmentName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForSubscriptionLevelPolicyAssignmentPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyEventsResource, - subscriptionId, - policyAssignmentName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the resource group level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - public listQueryResultsForResourceGroupLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingAll( - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - 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.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResourceGroupLevelPolicyAssignment( - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceGroupLevelPolicyAssignmentNext( - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourceGroupLevelPolicyAssignmentPagingAll( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - )) { - yield* page; - } - } - - /** - * Queries policy events for the resources under the management group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroup( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, managementGroupName, options }, - listQueryResultsForManagementGroupOperationSpec - ); - } - - /** - * Queries policy events for the resources under the subscription. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - private _listQueryResultsForSubscription( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, subscriptionId, options }, - listQueryResultsForSubscriptionOperationSpec - ); - } - - /** - * Queries policy events for the resources under the resource group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroup( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, subscriptionId, resourceGroupName, options }, - listQueryResultsForResourceGroupOperationSpec - ); - } - - /** - * Queries policy events for the resource. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - private _listQueryResultsForResource( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - options?: PolicyEventsListQueryResultsForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, resourceId, options }, - listQueryResultsForResourceOperationSpec - ); - } - - /** - * Queries policy events for the subscription level policy set definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - private _listQueryResultsForPolicySetDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - policySetDefinitionName, - options - }, - listQueryResultsForPolicySetDefinitionOperationSpec - ); - } - - /** - * Queries policy events for the subscription level policy definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - private _listQueryResultsForPolicyDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, subscriptionId, policyDefinitionName, options }, - listQueryResultsForPolicyDefinitionOperationSpec - ); - } - - /** - * Queries policy events for the subscription level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { policyEventsResource, subscriptionId, policyAssignmentName, options }, - listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec - ); - } - - /** - * Queries policy events for the resource group level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - }, - listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec - ); - } - - /** - * ListQueryResultsForManagementGroupNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param managementGroupName Management group name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForManagementGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroupNext( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForManagementGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, managementGroupName, nextLink, options }, - listQueryResultsForManagementGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForSubscriptionNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForSubscription method. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForSubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, subscriptionId, nextLink, options }, - listQueryResultsForSubscriptionNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceGroupNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForResourceGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - resourceGroupName, - nextLink, - options - }, - listQueryResultsForResourceGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param resourceId Resource ID. - * @param nextLink The nextLink from the previous successful call to the ListQueryResultsForResource - * method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceNext( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyEventsResource, resourceId, nextLink, options }, - listQueryResultsForResourceNextOperationSpec - ); - } - - /** - * ListQueryResultsForPolicySetDefinitionNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForPolicySetDefinition method. - * @param options The options parameters. - */ - private _listQueryResultsForPolicySetDefinitionNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - policySetDefinitionName, - nextLink, - options - }, - listQueryResultsForPolicySetDefinitionNextOperationSpec - ); - } - - /** - * ListQueryResultsForPolicyDefinitionNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForPolicyDefinition method. - * @param options The options parameters. - */ - private _listQueryResultsForPolicyDefinitionNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - policyDefinitionName, - nextLink, - options - }, - listQueryResultsForPolicyDefinitionNextOperationSpec - ); - } - - /** - * ListQueryResultsForSubscriptionLevelPolicyAssignmentNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForSubscriptionLevelPolicyAssignment method. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionLevelPolicyAssignmentNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams - ): Promise< - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse - > { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - policyAssignmentName, - nextLink, - options - }, - listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceGroupLevelPolicyAssignmentNext - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForResourceGroupLevelPolicyAssignment method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupLevelPolicyAssignmentNext( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - nextLink: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams - ): Promise< - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse - > { - return this.client.sendOperationRequest( - { - policyEventsResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - nextLink, - options - }, - listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listQueryResultsForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.policyEventsResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.policyEventsResource, - Parameters.subscriptionId1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.policyEventsResource, - Parameters.subscriptionId1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.policyEventsResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicySetDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policySetDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicyDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.nextLink, - Parameters.policyEventsResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.nextLink, - Parameters.policyEventsResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicySetDefinitionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policySetDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicyDefinitionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyEventsQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.policyEventsResource, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts deleted file mode 100644 index 0e695be0242e..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyMetadataOperations.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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 { PolicyMetadataOperations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - SlimPolicyMetadata, - PolicyMetadataListNextOptionalParams, - PolicyMetadataListOptionalParams, - PolicyMetadataListResponse, - PolicyMetadataGetResourceOptionalParams, - PolicyMetadataGetResourceResponse, - PolicyMetadataListNextResponse -} from "../models"; - -/// -/** Class containing PolicyMetadataOperations operations. */ -export class PolicyMetadataOperationsImpl implements PolicyMetadataOperations { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class PolicyMetadataOperations class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Get a list of the policy metadata resources. - * @param options The options parameters. - */ - public list( - options?: PolicyMetadataListOptionalParams - ): 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?: PolicyMetadataListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyMetadataListResponse; - 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?: PolicyMetadataListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Get policy metadata resource. - * @param resourceName The name of the policy metadata resource. - * @param options The options parameters. - */ - getResource( - resourceName: string, - options?: PolicyMetadataGetResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceName, options }, - getResourceOperationSpec - ); - } - - /** - * Get a list of the policy metadata resources. - * @param options The options parameters. - */ - private _list( - options?: PolicyMetadataListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: PolicyMetadataListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getResourceOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.PolicyInsights/policyMetadata/{resourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyMetadata - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.resourceName], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.PolicyInsights/policyMetadata", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyMetadataCollection - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - queryParameters: [Parameters.top, Parameters.apiVersion2], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyMetadataCollection - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts deleted file mode 100644 index d9577202edff..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyRestrictions.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 { PolicyRestrictions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - CheckRestrictionsRequest, - PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams, - PolicyRestrictionsCheckAtSubscriptionScopeResponse, - PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams, - PolicyRestrictionsCheckAtResourceGroupScopeResponse, - CheckManagementGroupRestrictionsRequest, - PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams, - PolicyRestrictionsCheckAtManagementGroupScopeResponse -} from "../models"; - -/** Class containing PolicyRestrictions operations. */ -export class PolicyRestrictionsImpl implements PolicyRestrictions { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class PolicyRestrictions class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Checks what restrictions Azure Policy will place on a resource within a subscription. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtSubscriptionScope( - parameters: CheckRestrictionsRequest, - options?: PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { parameters, options }, - checkAtSubscriptionScopeOperationSpec - ); - } - - /** - * Checks what restrictions Azure Policy will place on a resource within a resource group. Use this - * when the resource group the resource will be created in is already known. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtResourceGroupScope( - resourceGroupName: string, - parameters: CheckRestrictionsRequest, - options?: PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, parameters, options }, - checkAtResourceGroupScopeOperationSpec - ); - } - - /** - * Checks what restrictions Azure Policy will place on resources within a management group. - * @param managementGroupId Management group ID. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtManagementGroupScope( - managementGroupId: string, - parameters: CheckManagementGroupRestrictionsRequest, - options?: PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, parameters, options }, - checkAtManagementGroupScopeOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const checkAtSubscriptionScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CheckRestrictionsResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const checkAtResourceGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CheckRestrictionsResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1 - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const checkAtManagementGroupScopeOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CheckRestrictionsResult - }, - default: { - bodyMapper: Mappers.ErrorResponseAutoGenerated - } - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupId - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts deleted file mode 100644 index b2e860fe2da7..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyStates.ts +++ /dev/null @@ -1,2286 +0,0 @@ -/* - * 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 { PolicyStates } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - PolicyState, - PolicyStatesResource, - PolicyStatesListQueryResultsForManagementGroupNextOptionalParams, - PolicyStatesListQueryResultsForManagementGroupOptionalParams, - PolicyStatesListQueryResultsForManagementGroupResponse, - PolicyStatesListQueryResultsForSubscriptionNextOptionalParams, - PolicyStatesListQueryResultsForSubscriptionOptionalParams, - PolicyStatesListQueryResultsForSubscriptionResponse, - PolicyStatesListQueryResultsForResourceGroupNextOptionalParams, - PolicyStatesListQueryResultsForResourceGroupOptionalParams, - PolicyStatesListQueryResultsForResourceGroupResponse, - PolicyStatesListQueryResultsForResourceNextOptionalParams, - PolicyStatesListQueryResultsForResourceOptionalParams, - PolicyStatesListQueryResultsForResourceResponse, - PolicyStatesListQueryResultsForPolicySetDefinitionNextOptionalParams, - PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams, - PolicyStatesListQueryResultsForPolicySetDefinitionResponse, - PolicyStatesListQueryResultsForPolicyDefinitionNextOptionalParams, - PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, - PolicyStatesListQueryResultsForPolicyDefinitionResponse, - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams, - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse, - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams, - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse, - PolicyStatesSummaryResourceType, - PolicyStatesSummarizeForManagementGroupOptionalParams, - PolicyStatesSummarizeForManagementGroupResponse, - PolicyStatesSummarizeForSubscriptionOptionalParams, - PolicyStatesSummarizeForSubscriptionResponse, - PolicyStatesSummarizeForResourceGroupOptionalParams, - PolicyStatesSummarizeForResourceGroupResponse, - PolicyStatesSummarizeForResourceOptionalParams, - PolicyStatesSummarizeForResourceResponse, - PolicyStatesTriggerSubscriptionEvaluationOptionalParams, - PolicyStatesTriggerResourceGroupEvaluationOptionalParams, - PolicyStatesSummarizeForPolicySetDefinitionOptionalParams, - PolicyStatesSummarizeForPolicySetDefinitionResponse, - PolicyStatesSummarizeForPolicyDefinitionOptionalParams, - PolicyStatesSummarizeForPolicyDefinitionResponse, - PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse, - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams, - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse, - PolicyStatesListQueryResultsForManagementGroupNextResponse, - PolicyStatesListQueryResultsForSubscriptionNextResponse, - PolicyStatesListQueryResultsForResourceGroupNextResponse, - PolicyStatesListQueryResultsForResourceNextResponse, - PolicyStatesListQueryResultsForPolicySetDefinitionNextResponse, - PolicyStatesListQueryResultsForPolicyDefinitionNextResponse, - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse, - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse -} from "../models"; - -/// -/** Class containing PolicyStates operations. */ -export class PolicyStatesImpl implements PolicyStates { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class PolicyStates class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Queries policy states for the resources under the management group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - public listQueryResultsForManagementGroup( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForManagementGroupPagingAll( - policyStatesResource, - managementGroupName, - 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.listQueryResultsForManagementGroupPagingPage( - policyStatesResource, - managementGroupName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForManagementGroupPagingPage( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForManagementGroup( - policyStatesResource, - managementGroupName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForManagementGroupNext( - policyStatesResource, - managementGroupName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForManagementGroupPagingAll( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForManagementGroupPagingPage( - policyStatesResource, - managementGroupName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the resources under the subscription. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - public listQueryResultsForSubscription( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForSubscriptionPagingAll( - policyStatesResource, - subscriptionId, - 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.listQueryResultsForSubscriptionPagingPage( - policyStatesResource, - subscriptionId, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForSubscriptionPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForSubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForSubscription( - policyStatesResource, - subscriptionId, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForSubscriptionNext( - policyStatesResource, - subscriptionId, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForSubscriptionPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForSubscriptionPagingPage( - policyStatesResource, - subscriptionId, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the resources under the resource group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - public listQueryResultsForResourceGroup( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourceGroupPagingAll( - policyStatesResource, - subscriptionId, - resourceGroupName, - 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.listQueryResultsForResourceGroupPagingPage( - policyStatesResource, - subscriptionId, - resourceGroupName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourceGroupPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResourceGroup( - policyStatesResource, - subscriptionId, - resourceGroupName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceGroupNext( - policyStatesResource, - subscriptionId, - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourceGroupPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourceGroupPagingPage( - policyStatesResource, - subscriptionId, - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the resource. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param resourceId Resource ID. - * @param options The options parameters. - */ - public listQueryResultsForResource( - policyStatesResource: PolicyStatesResource, - resourceId: string, - options?: PolicyStatesListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourcePagingAll( - policyStatesResource, - resourceId, - 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.listQueryResultsForResourcePagingPage( - policyStatesResource, - resourceId, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourcePagingPage( - policyStatesResource: PolicyStatesResource, - resourceId: string, - options?: PolicyStatesListQueryResultsForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResource( - policyStatesResource, - resourceId, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceNext( - policyStatesResource, - resourceId, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourcePagingAll( - policyStatesResource: PolicyStatesResource, - resourceId: string, - options?: PolicyStatesListQueryResultsForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourcePagingPage( - policyStatesResource, - resourceId, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the subscription level policy set definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - public listQueryResultsForPolicySetDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForPolicySetDefinitionPagingAll( - policyStatesResource, - subscriptionId, - policySetDefinitionName, - 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.listQueryResultsForPolicySetDefinitionPagingPage( - policyStatesResource, - subscriptionId, - policySetDefinitionName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForPolicySetDefinitionPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForPolicySetDefinitionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForPolicySetDefinition( - policyStatesResource, - subscriptionId, - policySetDefinitionName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForPolicySetDefinitionNext( - policyStatesResource, - subscriptionId, - policySetDefinitionName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForPolicySetDefinitionPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForPolicySetDefinitionPagingPage( - policyStatesResource, - subscriptionId, - policySetDefinitionName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the subscription level policy definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - public listQueryResultsForPolicyDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForPolicyDefinitionPagingAll( - policyStatesResource, - subscriptionId, - policyDefinitionName, - 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.listQueryResultsForPolicyDefinitionPagingPage( - policyStatesResource, - subscriptionId, - policyDefinitionName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForPolicyDefinitionPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForPolicyDefinitionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForPolicyDefinition( - policyStatesResource, - subscriptionId, - policyDefinitionName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForPolicyDefinitionNext( - policyStatesResource, - subscriptionId, - policyDefinitionName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForPolicyDefinitionPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForPolicyDefinitionPagingPage( - policyStatesResource, - subscriptionId, - policyDefinitionName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the subscription level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - public listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingAll( - policyStatesResource, - subscriptionId, - policyAssignmentName, - 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.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyStatesResource, - subscriptionId, - policyAssignmentName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource, - subscriptionId, - policyAssignmentName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForSubscriptionLevelPolicyAssignmentNext( - policyStatesResource, - subscriptionId, - policyAssignmentName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForSubscriptionLevelPolicyAssignmentPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForSubscriptionLevelPolicyAssignmentPagingPage( - policyStatesResource, - subscriptionId, - policyAssignmentName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the resource group level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - public listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingAll( - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - 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.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - ); - let page = result.value || []; - continuationToken = result.odataNextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceGroupLevelPolicyAssignmentNext( - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - continuationToken, - options - ); - continuationToken = result.odataNextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourceGroupLevelPolicyAssignmentPagingAll( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourceGroupLevelPolicyAssignmentPagingPage( - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - )) { - yield* page; - } - } - - /** - * Queries policy states for the resources under the management group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroup( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, managementGroupName, options }, - listQueryResultsForManagementGroupOperationSpec - ); - } - - /** - * Summarizes policy states for the resources under the management group. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - summarizeForManagementGroup( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - managementGroupName: string, - options?: PolicyStatesSummarizeForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesSummaryResource, managementGroupName, options }, - summarizeForManagementGroupOperationSpec - ); - } - - /** - * Queries policy states for the resources under the subscription. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - private _listQueryResultsForSubscription( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, subscriptionId, options }, - listQueryResultsForSubscriptionOperationSpec - ); - } - - /** - * Summarizes policy states for the resources under the subscription. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - summarizeForSubscription( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - options?: PolicyStatesSummarizeForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesSummaryResource, subscriptionId, options }, - summarizeForSubscriptionOperationSpec - ); - } - - /** - * Queries policy states for the resources under the resource group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroup( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, subscriptionId, resourceGroupName, options }, - listQueryResultsForResourceGroupOperationSpec - ); - } - - /** - * Summarizes policy states for the resources under the resource group. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - summarizeForResourceGroup( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesSummarizeForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesSummaryResource, - subscriptionId, - resourceGroupName, - options - }, - summarizeForResourceGroupOperationSpec - ); - } - - /** - * Queries policy states for the resource. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param resourceId Resource ID. - * @param options The options parameters. - */ - private _listQueryResultsForResource( - policyStatesResource: PolicyStatesResource, - resourceId: string, - options?: PolicyStatesListQueryResultsForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, resourceId, options }, - listQueryResultsForResourceOperationSpec - ); - } - - /** - * Summarizes policy states for the resource. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - summarizeForResource( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - resourceId: string, - options?: PolicyStatesSummarizeForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesSummaryResource, resourceId, options }, - summarizeForResourceOperationSpec - ); - } - - /** - * Triggers a policy evaluation scan for all the resources under the subscription - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - async beginTriggerSubscriptionEvaluation( - subscriptionId: string, - options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { subscriptionId, options }, - triggerSubscriptionEvaluationOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Triggers a policy evaluation scan for all the resources under the subscription - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - async beginTriggerSubscriptionEvaluationAndWait( - subscriptionId: string, - options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams - ): Promise { - const poller = await this.beginTriggerSubscriptionEvaluation( - subscriptionId, - options - ); - return poller.pollUntilDone(); - } - - /** - * Triggers a policy evaluation scan for all the resources under the resource group. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - async beginTriggerResourceGroupEvaluation( - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { subscriptionId, resourceGroupName, options }, - triggerResourceGroupEvaluationOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Triggers a policy evaluation scan for all the resources under the resource group. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - async beginTriggerResourceGroupEvaluationAndWait( - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams - ): Promise { - const poller = await this.beginTriggerResourceGroupEvaluation( - subscriptionId, - resourceGroupName, - options - ); - return poller.pollUntilDone(); - } - - /** - * Queries policy states for the subscription level policy set definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - private _listQueryResultsForPolicySetDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - policySetDefinitionName, - options - }, - listQueryResultsForPolicySetDefinitionOperationSpec - ); - } - - /** - * Summarizes policy states for the subscription level policy set definition. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - summarizeForPolicySetDefinition( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesSummarizeForPolicySetDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesSummaryResource, - subscriptionId, - policySetDefinitionName, - options - }, - summarizeForPolicySetDefinitionOperationSpec - ); - } - - /** - * Queries policy states for the subscription level policy definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - private _listQueryResultsForPolicyDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, subscriptionId, policyDefinitionName, options }, - listQueryResultsForPolicyDefinitionOperationSpec - ); - } - - /** - * Summarizes policy states for the subscription level policy definition. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - summarizeForPolicyDefinition( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesSummarizeForPolicyDefinitionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesSummaryResource, - subscriptionId, - policyDefinitionName, - options - }, - summarizeForPolicyDefinitionOperationSpec - ); - } - - /** - * Queries policy states for the subscription level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { policyStatesResource, subscriptionId, policyAssignmentName, options }, - listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec - ); - } - - /** - * Summarizes policy states for the subscription level policy assignment. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - summarizeForSubscriptionLevelPolicyAssignment( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - policyStatesSummaryResource, - subscriptionId, - policyAssignmentName, - options - }, - summarizeForSubscriptionLevelPolicyAssignmentOperationSpec - ); - } - - /** - * Queries policy states for the resource group level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - }, - listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec - ); - } - - /** - * Summarizes policy states for the resource group level policy assignment. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - summarizeForResourceGroupLevelPolicyAssignment( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse - > { - return this.client.sendOperationRequest( - { - policyStatesSummaryResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - options - }, - summarizeForResourceGroupLevelPolicyAssignmentOperationSpec - ); - } - - /** - * ListQueryResultsForManagementGroupNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param managementGroupName Management group name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForManagementGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroupNext( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForManagementGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, managementGroupName, nextLink, options }, - listQueryResultsForManagementGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForSubscriptionNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForSubscription method. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForSubscriptionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, subscriptionId, nextLink, options }, - listQueryResultsForSubscriptionNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceGroupNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForResourceGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - resourceGroupName, - nextLink, - options - }, - listQueryResultsForResourceGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param resourceId Resource ID. - * @param nextLink The nextLink from the previous successful call to the ListQueryResultsForResource - * method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceNext( - policyStatesResource: PolicyStatesResource, - resourceId: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyStatesResource, resourceId, nextLink, options }, - listQueryResultsForResourceNextOperationSpec - ); - } - - /** - * ListQueryResultsForPolicySetDefinitionNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForPolicySetDefinition method. - * @param options The options parameters. - */ - private _listQueryResultsForPolicySetDefinitionNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - policySetDefinitionName, - nextLink, - options - }, - listQueryResultsForPolicySetDefinitionNextOperationSpec - ); - } - - /** - * ListQueryResultsForPolicyDefinitionNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForPolicyDefinition method. - * @param options The options parameters. - */ - private _listQueryResultsForPolicyDefinitionNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - policyDefinitionName, - nextLink, - options - }, - listQueryResultsForPolicyDefinitionNextOperationSpec - ); - } - - /** - * ListQueryResultsForSubscriptionLevelPolicyAssignmentNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForSubscriptionLevelPolicyAssignment method. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionLevelPolicyAssignmentNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextOptionalParams - ): Promise< - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentNextResponse - > { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - policyAssignmentName, - nextLink, - options - }, - listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceGroupLevelPolicyAssignmentNext - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForResourceGroupLevelPolicyAssignment method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupLevelPolicyAssignmentNext( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - nextLink: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextOptionalParams - ): Promise< - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentNextResponse - > { - return this.client.sendOperationRequest( - { - policyStatesResource, - subscriptionId, - resourceGroupName, - policyAssignmentName, - nextLink, - options - }, - listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listQueryResultsForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const triggerSubscriptionEvaluationOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [Parameters.$host, Parameters.subscriptionId1], - headerParameters: [Parameters.accept], - serializer -}; -const triggerResourceGroupEvaluationOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.apiVersion2], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1 - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicySetDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policySetDefinitionName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForPolicySetDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policySetDefinitionName, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicyDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyDefinitionName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForPolicyDefinitionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyDefinitionName, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForSubscriptionLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.orderBy, - Parameters.select, - Parameters.from, - Parameters.to, - Parameters.apply, - Parameters.skipToken - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const summarizeForResourceGroupLevelPolicyAssignmentOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SummarizeResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [ - Parameters.top, - Parameters.filter, - Parameters.apiVersion2, - Parameters.from, - Parameters.to - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesSummaryResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.nextLink, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceId, - Parameters.nextLink, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicySetDefinitionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policySetDefinitionName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForPolicyDefinitionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyDefinitionName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionLevelPolicyAssignmentNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupLevelPolicyAssignmentNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyStatesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.subscriptionId1, - Parameters.authorizationNamespace, - Parameters.policyAssignmentName, - Parameters.policyStatesResource - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts b/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts deleted file mode 100644 index 2e69a484d9a2..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operations/policyTrackedResources.ts +++ /dev/null @@ -1,714 +0,0 @@ -/* - * 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 { PolicyTrackedResources } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { PolicyInsightsClient } from "../policyInsightsClient"; -import { - PolicyTrackedResource, - PolicyTrackedResourcesResourceType, - PolicyTrackedResourcesListQueryResultsForManagementGroupNextOptionalParams, - PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams, - PolicyTrackedResourcesListQueryResultsForManagementGroupResponse, - PolicyTrackedResourcesListQueryResultsForSubscriptionNextOptionalParams, - PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams, - PolicyTrackedResourcesListQueryResultsForSubscriptionResponse, - PolicyTrackedResourcesListQueryResultsForResourceGroupNextOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceGroupResponse, - PolicyTrackedResourcesListQueryResultsForResourceNextOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceResponse, - PolicyTrackedResourcesListQueryResultsForManagementGroupNextResponse, - PolicyTrackedResourcesListQueryResultsForSubscriptionNextResponse, - PolicyTrackedResourcesListQueryResultsForResourceGroupNextResponse, - PolicyTrackedResourcesListQueryResultsForResourceNextResponse -} from "../models"; - -/// -/** Class containing PolicyTrackedResources operations. */ -export class PolicyTrackedResourcesImpl implements PolicyTrackedResources { - private readonly client: PolicyInsightsClient; - - /** - * Initialize a new instance of the class PolicyTrackedResources class. - * @param client Reference to the service client - */ - constructor(client: PolicyInsightsClient) { - this.client = client; - } - - /** - * Queries policy tracked resources under the management group. - * @param managementGroupName Management group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - public listQueryResultsForManagementGroup( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForManagementGroupPagingAll( - managementGroupName, - policyTrackedResourcesResource, - 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.listQueryResultsForManagementGroupPagingPage( - managementGroupName, - policyTrackedResourcesResource, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForManagementGroupPagingPage( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyTrackedResourcesListQueryResultsForManagementGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForManagementGroup( - managementGroupName, - policyTrackedResourcesResource, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForManagementGroupNext( - managementGroupName, - policyTrackedResourcesResource, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForManagementGroupPagingAll( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForManagementGroupPagingPage( - managementGroupName, - policyTrackedResourcesResource, - options - )) { - yield* page; - } - } - - /** - * Queries policy tracked resources under the subscription. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - public listQueryResultsForSubscription( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForSubscriptionPagingAll( - policyTrackedResourcesResource, - 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.listQueryResultsForSubscriptionPagingPage( - policyTrackedResourcesResource, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForSubscriptionPagingPage( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyTrackedResourcesListQueryResultsForSubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForSubscription( - policyTrackedResourcesResource, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForSubscriptionNext( - policyTrackedResourcesResource, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForSubscriptionPagingAll( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForSubscriptionPagingPage( - policyTrackedResourcesResource, - options - )) { - yield* page; - } - } - - /** - * Queries policy tracked resources under the resource group. - * @param resourceGroupName Resource group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - public listQueryResultsForResourceGroup( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourceGroupPagingAll( - resourceGroupName, - policyTrackedResourcesResource, - 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.listQueryResultsForResourceGroupPagingPage( - resourceGroupName, - policyTrackedResourcesResource, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourceGroupPagingPage( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyTrackedResourcesListQueryResultsForResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResourceGroup( - resourceGroupName, - policyTrackedResourcesResource, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceGroupNext( - resourceGroupName, - policyTrackedResourcesResource, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourceGroupPagingAll( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourceGroupPagingPage( - resourceGroupName, - policyTrackedResourcesResource, - options - )) { - yield* page; - } - } - - /** - * Queries policy tracked resources under the resource. - * @param resourceId Resource ID. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - public listQueryResultsForResource( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listQueryResultsForResourcePagingAll( - resourceId, - policyTrackedResourcesResource, - 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.listQueryResultsForResourcePagingPage( - resourceId, - policyTrackedResourcesResource, - options, - settings - ); - } - }; - } - - private async *listQueryResultsForResourcePagingPage( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: PolicyTrackedResourcesListQueryResultsForResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listQueryResultsForResource( - resourceId, - policyTrackedResourcesResource, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listQueryResultsForResourceNext( - resourceId, - policyTrackedResourcesResource, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listQueryResultsForResourcePagingAll( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listQueryResultsForResourcePagingPage( - resourceId, - policyTrackedResourcesResource, - options - )) { - yield* page; - } - } - - /** - * Queries policy tracked resources under the management group. - * @param managementGroupName Management group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroup( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { managementGroupName, policyTrackedResourcesResource, options }, - listQueryResultsForManagementGroupOperationSpec - ); - } - - /** - * Queries policy tracked resources under the subscription. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - private _listQueryResultsForSubscription( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { policyTrackedResourcesResource, options }, - listQueryResultsForSubscriptionOperationSpec - ); - } - - /** - * Queries policy tracked resources under the resource group. - * @param resourceGroupName Resource group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroup( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, policyTrackedResourcesResource, options }, - listQueryResultsForResourceGroupOperationSpec - ); - } - - /** - * Queries policy tracked resources under the resource. - * @param resourceId Resource ID. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - private _listQueryResultsForResource( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, policyTrackedResourcesResource, options }, - listQueryResultsForResourceOperationSpec - ); - } - - /** - * ListQueryResultsForManagementGroupNext - * @param managementGroupName Management group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForManagementGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForManagementGroupNext( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - nextLink: string, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupNextOptionalParams - ): Promise< - PolicyTrackedResourcesListQueryResultsForManagementGroupNextResponse - > { - return this.client.sendOperationRequest( - { - managementGroupName, - policyTrackedResourcesResource, - nextLink, - options - }, - listQueryResultsForManagementGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForSubscriptionNext - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForSubscription method. - * @param options The options parameters. - */ - private _listQueryResultsForSubscriptionNext( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - nextLink: string, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionNextOptionalParams - ): Promise< - PolicyTrackedResourcesListQueryResultsForSubscriptionNextResponse - > { - return this.client.sendOperationRequest( - { policyTrackedResourcesResource, nextLink, options }, - listQueryResultsForSubscriptionNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceGroupNext - * @param resourceGroupName Resource group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param nextLink The nextLink from the previous successful call to the - * ListQueryResultsForResourceGroup method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceGroupNext( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - nextLink: string, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupNextOptionalParams - ): Promise< - PolicyTrackedResourcesListQueryResultsForResourceGroupNextResponse - > { - return this.client.sendOperationRequest( - { resourceGroupName, policyTrackedResourcesResource, nextLink, options }, - listQueryResultsForResourceGroupNextOperationSpec - ); - } - - /** - * ListQueryResultsForResourceNext - * @param resourceId Resource ID. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param nextLink The nextLink from the previous successful call to the ListQueryResultsForResource - * method. - * @param options The options parameters. - */ - private _listQueryResultsForResourceNext( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - nextLink: string, - options?: PolicyTrackedResourcesListQueryResultsForResourceNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceId, policyTrackedResourcesResource, nextLink, options }, - listQueryResultsForResourceNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listQueryResultsForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.policyTrackedResourcesResource - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.resourceId - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupName, - Parameters.policyTrackedResourcesResource, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listQueryResultsForResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PolicyTrackedResourcesQueryResults - }, - default: { - bodyMapper: Mappers.QueryFailure - } - }, - urlParameters: [ - Parameters.$host, - Parameters.policyTrackedResourcesResource, - Parameters.resourceId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts index 38f03a20bf0a..f59dc8a9440b 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operations/remediations.ts @@ -79,7 +79,7 @@ import { RemediationsListDeploymentsAtResourceGroupNextResponse, RemediationsListForResourceGroupNextResponse, RemediationsListDeploymentsAtResourceNextResponse, - RemediationsListForResourceNextResponse + RemediationsListForResourceNextResponse, } from "../models"; /// @@ -104,12 +104,12 @@ export class RemediationsImpl implements Remediations { public listDeploymentsAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsListDeploymentsAtManagementGroupOptionalParams + options?: RemediationsListDeploymentsAtManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listDeploymentsAtManagementGroupPagingAll( managementGroupId, remediationName, - options + options, ); return { next() { @@ -126,9 +126,9 @@ export class RemediationsImpl implements Remediations { managementGroupId, remediationName, options, - settings + settings, ); - } + }, }; } @@ -136,7 +136,7 @@ export class RemediationsImpl implements Remediations { managementGroupId: string, remediationName: string, options?: RemediationsListDeploymentsAtManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListDeploymentsAtManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -144,7 +144,7 @@ export class RemediationsImpl implements Remediations { result = await this._listDeploymentsAtManagementGroup( managementGroupId, remediationName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -156,7 +156,7 @@ export class RemediationsImpl implements Remediations { managementGroupId, remediationName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -168,12 +168,12 @@ export class RemediationsImpl implements Remediations { private async *listDeploymentsAtManagementGroupPagingAll( managementGroupId: string, remediationName: string, - options?: RemediationsListDeploymentsAtManagementGroupOptionalParams + options?: RemediationsListDeploymentsAtManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listDeploymentsAtManagementGroupPagingPage( managementGroupId, remediationName, - options + options, )) { yield* page; } @@ -186,11 +186,11 @@ export class RemediationsImpl implements Remediations { */ public listForManagementGroup( managementGroupId: string, - options?: RemediationsListForManagementGroupOptionalParams + options?: RemediationsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForManagementGroupPagingAll( managementGroupId, - options + options, ); return { next() { @@ -206,16 +206,16 @@ export class RemediationsImpl implements Remediations { return this.listForManagementGroupPagingPage( managementGroupId, options, - settings + settings, ); - } + }, }; } private async *listForManagementGroupPagingPage( managementGroupId: string, options?: RemediationsListForManagementGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListForManagementGroupResponse; let continuationToken = settings?.continuationToken; @@ -230,7 +230,7 @@ export class RemediationsImpl implements Remediations { result = await this._listForManagementGroupNext( managementGroupId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -241,11 +241,11 @@ export class RemediationsImpl implements Remediations { private async *listForManagementGroupPagingAll( managementGroupId: string, - options?: RemediationsListForManagementGroupOptionalParams + options?: RemediationsListForManagementGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForManagementGroupPagingPage( managementGroupId, - options + options, )) { yield* page; } @@ -258,11 +258,11 @@ export class RemediationsImpl implements Remediations { */ public listDeploymentsAtSubscription( remediationName: string, - options?: RemediationsListDeploymentsAtSubscriptionOptionalParams + options?: RemediationsListDeploymentsAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listDeploymentsAtSubscriptionPagingAll( remediationName, - options + options, ); return { next() { @@ -278,23 +278,23 @@ export class RemediationsImpl implements Remediations { return this.listDeploymentsAtSubscriptionPagingPage( remediationName, options, - settings + settings, ); - } + }, }; } private async *listDeploymentsAtSubscriptionPagingPage( remediationName: string, options?: RemediationsListDeploymentsAtSubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListDeploymentsAtSubscriptionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._listDeploymentsAtSubscription( remediationName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -305,7 +305,7 @@ export class RemediationsImpl implements Remediations { result = await this._listDeploymentsAtSubscriptionNext( remediationName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -316,11 +316,11 @@ export class RemediationsImpl implements Remediations { private async *listDeploymentsAtSubscriptionPagingAll( remediationName: string, - options?: RemediationsListDeploymentsAtSubscriptionOptionalParams + options?: RemediationsListDeploymentsAtSubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listDeploymentsAtSubscriptionPagingPage( remediationName, - options + options, )) { yield* page; } @@ -331,7 +331,7 @@ export class RemediationsImpl implements Remediations { * @param options The options parameters. */ public listForSubscription( - options?: RemediationsListForSubscriptionOptionalParams + options?: RemediationsListForSubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForSubscriptionPagingAll(options); return { @@ -346,13 +346,13 @@ export class RemediationsImpl implements Remediations { throw new Error("maxPageSize is not supported by this operation."); } return this.listForSubscriptionPagingPage(options, settings); - } + }, }; } private async *listForSubscriptionPagingPage( options?: RemediationsListForSubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListForSubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -373,7 +373,7 @@ export class RemediationsImpl implements Remediations { } private async *listForSubscriptionPagingAll( - options?: RemediationsListForSubscriptionOptionalParams + options?: RemediationsListForSubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForSubscriptionPagingPage(options)) { yield* page; @@ -389,12 +389,12 @@ export class RemediationsImpl implements Remediations { public listDeploymentsAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceGroupOptionalParams + options?: RemediationsListDeploymentsAtResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listDeploymentsAtResourceGroupPagingAll( resourceGroupName, remediationName, - options + options, ); return { next() { @@ -411,9 +411,9 @@ export class RemediationsImpl implements Remediations { resourceGroupName, remediationName, options, - settings + settings, ); - } + }, }; } @@ -421,7 +421,7 @@ export class RemediationsImpl implements Remediations { resourceGroupName: string, remediationName: string, options?: RemediationsListDeploymentsAtResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListDeploymentsAtResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -429,7 +429,7 @@ export class RemediationsImpl implements Remediations { result = await this._listDeploymentsAtResourceGroup( resourceGroupName, remediationName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -441,7 +441,7 @@ export class RemediationsImpl implements Remediations { resourceGroupName, remediationName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -453,12 +453,12 @@ export class RemediationsImpl implements Remediations { private async *listDeploymentsAtResourceGroupPagingAll( resourceGroupName: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceGroupOptionalParams + options?: RemediationsListDeploymentsAtResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listDeploymentsAtResourceGroupPagingPage( resourceGroupName, remediationName, - options + options, )) { yield* page; } @@ -471,7 +471,7 @@ export class RemediationsImpl implements Remediations { */ public listForResourceGroup( resourceGroupName: string, - options?: RemediationsListForResourceGroupOptionalParams + options?: RemediationsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourceGroupPagingAll(resourceGroupName, options); return { @@ -488,16 +488,16 @@ export class RemediationsImpl implements Remediations { return this.listForResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listForResourceGroupPagingPage( resourceGroupName: string, options?: RemediationsListForResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListForResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -512,7 +512,7 @@ export class RemediationsImpl implements Remediations { result = await this._listForResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -523,11 +523,11 @@ export class RemediationsImpl implements Remediations { private async *listForResourceGroupPagingAll( resourceGroupName: string, - options?: RemediationsListForResourceGroupOptionalParams + options?: RemediationsListForResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -542,12 +542,12 @@ export class RemediationsImpl implements Remediations { public listDeploymentsAtResource( resourceId: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceOptionalParams + options?: RemediationsListDeploymentsAtResourceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listDeploymentsAtResourcePagingAll( resourceId, remediationName, - options + options, ); return { next() { @@ -564,9 +564,9 @@ export class RemediationsImpl implements Remediations { resourceId, remediationName, options, - settings + settings, ); - } + }, }; } @@ -574,7 +574,7 @@ export class RemediationsImpl implements Remediations { resourceId: string, remediationName: string, options?: RemediationsListDeploymentsAtResourceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListDeploymentsAtResourceResponse; let continuationToken = settings?.continuationToken; @@ -582,7 +582,7 @@ export class RemediationsImpl implements Remediations { result = await this._listDeploymentsAtResource( resourceId, remediationName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -594,7 +594,7 @@ export class RemediationsImpl implements Remediations { resourceId, remediationName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -606,12 +606,12 @@ export class RemediationsImpl implements Remediations { private async *listDeploymentsAtResourcePagingAll( resourceId: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceOptionalParams + options?: RemediationsListDeploymentsAtResourceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listDeploymentsAtResourcePagingPage( resourceId, remediationName, - options + options, )) { yield* page; } @@ -624,7 +624,7 @@ export class RemediationsImpl implements Remediations { */ public listForResource( resourceId: string, - options?: RemediationsListForResourceOptionalParams + options?: RemediationsListForResourceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listForResourcePagingAll(resourceId, options); return { @@ -639,14 +639,14 @@ export class RemediationsImpl implements Remediations { throw new Error("maxPageSize is not supported by this operation."); } return this.listForResourcePagingPage(resourceId, options, settings); - } + }, }; } private async *listForResourcePagingPage( resourceId: string, options?: RemediationsListForResourceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: RemediationsListForResourceResponse; let continuationToken = settings?.continuationToken; @@ -661,7 +661,7 @@ export class RemediationsImpl implements Remediations { result = await this._listForResourceNext( resourceId, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -672,11 +672,11 @@ export class RemediationsImpl implements Remediations { private async *listForResourcePagingAll( resourceId: string, - options?: RemediationsListForResourceOptionalParams + options?: RemediationsListForResourceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listForResourcePagingPage( resourceId, - options + options, )) { yield* page; } @@ -691,11 +691,11 @@ export class RemediationsImpl implements Remediations { private _listDeploymentsAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsListDeploymentsAtManagementGroupOptionalParams + options?: RemediationsListDeploymentsAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, options }, - listDeploymentsAtManagementGroupOperationSpec + listDeploymentsAtManagementGroupOperationSpec, ); } @@ -708,11 +708,11 @@ export class RemediationsImpl implements Remediations { cancelAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsCancelAtManagementGroupOptionalParams + options?: RemediationsCancelAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, options }, - cancelAtManagementGroupOperationSpec + cancelAtManagementGroupOperationSpec, ); } @@ -723,11 +723,11 @@ export class RemediationsImpl implements Remediations { */ private _listForManagementGroup( managementGroupId: string, - options?: RemediationsListForManagementGroupOptionalParams + options?: RemediationsListForManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, - listForManagementGroupOperationSpec + listForManagementGroupOperationSpec, ); } @@ -742,11 +742,11 @@ export class RemediationsImpl implements Remediations { managementGroupId: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtManagementGroupOptionalParams + options?: RemediationsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, parameters, options }, - createOrUpdateAtManagementGroupOperationSpec + createOrUpdateAtManagementGroupOperationSpec, ); } @@ -759,11 +759,11 @@ export class RemediationsImpl implements Remediations { getAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsGetAtManagementGroupOptionalParams + options?: RemediationsGetAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, options }, - getAtManagementGroupOperationSpec + getAtManagementGroupOperationSpec, ); } @@ -776,11 +776,11 @@ export class RemediationsImpl implements Remediations { deleteAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsDeleteAtManagementGroupOptionalParams + options?: RemediationsDeleteAtManagementGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, options }, - deleteAtManagementGroupOperationSpec + deleteAtManagementGroupOperationSpec, ); } @@ -791,11 +791,11 @@ export class RemediationsImpl implements Remediations { */ private _listDeploymentsAtSubscription( remediationName: string, - options?: RemediationsListDeploymentsAtSubscriptionOptionalParams + options?: RemediationsListDeploymentsAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, options }, - listDeploymentsAtSubscriptionOperationSpec + listDeploymentsAtSubscriptionOperationSpec, ); } @@ -806,11 +806,11 @@ export class RemediationsImpl implements Remediations { */ cancelAtSubscription( remediationName: string, - options?: RemediationsCancelAtSubscriptionOptionalParams + options?: RemediationsCancelAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, options }, - cancelAtSubscriptionOperationSpec + cancelAtSubscriptionOperationSpec, ); } @@ -819,11 +819,11 @@ export class RemediationsImpl implements Remediations { * @param options The options parameters. */ private _listForSubscription( - options?: RemediationsListForSubscriptionOptionalParams + options?: RemediationsListForSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listForSubscriptionOperationSpec + listForSubscriptionOperationSpec, ); } @@ -836,11 +836,11 @@ export class RemediationsImpl implements Remediations { createOrUpdateAtSubscription( remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtSubscriptionOptionalParams + options?: RemediationsCreateOrUpdateAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, parameters, options }, - createOrUpdateAtSubscriptionOperationSpec + createOrUpdateAtSubscriptionOperationSpec, ); } @@ -851,11 +851,11 @@ export class RemediationsImpl implements Remediations { */ getAtSubscription( remediationName: string, - options?: RemediationsGetAtSubscriptionOptionalParams + options?: RemediationsGetAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, options }, - getAtSubscriptionOperationSpec + getAtSubscriptionOperationSpec, ); } @@ -866,11 +866,11 @@ export class RemediationsImpl implements Remediations { */ deleteAtSubscription( remediationName: string, - options?: RemediationsDeleteAtSubscriptionOptionalParams + options?: RemediationsDeleteAtSubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, options }, - deleteAtSubscriptionOperationSpec + deleteAtSubscriptionOperationSpec, ); } @@ -883,11 +883,11 @@ export class RemediationsImpl implements Remediations { private _listDeploymentsAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceGroupOptionalParams + options?: RemediationsListDeploymentsAtResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, options }, - listDeploymentsAtResourceGroupOperationSpec + listDeploymentsAtResourceGroupOperationSpec, ); } @@ -900,11 +900,11 @@ export class RemediationsImpl implements Remediations { cancelAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsCancelAtResourceGroupOptionalParams + options?: RemediationsCancelAtResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, options }, - cancelAtResourceGroupOperationSpec + cancelAtResourceGroupOperationSpec, ); } @@ -915,11 +915,11 @@ export class RemediationsImpl implements Remediations { */ private _listForResourceGroup( resourceGroupName: string, - options?: RemediationsListForResourceGroupOptionalParams + options?: RemediationsListForResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listForResourceGroupOperationSpec + listForResourceGroupOperationSpec, ); } @@ -934,11 +934,11 @@ export class RemediationsImpl implements Remediations { resourceGroupName: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtResourceGroupOptionalParams + options?: RemediationsCreateOrUpdateAtResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, parameters, options }, - createOrUpdateAtResourceGroupOperationSpec + createOrUpdateAtResourceGroupOperationSpec, ); } @@ -951,11 +951,11 @@ export class RemediationsImpl implements Remediations { getAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsGetAtResourceGroupOptionalParams + options?: RemediationsGetAtResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, options }, - getAtResourceGroupOperationSpec + getAtResourceGroupOperationSpec, ); } @@ -968,11 +968,11 @@ export class RemediationsImpl implements Remediations { deleteAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsDeleteAtResourceGroupOptionalParams + options?: RemediationsDeleteAtResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, options }, - deleteAtResourceGroupOperationSpec + deleteAtResourceGroupOperationSpec, ); } @@ -985,11 +985,11 @@ export class RemediationsImpl implements Remediations { private _listDeploymentsAtResource( resourceId: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceOptionalParams + options?: RemediationsListDeploymentsAtResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, options }, - listDeploymentsAtResourceOperationSpec + listDeploymentsAtResourceOperationSpec, ); } @@ -1002,11 +1002,11 @@ export class RemediationsImpl implements Remediations { cancelAtResource( resourceId: string, remediationName: string, - options?: RemediationsCancelAtResourceOptionalParams + options?: RemediationsCancelAtResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, options }, - cancelAtResourceOperationSpec + cancelAtResourceOperationSpec, ); } @@ -1017,11 +1017,11 @@ export class RemediationsImpl implements Remediations { */ private _listForResource( resourceId: string, - options?: RemediationsListForResourceOptionalParams + options?: RemediationsListForResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, options }, - listForResourceOperationSpec + listForResourceOperationSpec, ); } @@ -1036,11 +1036,11 @@ export class RemediationsImpl implements Remediations { resourceId: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtResourceOptionalParams + options?: RemediationsCreateOrUpdateAtResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, parameters, options }, - createOrUpdateAtResourceOperationSpec + createOrUpdateAtResourceOperationSpec, ); } @@ -1053,11 +1053,11 @@ export class RemediationsImpl implements Remediations { getAtResource( resourceId: string, remediationName: string, - options?: RemediationsGetAtResourceOptionalParams + options?: RemediationsGetAtResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, options }, - getAtResourceOperationSpec + getAtResourceOperationSpec, ); } @@ -1070,11 +1070,11 @@ export class RemediationsImpl implements Remediations { deleteAtResource( resourceId: string, remediationName: string, - options?: RemediationsDeleteAtResourceOptionalParams + options?: RemediationsDeleteAtResourceOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, options }, - deleteAtResourceOperationSpec + deleteAtResourceOperationSpec, ); } @@ -1090,11 +1090,11 @@ export class RemediationsImpl implements Remediations { managementGroupId: string, remediationName: string, nextLink: string, - options?: RemediationsListDeploymentsAtManagementGroupNextOptionalParams + options?: RemediationsListDeploymentsAtManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, remediationName, nextLink, options }, - listDeploymentsAtManagementGroupNextOperationSpec + listDeploymentsAtManagementGroupNextOperationSpec, ); } @@ -1107,11 +1107,11 @@ export class RemediationsImpl implements Remediations { private _listForManagementGroupNext( managementGroupId: string, nextLink: string, - options?: RemediationsListForManagementGroupNextOptionalParams + options?: RemediationsListForManagementGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { managementGroupId, nextLink, options }, - listForManagementGroupNextOperationSpec + listForManagementGroupNextOperationSpec, ); } @@ -1125,11 +1125,11 @@ export class RemediationsImpl implements Remediations { private _listDeploymentsAtSubscriptionNext( remediationName: string, nextLink: string, - options?: RemediationsListDeploymentsAtSubscriptionNextOptionalParams + options?: RemediationsListDeploymentsAtSubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { remediationName, nextLink, options }, - listDeploymentsAtSubscriptionNextOperationSpec + listDeploymentsAtSubscriptionNextOperationSpec, ); } @@ -1140,11 +1140,11 @@ export class RemediationsImpl implements Remediations { */ private _listForSubscriptionNext( nextLink: string, - options?: RemediationsListForSubscriptionNextOptionalParams + options?: RemediationsListForSubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listForSubscriptionNextOperationSpec + listForSubscriptionNextOperationSpec, ); } @@ -1160,11 +1160,11 @@ export class RemediationsImpl implements Remediations { resourceGroupName: string, remediationName: string, nextLink: string, - options?: RemediationsListDeploymentsAtResourceGroupNextOptionalParams + options?: RemediationsListDeploymentsAtResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, remediationName, nextLink, options }, - listDeploymentsAtResourceGroupNextOperationSpec + listDeploymentsAtResourceGroupNextOperationSpec, ); } @@ -1177,11 +1177,11 @@ export class RemediationsImpl implements Remediations { private _listForResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: RemediationsListForResourceGroupNextOptionalParams + options?: RemediationsListForResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listForResourceGroupNextOperationSpec + listForResourceGroupNextOperationSpec, ); } @@ -1197,11 +1197,11 @@ export class RemediationsImpl implements Remediations { resourceId: string, remediationName: string, nextLink: string, - options?: RemediationsListDeploymentsAtResourceNextOptionalParams + options?: RemediationsListDeploymentsAtResourceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, remediationName, nextLink, options }, - listDeploymentsAtResourceNextOperationSpec + listDeploymentsAtResourceNextOperationSpec, ); } @@ -1214,699 +1214,680 @@ export class RemediationsImpl implements Remediations { private _listForResourceNext( resourceId: string, nextLink: string, - options?: RemediationsListForResourceNextOptionalParams + options?: RemediationsListForResourceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceId, nextLink, options }, - listForResourceNextOperationSpec + listForResourceNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listDeploymentsAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult +const listDeploymentsAtManagementGroupOperationSpec: coreClient.OperationSpec = + { + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.top, Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.managementGroupId, - Parameters.remediationName - ], - headerParameters: [Parameters.accept], - serializer -}; + queryParameters: [Parameters.top, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName, + ], + headerParameters: [Parameters.accept], + serializer, + }; const cancelAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, Parameters.managementGroupId, - Parameters.remediationName + Parameters.remediationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations", + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, - Parameters.managementGroupId + Parameters.managementGroupId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 201: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, Parameters.managementGroupId, - Parameters.remediationName + Parameters.remediationName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, Parameters.managementGroupId, - Parameters.remediationName + Parameters.remediationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtManagementGroupOperationSpec: coreClient.OperationSpec = { - path: - "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, Parameters.managementGroupId, - Parameters.remediationName + Parameters.remediationName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listDeploymentsAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult + bodyMapper: Mappers.RemediationDeploymentsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 201: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, - Parameters.remediationName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listDeploymentsAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult + bodyMapper: Mappers.RemediationDeploymentsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 201: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.remediationName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listDeploymentsAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", + path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult + bodyMapper: Mappers.RemediationDeploymentsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const cancelAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", + path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/cancel", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceOperationSpec: coreClient.OperationSpec = { path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion1], + queryParameters: [Parameters.top, Parameters.apiVersion, Parameters.filter], urlParameters: [Parameters.$host, Parameters.resourceId], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 201: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, - Parameters.remediationName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const getAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const deleteAtResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", + path: "/{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.Remediation + bodyMapper: Mappers.Remediation, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listDeploymentsAtManagementGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult +const listDeploymentsAtManagementGroupNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupsNamespace, - Parameters.nextLink, - Parameters.managementGroupId, - Parameters.remediationName - ], - headerParameters: [Parameters.accept], - serializer -}; + urlParameters: [ + Parameters.$host, + Parameters.managementGroupsNamespace, + Parameters.managementGroupId, + Parameters.remediationName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listForManagementGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.managementGroupsNamespace, + Parameters.managementGroupId, Parameters.nextLink, - Parameters.managementGroupId ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listDeploymentsAtSubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult +const listDeploymentsAtSubscriptionNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - Parameters.remediationName - ], - headerParameters: [Parameters.accept], - serializer -}; + urlParameters: [ + Parameters.$host, + Parameters.remediationName, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listForSubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listDeploymentsAtResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, Parameters.nextLink, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; +const listDeploymentsAtResourceGroupNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RemediationDeploymentsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.remediationName, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listForResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listDeploymentsAtResourceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationDeploymentsListResult + bodyMapper: Mappers.RemediationDeploymentsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.remediationName, Parameters.resourceId, Parameters.nextLink, - Parameters.remediationName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listForResourceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RemediationListResult + bodyMapper: Mappers.RemediationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.resourceId, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/attestations.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/attestations.ts deleted file mode 100644 index 4c24305dc940..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/attestations.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; -import { - Attestation, - AttestationsListForSubscriptionOptionalParams, - AttestationsListForResourceGroupOptionalParams, - AttestationsListForResourceOptionalParams, - AttestationsCreateOrUpdateAtSubscriptionOptionalParams, - AttestationsCreateOrUpdateAtSubscriptionResponse, - AttestationsGetAtSubscriptionOptionalParams, - AttestationsGetAtSubscriptionResponse, - AttestationsDeleteAtSubscriptionOptionalParams, - AttestationsCreateOrUpdateAtResourceGroupOptionalParams, - AttestationsCreateOrUpdateAtResourceGroupResponse, - AttestationsGetAtResourceGroupOptionalParams, - AttestationsGetAtResourceGroupResponse, - AttestationsDeleteAtResourceGroupOptionalParams, - AttestationsCreateOrUpdateAtResourceOptionalParams, - AttestationsCreateOrUpdateAtResourceResponse, - AttestationsGetAtResourceOptionalParams, - AttestationsGetAtResourceResponse, - AttestationsDeleteAtResourceOptionalParams -} from "../models"; - -/// -/** Interface representing a Attestations. */ -export interface Attestations { - /** - * Gets all attestations for the subscription. - * @param options The options parameters. - */ - listForSubscription( - options?: AttestationsListForSubscriptionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets all attestations for the resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listForResourceGroup( - resourceGroupName: string, - options?: AttestationsListForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets all attestations for a resource. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - listForResource( - resourceId: string, - options?: AttestationsListForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * Creates or updates an attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscription( - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtSubscriptionResponse - > - >; - /** - * Creates or updates an attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtSubscriptionAndWait( - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtSubscriptionOptionalParams - ): Promise; - /** - * Gets an existing attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtSubscription( - attestationName: string, - options?: AttestationsGetAtSubscriptionOptionalParams - ): Promise; - /** - * Deletes an existing attestation at subscription scope. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtSubscription( - attestationName: string, - options?: AttestationsDeleteAtSubscriptionOptionalParams - ): Promise; - /** - * Creates or updates an attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResourceGroup( - resourceGroupName: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtResourceGroupResponse - > - >; - /** - * Creates or updates an attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResourceGroupAndWait( - resourceGroupName: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceGroupOptionalParams - ): Promise; - /** - * Gets an existing attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtResourceGroup( - resourceGroupName: string, - attestationName: string, - options?: AttestationsGetAtResourceGroupOptionalParams - ): Promise; - /** - * Deletes an existing attestation at resource group scope. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtResourceGroup( - resourceGroupName: string, - attestationName: string, - options?: AttestationsDeleteAtResourceGroupOptionalParams - ): Promise; - /** - * Creates or updates an attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResource( - resourceId: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceOptionalParams - ): Promise< - PollerLike< - PollOperationState, - AttestationsCreateOrUpdateAtResourceResponse - > - >; - /** - * Creates or updates an attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param parameters The attestation parameters. - * @param options The options parameters. - */ - beginCreateOrUpdateAtResourceAndWait( - resourceId: string, - attestationName: string, - parameters: Attestation, - options?: AttestationsCreateOrUpdateAtResourceOptionalParams - ): Promise; - /** - * Gets an existing attestation at resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - getAtResource( - resourceId: string, - attestationName: string, - options?: AttestationsGetAtResourceOptionalParams - ): Promise; - /** - * Deletes an existing attestation at individual resource scope. - * @param resourceId Resource ID. - * @param attestationName The name of the attestation. - * @param options The options parameters. - */ - deleteAtResource( - resourceId: string, - attestationName: string, - options?: AttestationsDeleteAtResourceOptionalParams - ): Promise; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/componentPolicyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/componentPolicyStates.ts deleted file mode 100644 index c92580a1b06a..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/componentPolicyStates.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 { - ComponentPolicyStatesResource, - ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams, - ComponentPolicyStatesListQueryResultsForSubscriptionResponse, - ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceGroupResponse, - ComponentPolicyStatesListQueryResultsForResourceOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceResponse, - ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, - ComponentPolicyStatesListQueryResultsForPolicyDefinitionResponse, - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse, - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse -} from "../models"; - -/** Interface representing a ComponentPolicyStates. */ -export interface ComponentPolicyStates { - /** - * Queries component policy states under subscription scope. - * @param subscriptionId Microsoft Azure subscription ID. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForSubscription( - subscriptionId: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForSubscriptionOptionalParams - ): Promise; - /** - * Queries component policy states under resource group scope. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResourceGroup( - subscriptionId: string, - resourceGroupName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceGroupOptionalParams - ): Promise; - /** - * Queries component policy states for the resource. - * @param resourceId Resource ID. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResource( - resourceId: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceOptionalParams - ): Promise; - /** - * Queries component policy states for the subscription level policy definition. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForPolicyDefinition( - subscriptionId: string, - policyDefinitionName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): Promise; - /** - * Queries component policy states for the subscription level policy assignment. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForSubscriptionLevelPolicyAssignment( - subscriptionId: string, - policyAssignmentName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise< - ComponentPolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentResponse - >; - /** - * Queries component policy states for the resource group level policy assignment. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param componentPolicyStatesResource The virtual resource under ComponentPolicyStates resource type. - * In a given time range, 'latest' represents the latest component policy state(s). - * @param options The options parameters. - */ - listQueryResultsForResourceGroupLevelPolicyAssignment( - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - componentPolicyStatesResource: ComponentPolicyStatesResource, - options?: ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - ComponentPolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentResponse - >; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/index.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/index.ts index d6c77636fbd3..30f031b20459 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/index.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/index.ts @@ -6,12 +6,4 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./policyTrackedResources"; export * from "./remediations"; -export * from "./policyEvents"; -export * from "./policyStates"; -export * from "./policyMetadataOperations"; -export * from "./policyRestrictions"; -export * from "./componentPolicyStates"; -export * from "./operations"; -export * from "./attestations"; diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/operations.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/operations.ts deleted file mode 100644 index 2c5c5efa08dc..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 { - OperationsListOptionalParams, - OperationsListResponse -} from "../models"; - -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists available operations. - * @param options The options parameters. - */ - list(options?: OperationsListOptionalParams): Promise; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyEvents.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyEvents.ts deleted file mode 100644 index 7de422c0b48b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyEvents.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 { - PolicyEvent, - PolicyEventsResourceType, - PolicyEventsListQueryResultsForManagementGroupOptionalParams, - PolicyEventsListQueryResultsForSubscriptionOptionalParams, - PolicyEventsListQueryResultsForResourceGroupOptionalParams, - PolicyEventsListQueryResultsForResourceOptionalParams, - PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams, - PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams, - PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams -} from "../models"; - -/// -/** Interface representing a PolicyEvents. */ -export interface PolicyEvents { - /** - * Queries policy events for the resources under the management group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - listQueryResultsForManagementGroup( - policyEventsResource: PolicyEventsResourceType, - managementGroupName: string, - options?: PolicyEventsListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the resources under the subscription. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - listQueryResultsForSubscription( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - options?: PolicyEventsListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the resources under the resource group. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - listQueryResultsForResourceGroup( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyEventsListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the resource. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - listQueryResultsForResource( - policyEventsResource: PolicyEventsResourceType, - resourceId: string, - options?: PolicyEventsListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the subscription level policy set definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - listQueryResultsForPolicySetDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicySetDefinitionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the subscription level policy definition. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - listQueryResultsForPolicyDefinition( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyEventsListQueryResultsForPolicyDefinitionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the subscription level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - listQueryResultsForSubscriptionLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy events for the resource group level policy assignment. - * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only - * "default" is allowed. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - listQueryResultsForResourceGroupLevelPolicyAssignment( - policyEventsResource: PolicyEventsResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyMetadataOperations.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyMetadataOperations.ts deleted file mode 100644 index 2fc2d1b81d15..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyMetadataOperations.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 { - SlimPolicyMetadata, - PolicyMetadataListOptionalParams, - PolicyMetadataGetResourceOptionalParams, - PolicyMetadataGetResourceResponse -} from "../models"; - -/// -/** Interface representing a PolicyMetadataOperations. */ -export interface PolicyMetadataOperations { - /** - * Get a list of the policy metadata resources. - * @param options The options parameters. - */ - list( - options?: PolicyMetadataListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get policy metadata resource. - * @param resourceName The name of the policy metadata resource. - * @param options The options parameters. - */ - getResource( - resourceName: string, - options?: PolicyMetadataGetResourceOptionalParams - ): Promise; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyRestrictions.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyRestrictions.ts deleted file mode 100644 index f2c65f00fb0b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyRestrictions.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 { - CheckRestrictionsRequest, - PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams, - PolicyRestrictionsCheckAtSubscriptionScopeResponse, - PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams, - PolicyRestrictionsCheckAtResourceGroupScopeResponse, - CheckManagementGroupRestrictionsRequest, - PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams, - PolicyRestrictionsCheckAtManagementGroupScopeResponse -} from "../models"; - -/** Interface representing a PolicyRestrictions. */ -export interface PolicyRestrictions { - /** - * Checks what restrictions Azure Policy will place on a resource within a subscription. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtSubscriptionScope( - parameters: CheckRestrictionsRequest, - options?: PolicyRestrictionsCheckAtSubscriptionScopeOptionalParams - ): Promise; - /** - * Checks what restrictions Azure Policy will place on a resource within a resource group. Use this - * when the resource group the resource will be created in is already known. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtResourceGroupScope( - resourceGroupName: string, - parameters: CheckRestrictionsRequest, - options?: PolicyRestrictionsCheckAtResourceGroupScopeOptionalParams - ): Promise; - /** - * Checks what restrictions Azure Policy will place on resources within a management group. - * @param managementGroupId Management group ID. - * @param parameters The check policy restrictions parameters. - * @param options The options parameters. - */ - checkAtManagementGroupScope( - managementGroupId: string, - parameters: CheckManagementGroupRestrictionsRequest, - options?: PolicyRestrictionsCheckAtManagementGroupScopeOptionalParams - ): Promise; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyStates.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyStates.ts deleted file mode 100644 index ac0bd6a62595..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyStates.ts +++ /dev/null @@ -1,320 +0,0 @@ -/* - * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; -import { - PolicyState, - PolicyStatesResource, - PolicyStatesListQueryResultsForManagementGroupOptionalParams, - PolicyStatesListQueryResultsForSubscriptionOptionalParams, - PolicyStatesListQueryResultsForResourceGroupOptionalParams, - PolicyStatesListQueryResultsForResourceOptionalParams, - PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams, - PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams, - PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams, - PolicyStatesSummaryResourceType, - PolicyStatesSummarizeForManagementGroupOptionalParams, - PolicyStatesSummarizeForManagementGroupResponse, - PolicyStatesSummarizeForSubscriptionOptionalParams, - PolicyStatesSummarizeForSubscriptionResponse, - PolicyStatesSummarizeForResourceGroupOptionalParams, - PolicyStatesSummarizeForResourceGroupResponse, - PolicyStatesSummarizeForResourceOptionalParams, - PolicyStatesSummarizeForResourceResponse, - PolicyStatesTriggerSubscriptionEvaluationOptionalParams, - PolicyStatesTriggerResourceGroupEvaluationOptionalParams, - PolicyStatesSummarizeForPolicySetDefinitionOptionalParams, - PolicyStatesSummarizeForPolicySetDefinitionResponse, - PolicyStatesSummarizeForPolicyDefinitionOptionalParams, - PolicyStatesSummarizeForPolicyDefinitionResponse, - PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams, - PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentResponse, - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams, - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse -} from "../models"; - -/// -/** Interface representing a PolicyStates. */ -export interface PolicyStates { - /** - * Queries policy states for the resources under the management group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - listQueryResultsForManagementGroup( - policyStatesResource: PolicyStatesResource, - managementGroupName: string, - options?: PolicyStatesListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the resources under the subscription. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - listQueryResultsForSubscription( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - options?: PolicyStatesListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the resources under the resource group. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - listQueryResultsForResourceGroup( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the resource. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param resourceId Resource ID. - * @param options The options parameters. - */ - listQueryResultsForResource( - policyStatesResource: PolicyStatesResource, - resourceId: string, - options?: PolicyStatesListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the subscription level policy set definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - listQueryResultsForPolicySetDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicySetDefinitionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the subscription level policy definition. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - listQueryResultsForPolicyDefinition( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesListQueryResultsForPolicyDefinitionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the subscription level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - listQueryResultsForSubscriptionLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy states for the resource group level policy assignment. - * @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time - * range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy - * state(s). - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - listQueryResultsForResourceGroupLevelPolicyAssignment( - policyStatesResource: PolicyStatesResource, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesListQueryResultsForResourceGroupLevelPolicyAssignmentOptionalParams - ): PagedAsyncIterableIterator; - /** - * Summarizes policy states for the resources under the management group. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param managementGroupName Management group name. - * @param options The options parameters. - */ - summarizeForManagementGroup( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - managementGroupName: string, - options?: PolicyStatesSummarizeForManagementGroupOptionalParams - ): Promise; - /** - * Summarizes policy states for the resources under the subscription. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - summarizeForSubscription( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - options?: PolicyStatesSummarizeForSubscriptionOptionalParams - ): Promise; - /** - * Summarizes policy states for the resources under the resource group. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - summarizeForResourceGroup( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesSummarizeForResourceGroupOptionalParams - ): Promise; - /** - * Summarizes policy states for the resource. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param resourceId Resource ID. - * @param options The options parameters. - */ - summarizeForResource( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - resourceId: string, - options?: PolicyStatesSummarizeForResourceOptionalParams - ): Promise; - /** - * Triggers a policy evaluation scan for all the resources under the subscription - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - beginTriggerSubscriptionEvaluation( - subscriptionId: string, - options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams - ): Promise, void>>; - /** - * Triggers a policy evaluation scan for all the resources under the subscription - * @param subscriptionId Microsoft Azure subscription ID. - * @param options The options parameters. - */ - beginTriggerSubscriptionEvaluationAndWait( - subscriptionId: string, - options?: PolicyStatesTriggerSubscriptionEvaluationOptionalParams - ): Promise; - /** - * Triggers a policy evaluation scan for all the resources under the resource group. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - beginTriggerResourceGroupEvaluation( - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams - ): Promise, void>>; - /** - * Triggers a policy evaluation scan for all the resources under the resource group. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param options The options parameters. - */ - beginTriggerResourceGroupEvaluationAndWait( - subscriptionId: string, - resourceGroupName: string, - options?: PolicyStatesTriggerResourceGroupEvaluationOptionalParams - ): Promise; - /** - * Summarizes policy states for the subscription level policy set definition. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policySetDefinitionName Policy set definition name. - * @param options The options parameters. - */ - summarizeForPolicySetDefinition( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policySetDefinitionName: string, - options?: PolicyStatesSummarizeForPolicySetDefinitionOptionalParams - ): Promise; - /** - * Summarizes policy states for the subscription level policy definition. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyDefinitionName Policy definition name. - * @param options The options parameters. - */ - summarizeForPolicyDefinition( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policyDefinitionName: string, - options?: PolicyStatesSummarizeForPolicyDefinitionOptionalParams - ): Promise; - /** - * Summarizes policy states for the subscription level policy assignment. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - summarizeForSubscriptionLevelPolicyAssignment( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - policyAssignmentName: string, - options?: PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentOptionalParams - ): Promise; - /** - * Summarizes policy states for the resource group level policy assignment. - * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for - * summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the - * only allowed value. - * @param subscriptionId Microsoft Azure subscription ID. - * @param resourceGroupName Resource group name. - * @param policyAssignmentName Policy assignment name. - * @param options The options parameters. - */ - summarizeForResourceGroupLevelPolicyAssignment( - policyStatesSummaryResource: PolicyStatesSummaryResourceType, - subscriptionId: string, - resourceGroupName: string, - policyAssignmentName: string, - options?: PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentOptionalParams - ): Promise< - PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentResponse - >; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyTrackedResources.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyTrackedResources.ts deleted file mode 100644 index f6a079abea7b..000000000000 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/policyTrackedResources.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 { - PolicyTrackedResource, - PolicyTrackedResourcesResourceType, - PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams, - PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams, - PolicyTrackedResourcesListQueryResultsForResourceOptionalParams -} from "../models"; - -/// -/** Interface representing a PolicyTrackedResources. */ -export interface PolicyTrackedResources { - /** - * Queries policy tracked resources under the management group. - * @param managementGroupName Management group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - listQueryResultsForManagementGroup( - managementGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForManagementGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy tracked resources under the subscription. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - listQueryResultsForSubscription( - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForSubscriptionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy tracked resources under the resource group. - * @param resourceGroupName Resource group name. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - listQueryResultsForResourceGroup( - resourceGroupName: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Queries policy tracked resources under the resource. - * @param resourceId Resource ID. - * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources - * resource type; only "default" is allowed. - * @param options The options parameters. - */ - listQueryResultsForResource( - resourceId: string, - policyTrackedResourcesResource: PolicyTrackedResourcesResourceType, - options?: PolicyTrackedResourcesListQueryResultsForResourceOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/remediations.ts b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/remediations.ts index 2c7d0dc2cc38..8056c46acf11 100644 --- a/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/remediations.ts +++ b/sdk/policyinsights/arm-policyinsights/src/operationsInterfaces/remediations.ts @@ -49,7 +49,7 @@ import { RemediationsGetAtResourceOptionalParams, RemediationsGetAtResourceResponse, RemediationsDeleteAtResourceOptionalParams, - RemediationsDeleteAtResourceResponse + RemediationsDeleteAtResourceResponse, } from "../models"; /// @@ -64,7 +64,7 @@ export interface Remediations { listDeploymentsAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsListDeploymentsAtManagementGroupOptionalParams + options?: RemediationsListDeploymentsAtManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all remediations for the management group. @@ -73,7 +73,7 @@ export interface Remediations { */ listForManagementGroup( managementGroupId: string, - options?: RemediationsListForManagementGroupOptionalParams + options?: RemediationsListForManagementGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments for a remediation at subscription scope. @@ -82,14 +82,14 @@ export interface Remediations { */ listDeploymentsAtSubscription( remediationName: string, - options?: RemediationsListDeploymentsAtSubscriptionOptionalParams + options?: RemediationsListDeploymentsAtSubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all remediations for the subscription. * @param options The options parameters. */ listForSubscription( - options?: RemediationsListForSubscriptionOptionalParams + options?: RemediationsListForSubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments for a remediation at resource group scope. @@ -100,7 +100,7 @@ export interface Remediations { listDeploymentsAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceGroupOptionalParams + options?: RemediationsListDeploymentsAtResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all remediations for the subscription. @@ -109,7 +109,7 @@ export interface Remediations { */ listForResourceGroup( resourceGroupName: string, - options?: RemediationsListForResourceGroupOptionalParams + options?: RemediationsListForResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all deployments for a remediation at resource scope. @@ -120,7 +120,7 @@ export interface Remediations { listDeploymentsAtResource( resourceId: string, remediationName: string, - options?: RemediationsListDeploymentsAtResourceOptionalParams + options?: RemediationsListDeploymentsAtResourceOptionalParams, ): PagedAsyncIterableIterator; /** * Gets all remediations for a resource. @@ -129,7 +129,7 @@ export interface Remediations { */ listForResource( resourceId: string, - options?: RemediationsListForResourceOptionalParams + options?: RemediationsListForResourceOptionalParams, ): PagedAsyncIterableIterator; /** * Cancels a remediation at management group scope. @@ -140,7 +140,7 @@ export interface Remediations { cancelAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsCancelAtManagementGroupOptionalParams + options?: RemediationsCancelAtManagementGroupOptionalParams, ): Promise; /** * Creates or updates a remediation at management group scope. @@ -153,7 +153,7 @@ export interface Remediations { managementGroupId: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtManagementGroupOptionalParams + options?: RemediationsCreateOrUpdateAtManagementGroupOptionalParams, ): Promise; /** * Gets an existing remediation at management group scope. @@ -164,7 +164,7 @@ export interface Remediations { getAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsGetAtManagementGroupOptionalParams + options?: RemediationsGetAtManagementGroupOptionalParams, ): Promise; /** * Deletes an existing remediation at management group scope. @@ -175,7 +175,7 @@ export interface Remediations { deleteAtManagementGroup( managementGroupId: string, remediationName: string, - options?: RemediationsDeleteAtManagementGroupOptionalParams + options?: RemediationsDeleteAtManagementGroupOptionalParams, ): Promise; /** * Cancels a remediation at subscription scope. @@ -184,7 +184,7 @@ export interface Remediations { */ cancelAtSubscription( remediationName: string, - options?: RemediationsCancelAtSubscriptionOptionalParams + options?: RemediationsCancelAtSubscriptionOptionalParams, ): Promise; /** * Creates or updates a remediation at subscription scope. @@ -195,7 +195,7 @@ export interface Remediations { createOrUpdateAtSubscription( remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtSubscriptionOptionalParams + options?: RemediationsCreateOrUpdateAtSubscriptionOptionalParams, ): Promise; /** * Gets an existing remediation at subscription scope. @@ -204,7 +204,7 @@ export interface Remediations { */ getAtSubscription( remediationName: string, - options?: RemediationsGetAtSubscriptionOptionalParams + options?: RemediationsGetAtSubscriptionOptionalParams, ): Promise; /** * Deletes an existing remediation at subscription scope. @@ -213,7 +213,7 @@ export interface Remediations { */ deleteAtSubscription( remediationName: string, - options?: RemediationsDeleteAtSubscriptionOptionalParams + options?: RemediationsDeleteAtSubscriptionOptionalParams, ): Promise; /** * Cancels a remediation at resource group scope. @@ -224,7 +224,7 @@ export interface Remediations { cancelAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsCancelAtResourceGroupOptionalParams + options?: RemediationsCancelAtResourceGroupOptionalParams, ): Promise; /** * Creates or updates a remediation at resource group scope. @@ -237,7 +237,7 @@ export interface Remediations { resourceGroupName: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtResourceGroupOptionalParams + options?: RemediationsCreateOrUpdateAtResourceGroupOptionalParams, ): Promise; /** * Gets an existing remediation at resource group scope. @@ -248,7 +248,7 @@ export interface Remediations { getAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsGetAtResourceGroupOptionalParams + options?: RemediationsGetAtResourceGroupOptionalParams, ): Promise; /** * Deletes an existing remediation at resource group scope. @@ -259,7 +259,7 @@ export interface Remediations { deleteAtResourceGroup( resourceGroupName: string, remediationName: string, - options?: RemediationsDeleteAtResourceGroupOptionalParams + options?: RemediationsDeleteAtResourceGroupOptionalParams, ): Promise; /** * Cancel a remediation at resource scope. @@ -270,7 +270,7 @@ export interface Remediations { cancelAtResource( resourceId: string, remediationName: string, - options?: RemediationsCancelAtResourceOptionalParams + options?: RemediationsCancelAtResourceOptionalParams, ): Promise; /** * Creates or updates a remediation at resource scope. @@ -283,7 +283,7 @@ export interface Remediations { resourceId: string, remediationName: string, parameters: Remediation, - options?: RemediationsCreateOrUpdateAtResourceOptionalParams + options?: RemediationsCreateOrUpdateAtResourceOptionalParams, ): Promise; /** * Gets an existing remediation at resource scope. @@ -294,7 +294,7 @@ export interface Remediations { getAtResource( resourceId: string, remediationName: string, - options?: RemediationsGetAtResourceOptionalParams + options?: RemediationsGetAtResourceOptionalParams, ): Promise; /** * Deletes an existing remediation at individual resource scope. @@ -305,6 +305,6 @@ export interface Remediations { deleteAtResource( resourceId: string, remediationName: string, - options?: RemediationsDeleteAtResourceOptionalParams + options?: RemediationsDeleteAtResourceOptionalParams, ): Promise; } diff --git a/sdk/policyinsights/arm-policyinsights/src/pagingHelper.ts b/sdk/policyinsights/arm-policyinsights/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/policyinsights/arm-policyinsights/src/pagingHelper.ts +++ b/sdk/policyinsights/arm-policyinsights/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts index 38b1425134dd..a3dab8e6096d 100644 --- a/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts +++ b/sdk/policyinsights/arm-policyinsights/src/policyInsightsClient.ts @@ -8,34 +8,20 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { - PolicyTrackedResourcesImpl, - RemediationsImpl, - PolicyEventsImpl, - PolicyStatesImpl, - PolicyMetadataOperationsImpl, - PolicyRestrictionsImpl, - ComponentPolicyStatesImpl, - OperationsImpl, - AttestationsImpl -} from "./operations"; import { - PolicyTrackedResources, - Remediations, - PolicyEvents, - PolicyStates, - PolicyMetadataOperations, - PolicyRestrictions, - ComponentPolicyStates, - Operations, - Attestations -} from "./operationsInterfaces"; + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { RemediationsImpl } from "./operations"; +import { Remediations } from "./operationsInterfaces"; import { PolicyInsightsClientOptionalParams } from "./models"; export class PolicyInsightsClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + apiVersion: string; + subscriptionId?: string; /** * Initializes a new instance of the PolicyInsightsClient class. @@ -46,13 +32,27 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: PolicyInsightsClientOptionalParams + options?: PolicyInsightsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: PolicyInsightsClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: PolicyInsightsClientOptionalParams | string, + options?: PolicyInsightsClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -61,10 +61,10 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { } const defaults: PolicyInsightsClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-policyinsights/6.0.0-beta.4`; + const packageDetails = `azsdk-js-arm-policyinsights/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -74,20 +74,21 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -97,7 +98,7 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -107,9 +108,9 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -117,24 +118,38 @@ export class PolicyInsightsClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.policyTrackedResources = new PolicyTrackedResourcesImpl(this); + this.apiVersion = options.apiVersion || "2024-10-01"; this.remediations = new RemediationsImpl(this); - this.policyEvents = new PolicyEventsImpl(this); - this.policyStates = new PolicyStatesImpl(this); - this.policyMetadataOperations = new PolicyMetadataOperationsImpl(this); - this.policyRestrictions = new PolicyRestrictionsImpl(this); - this.componentPolicyStates = new ComponentPolicyStatesImpl(this); - this.operations = new OperationsImpl(this); - this.attestations = new AttestationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); } - policyTrackedResources: PolicyTrackedResources; remediations: Remediations; - policyEvents: PolicyEvents; - policyStates: PolicyStates; - policyMetadataOperations: PolicyMetadataOperations; - policyRestrictions: PolicyRestrictions; - componentPolicyStates: ComponentPolicyStates; - operations: Operations; - attestations: Attestations; } diff --git a/sdk/policyinsights/arm-policyinsights/test/sampleTest.ts b/sdk/policyinsights/arm-policyinsights/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/policyinsights/arm-policyinsights/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/policyinsights/arm-policyinsights/tsconfig.json b/sdk/policyinsights/arm-policyinsights/tsconfig.json index 41da3f3f38bc..3e6ae96443f3 100644 --- a/sdk/policyinsights/arm-policyinsights/tsconfig.json +++ b/sdk/policyinsights/arm-policyinsights/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-policyinsights": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"