diff --git a/sdk/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index 1bc9c1c86980..4db32281acad 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-policy ### How to use -#### nodejs - Authentication, client creation and get policyAssignments as an example written in TypeScript. +#### nodejs - client creation and getByPolicyMode dataPolicyManifests as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,18 +26,16 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { PolicyClient, PolicyModels, PolicyMappers } from "@azure/arm-policy"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { PolicyClient } = require("@azure/arm-policy"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new PolicyClient(creds, subscriptionId); - const scope = "testscope"; - const policyAssignmentName = "testpolicyAssignmentName"; - client.policyAssignments.get(scope, policyAssignmentName).then((result) => { + const policyMode = "testpolicyMode"; + client.dataPolicyManifests.getByPolicyMode(policyMode).then((result) => { console.log("The result is:"); console.log(result); }); @@ -46,7 +44,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and get policyAssignments as an example written in JavaScript. +#### browser - Authentication, client creation and getByPolicyMode dataPolicyManifests as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -80,9 +78,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.ArmPolicy.PolicyClient(res.creds, subscriptionId); - const scope = "testscope"; - const policyAssignmentName = "testpolicyAssignmentName"; - client.policyAssignments.get(scope, policyAssignmentName).then((result) => { + const policyMode = "testpolicyMode"; + client.dataPolicyManifests.getByPolicyMode(policyMode).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/policy/arm-policy/rollup.config.js b/sdk/policy/arm-policy/rollup.config.js index 8747e388192c..156fb323dbb5 100644 --- a/sdk/policy/arm-policy/rollup.config.js +++ b/sdk/policy/arm-policy/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts b/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts new file mode 100644 index 000000000000..fb28f01f5216 --- /dev/null +++ b/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +export { + Alias, + AliasPath, + AliasPathMetadata, + AliasPattern, + BaseResource, + CloudError, + DataEffect, + DataManifestCustomResourceFunctionDefinition, + DataPolicyManifest, + DataPolicyManifestListResult, + ErrorAdditionalInfo, + ErrorDetail, + Identity, + NonComplianceMessage, + ParameterDefinitionsValue, + ParameterDefinitionsValueMetadata, + ParameterValuesValue, + PolicyAssignment, + PolicyDefinition, + PolicyDefinitionGroup, + PolicyDefinitionReference, + PolicySetDefinition, + ResourceTypeAliases +} from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index a3c35f1d4fe8..4026aa7f2e78 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -28,9 +28,9 @@ export interface ErrorAdditionalInfo { } /** - * The resource management error response. + * The error detail. */ -export interface ErrorResponse { +export interface ErrorDetail { /** * The error code. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -50,7 +50,7 @@ export interface ErrorResponse { * The error details. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; /** * The error additional info. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -58,6 +58,215 @@ export interface ErrorResponse { readonly additionalInfo?: ErrorAdditionalInfo[]; } +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface CloudError { + /** + * The error object. + */ + error?: ErrorDetail; +} + +/** + * The custom resource function definition. + */ +export interface DataManifestCustomResourceFunctionDefinition { + /** + * The function name as it will appear in the policy rule. eg - 'vault'. + */ + name?: string; + /** + * The fully qualified control plane resource type that this function represents. eg - + * 'Microsoft.KeyVault/vaults'. + */ + fullyQualifiedResourceType?: string; + /** + * The top-level properties that can be selected on the function's output. eg - [ "name", + * "location" ] if vault().name and vault().location are supported + */ + defaultProperties?: string[]; + /** + * A value indicating whether the custom properties within the property bag are allowed. Needs + * api-version to be specified in the policy rule eg - vault('2019-06-01'). + */ + allowCustomProperties?: boolean; +} + +/** + * The data effect definition. + */ +export interface DataEffect { + /** + * The data effect name. + */ + name?: string; + /** + * The data effect details schema. + */ + detailsSchema?: any; +} + +/** + * The type of the pattern for an alias path. + */ +export interface AliasPattern { + /** + * The alias pattern phrase. + */ + phrase?: string; + /** + * The alias pattern variable. + */ + variable?: string; + /** + * The type of alias pattern. Possible values include: 'NotSpecified', 'Extract' + */ + type?: AliasPatternType; +} + +/** + * An interface representing AliasPathMetadata. + */ +export interface AliasPathMetadata { + /** + * The type of the token that the alias path is referring to. Possible values include: + * 'NotSpecified', 'Any', 'String', 'Object', 'Array', 'Integer', 'Number', 'Boolean' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: AliasPathTokenType; + /** + * The attributes of the token that the alias path is referring to. Possible values include: + * 'None', 'Modifiable' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly attributes?: AliasPathAttributes; +} + +/** + * The type of the paths for alias. + */ +export interface AliasPath { + /** + * The path of an alias. + */ + path?: string; + /** + * The API versions. + */ + apiVersions?: string[]; + /** + * The pattern for an alias path. + */ + pattern?: AliasPattern; + /** + * The metadata of the alias path. If missing, fall back to the default metadata of the alias. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly metadata?: AliasPathMetadata; +} + +/** + * The alias type. + */ +export interface Alias { + /** + * The alias name. + */ + name?: string; + /** + * The paths for an alias. + */ + paths?: AliasPath[]; + /** + * The type of the alias. Possible values include: 'NotSpecified', 'PlainText', 'Mask' + */ + type?: AliasType; + /** + * The default path for an alias. + */ + defaultPath?: string; + /** + * The default pattern for an alias. + */ + defaultPattern?: AliasPattern; + /** + * The default alias path metadata. Applies to the default path and to any alias path that + * doesn't have metadata + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultMetadata?: AliasPathMetadata; +} + +/** + * The resource type aliases definition. + */ +export interface ResourceTypeAliases { + /** + * The resource type name. + */ + resourceType?: string; + /** + * The aliases for property names. + */ + aliases?: Alias[]; +} + +/** + * The data policy manifest. + */ +export interface DataPolicyManifest extends BaseResource { + /** + * The list of namespaces for the data policy manifest. + */ + namespaces?: string[]; + /** + * The policy mode of the data policy manifest. + */ + policyMode?: string; + /** + * A value indicating whether policy mode is allowed only in built-in definitions. + */ + isBuiltInOnly?: boolean; + /** + * An array of resource type aliases. + */ + resourceTypeAliases?: ResourceTypeAliases[]; + /** + * The effect definition. + */ + effects?: DataEffect[]; + /** + * The non-alias field accessor values that can be used in the policy rule. + */ + fieldValues?: string[]; + /** + * The standard resource functions (subscription and/or resourceGroup). + */ + standard?: string[]; + /** + * An array of data manifest custom resource definition. + */ + custom?: DataManifestCustomResourceFunctionDefinition[]; + /** + * The ID of the data policy manifest. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the data policy manifest (it's the same as the Policy Mode). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource (Microsoft.Authorization/dataPolicyManifests). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + /** * The value of a parameter. */ @@ -69,17 +278,21 @@ export interface ParameterValuesValue { } /** - * The policy sku. This property is optional, obsolete, and will be ignored. + * A message that describes why a resource is non-compliant with the policy. This is shown in + * 'deny' error messages and on resource's non-compliant compliance results. */ -export interface PolicySku { +export interface NonComplianceMessage { /** - * The name of the policy sku. Possible values are A0 and A1. + * A message that describes why a resource is non-compliant with the policy. This is shown in + * 'deny' error messages and on resource's non-compliant compliance results. */ - name: string; + message: string; /** - * The policy sku tier. Possible values are Free and Standard. + * The policy definition reference ID within a policy set definition the message is intended for. + * This is only applicable if the policy assignment assigns a policy set definition. If this is + * not provided the message applies to all policies assigned by this policy assignment. */ - tier?: string; + policyDefinitionReferenceId?: string; } /** @@ -117,8 +330,9 @@ export interface PolicyAssignment extends BaseResource { policyDefinitionId?: string; /** * The scope for the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - scope?: string; + readonly scope?: string; /** * The policy's excluded scopes. */ @@ -138,9 +352,13 @@ export interface PolicyAssignment extends BaseResource { metadata?: any; /** * The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. Possible - * values include: 'Default', 'DoNotEnforce' + * values include: 'Default', 'DoNotEnforce'. Default value: 'Default'. */ enforcementMode?: EnforcementMode; + /** + * The messages that describe why a resource is non-compliant with the policy. + */ + nonComplianceMessages?: NonComplianceMessage[]; /** * The ID of the policy assignment. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -156,10 +374,6 @@ export interface PolicyAssignment extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; - /** - * The policy sku. This property is optional, obsolete, and will be ignored. - */ - sku?: PolicySku; /** * The location of the policy assignment. Only required when utilizing managed identity. */ @@ -182,6 +396,17 @@ export interface ParameterDefinitionsValueMetadata { * The description of the parameter. */ description?: string; + /** + * Used when assigning the policy definition through the portal. Provides a context aware list of + * values for the user to choose from. + */ + strongType?: string; + /** + * Set to true to have Azure portal create role assignments on the resource ID or resource scope + * value of this parameter during policy assignment. This property is useful in case you wish to + * assign permissions outside the assignment scope. + */ + assignPermissions?: boolean; /** * Describes unknown properties. The value of an unknown property can be of "any" type. */ @@ -221,7 +446,8 @@ export interface PolicyDefinition extends BaseResource { */ policyType?: PolicyType; /** - * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. Default + * value: 'Indexed'. */ mode?: string; /** @@ -363,15 +589,52 @@ export interface PolicySetDefinition extends BaseResource { readonly type?: string; } +/** + * Optional Parameters. + */ +export interface DataPolicyManifestsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". + * If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is + * provided, the returned list only includes all data policy manifests that have a namespace + * matching the provided value. + */ + filter?: string; +} + +/** + * Optional Parameters. + */ +export interface DataPolicyManifestsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". + * If $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is + * provided, the returned list only includes all data policy manifests that have a namespace + * matching the provided value. + */ + filter?: string; +} + /** * Optional Parameters. */ export interface PolicyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. */ filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; } /** @@ -379,10 +642,43 @@ export interface PolicyAssignmentsListForResourceGroupOptionalParams extends msR */ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListForManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. */ filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; } /** @@ -390,10 +686,373 @@ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.R */ export interface PolicyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListForResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListForResourceNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. */ filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListForManagementGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyAssignmentsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, no + * filtering is performed. If $filter=atScope() is provided, the returned list only includes all + * policy assignments that apply to the scope, which is everything in the unfiltered list except + * those applied to sub scopes contained within the given scope. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the given scope. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListBuiltInOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListBuiltInNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicyDefinitionsListByManagementGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, + * the returned list only includes all policy definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq + * {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListBuiltInOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListByManagementGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListBuiltInNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering + * is performed. If $filter=atExactScope() is provided, the returned list only includes all + * policy set definitions that at the given scope. If $filter='policyType -eq {value}' is + * provided, the returned list only includes all policy set definitions whose type match the + * {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy set + * definitions whose category match the {value}. + */ + filter?: string; + /** + * Maximum number of records to return. When the $top filter is not provided, it will return 500 + * records. + */ + top?: number; } /** @@ -403,6 +1062,18 @@ export interface PolicyClientOptions extends AzureServiceClientOptions { baseUri?: string; } +/** + * @interface + * List of data policy manifests. + * @extends Array + */ +export interface DataPolicyManifestListResult extends Array { + /** + * The URL to use for getting the next set of results. + */ + nextLink?: string; +} + /** * @interface * List of policy assignments. @@ -439,6 +1110,39 @@ export interface PolicySetDefinitionListResult extends Array + */ + getByPolicyMode(policyMode: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyMode The policy mode of the data policy manifest to get. + * @param callback The callback + */ + getByPolicyMode(policyMode: string, callback: msRest.ServiceCallback): void; + /** + * @param policyMode The policy mode of the data policy manifest to get. + * @param options The optional parameters + * @param callback The callback + */ + getByPolicyMode(policyMode: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getByPolicyMode(policyMode: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyMode, + options + }, + getByPolicyModeOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the data policy manifests that match the optional given + * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, + * the unfiltered list includes all data policy manifests for data resource types. If + * $filter=namespace is provided, the returned list only includes all data policy manifests that + * have a namespace matching the provided value. + * @summary Retrieves data policy manifests + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.DataPolicyManifestsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.DataPolicyManifestsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.DataPolicyManifestsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the data policy manifests that match the optional given + * $filter. Valid values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, + * the unfiltered list includes all data policy manifests for data resource types. If + * $filter=namespace is provided, the returned list only includes all data policy manifests that + * have a namespace matching the provided value. + * @summary Retrieves data policy manifests + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.DataPolicyManifestsListNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: Models.DataPolicyManifestsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.DataPolicyManifestsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getByPolicyModeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}", + urlParameters: [ + Parameters.policyMode + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataPolicyManifest + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/dataPolicyManifests", + queryParameters: [ + Parameters.apiVersion, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataPolicyManifestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataPolicyManifestListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index 8fab2c121e51..aa4d3d57aacd 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. */ +export * from "./dataPolicyManifests"; export * from "./policyAssignments"; export * from "./policyDefinitions"; export * from "./policySetDefinitions"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index 5faabeda2709..b41ea4e1d2b1 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -173,14 +172,16 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given resource * group in the given subscription that match the optional given $filter. Valid values for $filter - * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the - * unfiltered list includes all policy assignments associated with the resource group, including - * those that apply directly or apply from containing scopes, as well as any applied to resources - * contained within the resource group. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource group, which is everything in the - * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource group. + * are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, as well as any + * applied to resources contained within the resource group. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource group, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource group. If $filter=atExactScope() is provided, the returned list only includes all + * policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param resourceGroupName The name of the resource group that contains policy assignments. * @param [options] The optional parameters @@ -211,21 +212,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the specified * resource in the given resource group and subscription that match the optional given $filter. - * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is - * not provided, the unfiltered list includes all policy assignments associated with the resource, - * including those that apply directly or from all containing scopes, as well as any applied to - * resources contained within the resource. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource, which is everything in the - * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource. Three - * parameters plus the resource name are used to identify a specific resource. If the resource is - * not part of a parent resource (the more common case), the parent resource path should not be - * provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == - * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all - * parameters should be provided. For example a virtual machine DNS name could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments + * associated with the resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the resource level. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value} + * that apply to the resource. Three parameters plus the resource name are used to identify a + * specific resource. If the resource is not part of a parent resource (the more common case), the + * parent resource path should not be provided (or provided as ''). For example a web app could be + * specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', + * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent + * resource, then all parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', @@ -282,42 +284,34 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments applicable to the management group - * that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId - * eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy - * assignments that are assigned to the management group or the management group's ancestors. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the management group. + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or + * 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes + * all policy assignments that are assigned to the management group or the management group's + * ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the management group. * @summary Retrieves all policy assignments that apply to a management group. * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param [options] The optional parameters * @returns Promise */ - listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase): Promise; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param callback The callback */ - listForManagementGroup(managementGroupId: string, filter: string, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. A filter is required when listing policy assignments at - * management group scope. * @param options The optional parameters * @param callback The callback */ - listForManagementGroup(managementGroupId: string, filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForManagementGroup(managementGroupId: string, filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForManagementGroup(managementGroupId: string, options: Models.PolicyAssignmentsListForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, - filter, options }, listForManagementGroupOperationSpec, @@ -326,15 +320,16 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all - * policy assignments associated with the subscription, including those that apply directly or from - * management groups that contain the given subscription, as well as any applied to objects - * contained within the subscription. If $filter=atScope() is provided, the returned list includes - * all policy assignments that apply to the subscription, which is everything in the unfiltered - * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value}. + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the subscription, including + * those that apply directly or from management groups that contain the given subscription, as well + * as any applied to objects contained within the subscription. If $filter=atScope() is provided, + * the returned list includes all policy assignments that apply to the subscription, which is + * everything in the unfiltered list except those applied to objects contained within the + * subscription. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the subscription. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. * @param [options] The optional parameters * @returns Promise @@ -482,20 +477,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given resource * group in the given subscription that match the optional given $filter. Valid values for $filter - * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the - * unfiltered list includes all policy assignments associated with the resource group, including - * those that apply directly or apply from containing scopes, as well as any applied to resources - * contained within the resource group. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource group, which is everything in the - * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource group. + * are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not + * provided, the unfiltered list includes all policy assignments associated with the resource + * group, including those that apply directly or apply from containing scopes, as well as any + * applied to resources contained within the resource group. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource group, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource group. If $filter=atExactScope() is provided, the returned list only includes all + * policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForResourceGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -506,8 +503,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResourceGroupNext(nextPageLink: string, options: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -520,21 +517,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the specified * resource in the given resource group and subscription that match the optional given $filter. - * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is - * not provided, the unfiltered list includes all policy assignments associated with the resource, - * including those that apply directly or from all containing scopes, as well as any applied to - * resources contained within the resource. If $filter=atScope() is provided, the returned list - * includes all policy assignments that apply to the resource, which is everything in the - * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the resource. Three - * parameters plus the resource name are used to identify a specific resource. If the resource is - * not part of a parent resource (the more common case), the parent resource path should not be - * provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == - * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all - * parameters should be provided. For example a virtual machine DNS name could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments + * associated with the resource, including those that apply directly or from all containing scopes, + * as well as any applied to resources contained within the resource. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource, which is + * everything in the unfiltered list except those applied to resources contained within the + * resource. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the resource level. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value} + * that apply to the resource. Three parameters plus the resource name are used to identify a + * specific resource. If the resource is not part of a parent resource (the more common case), the + * parent resource path should not be provided (or provided as ''). For example a web app could be + * specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', + * {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent + * resource, then all parameters should be provided. For example a virtual machine DNS name could + * be specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', @@ -545,7 +543,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForResourceNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -556,8 +554,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForResourceNext(nextPageLink: string, options: Models.PolicyAssignmentsListForResourceNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -569,17 +567,19 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments applicable to the management group - * that match the given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId - * eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy - * assignments that are assigned to the management group or the management group's ancestors. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value} that apply to the management group. + * that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or + * 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes + * all policy assignments that are assigned to the management group or the management group's + * ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the management group. * @summary Retrieves all policy assignments that apply to a management group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listForManagementGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -590,8 +590,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - listForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listForManagementGroupNext(nextPageLink: string, options: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -603,21 +603,22 @@ export class PolicyAssignments { /** * This operation retrieves the list of all policy assignments associated with the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or - * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all - * policy assignments associated with the subscription, including those that apply directly or from - * management groups that contain the given subscription, as well as any applied to objects - * contained within the subscription. If $filter=atScope() is provided, the returned list includes - * all policy assignments that apply to the subscription, which is everything in the unfiltered - * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy - * assignments of the policy definition whose id is {value}. + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the subscription, including + * those that apply directly or from management groups that contain the given subscription, as well + * as any applied to objects contained within the subscription. If $filter=atScope() is provided, + * the returned list includes all policy assignments that apply to the subscription, which is + * everything in the unfiltered list except those applied to objects contained within the + * subscription. If $filter=atExactScope() is provided, the returned list only includes all policy + * assignments that at the subscription. If $filter=policyDefinitionId eq '{value}' is provided, + * the returned list includes all policy assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.PolicyAssignmentsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -628,8 +629,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.PolicyAssignmentsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.PolicyAssignmentsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -730,7 +731,8 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter0, + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ @@ -749,7 +751,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { const listForResourceOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", urlParameters: [ Parameters.resourceGroupName, Parameters.resourceProviderNamespace, @@ -759,7 +761,8 @@ const listForResourceOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter1, + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ @@ -778,12 +781,13 @@ const listForResourceOperationSpec: msRest.OperationSpec = { const listForManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.filter2, + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ @@ -807,7 +811,8 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.filter1, + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ @@ -908,6 +913,11 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -929,6 +939,11 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -950,6 +965,11 @@ const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -971,6 +991,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index b2d5d0e40635..4adbc0805470 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -253,12 +252,21 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given subscription. + * This operation retrieves a list of all the policy definitions in a given subscription that match + * the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq + * {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy definitions associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy definitions that at the given subscription. + * If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, + * Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only + * includes all policy definitions whose category match the {value}. * @summary Retrieves policy definitions in a subscription * @param [options] The optional parameters * @returns Promise */ - list(options?: msRest.RequestOptionsBase): Promise; + list(options?: Models.PolicyDefinitionsListOptionalParams): Promise; /** * @param callback The callback */ @@ -267,8 +275,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list(options: Models.PolicyDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicyDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -278,12 +286,16 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions that match the optional + * given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes + * all built-in policy definitions whose type match the {value}. Possible policyType values are + * NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the + * returned list only includes all built-in policy definitions whose category match the {value}. * @summary Retrieve built-in policy definitions * @param [options] The optional parameters * @returns Promise */ - listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + listBuiltIn(options?: Models.PolicyDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -292,8 +304,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltIn(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltIn(options: Models.PolicyDefinitionsListBuiltInOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: Models.PolicyDefinitionsListBuiltInOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -303,13 +315,23 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given management group. + * This operation retrieves a list of all the policy definitions in a given management group that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy definitions associated with the management group, including those that apply + * directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that + * at the given management group. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy definitions whose category match the + * {value}. * @summary Retrieve policy definitions in a management group * @param managementGroupId The ID of the management group. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback @@ -320,8 +342,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroup(managementGroupId: string, options: Models.PolicyDefinitionsListByManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, @@ -332,13 +354,22 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given subscription. + * This operation retrieves a list of all the policy definitions in a given subscription that match + * the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq + * {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy definitions associated with the subscription, including those that apply directly or + * from management groups that contain the given subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy definitions that at the given subscription. + * If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, + * Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only + * includes all policy definitions whose category match the {value}. * @summary Retrieves policy definitions in a subscription * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.PolicyDefinitionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -349,8 +380,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.PolicyDefinitionsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.PolicyDefinitionsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -361,13 +392,17 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the built-in policy definitions. + * This operation retrieves a list of all the built-in policy definitions that match the optional + * given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes + * all built-in policy definitions whose type match the {value}. Possible policyType values are + * NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the + * returned list only includes all built-in policy definitions whose category match the {value}. * @summary Retrieve built-in policy definitions * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listBuiltInNext(nextPageLink: string, options?: Models.PolicyDefinitionsListBuiltInNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -378,8 +413,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltInNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltInNext(nextPageLink: string, options: Models.PolicyDefinitionsListBuiltInNextOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: Models.PolicyDefinitionsListBuiltInNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -390,13 +425,23 @@ export class PolicyDefinitions { } /** - * This operation retrieves a list of all the policy definitions in a given management group. + * This operation retrieves a list of all the policy definitions in a given management group that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy definitions associated with the management group, including those that apply + * directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that + * at the given management group. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy definitions whose category match the + * {value}. * @summary Retrieve policy definitions in a management group * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -407,8 +452,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroupNext(nextPageLink: string, options: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -524,7 +569,7 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId @@ -555,7 +600,7 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId @@ -578,7 +623,7 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", urlParameters: [ Parameters.policyDefinitionName, Parameters.managementGroupId @@ -607,7 +652,9 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -627,7 +674,9 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policyDefinitions", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -645,12 +694,14 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -673,6 +724,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], @@ -694,6 +750,11 @@ const listBuiltInNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], @@ -715,6 +776,11 @@ const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 5cce445c14f0..1ecab81c469a 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -149,12 +148,21 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the policy set definitions in the given subscription. + * This operation retrieves a list of all the policy set definitions in a given subscription that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy set definitions associated with the subscription, including those that apply + * directly or from management groups that contain the given subscription. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy set definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the + * returned list only includes all policy set definitions whose category match the {value}. * @summary Retrieves the policy set definitions for a subscription. * @param [options] The optional parameters * @returns Promise */ - list(options?: msRest.RequestOptionsBase): Promise; + list(options?: Models.PolicySetDefinitionsListOptionalParams): Promise; /** * @param callback The callback */ @@ -163,8 +171,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + list(options: Models.PolicySetDefinitionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicySetDefinitionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -174,12 +182,14 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions that match the + * optional given $filter. If $filter='category -eq {value}' is provided, the returned list only + * includes all built-in policy set definitions whose category match the {value}. * @summary Retrieves built-in policy set definitions. * @param [options] The optional parameters * @returns Promise */ - listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + listBuiltIn(options?: Models.PolicySetDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -188,8 +198,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltIn(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltIn(options: Models.PolicySetDefinitionsListBuiltInOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: Models.PolicySetDefinitionsListBuiltInOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -305,14 +315,23 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the a policy set definition in the given management - * group. + * This operation retrieves a list of all the policy set definitions in a given management group + * that match the optional given $filter. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered + * list includes all policy set definitions associated with the management group, including those + * that apply directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given management group. If $filter='policyType -eq {value}' is provided, the + * returned list only includes all policy set definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy set definitions whose category match the + * {value}. * @summary Retrieves all policy set definitions in management group. * @param managementGroupId The ID of the management group. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback @@ -323,8 +342,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroup(managementGroupId: string, options: Models.PolicySetDefinitionsListByManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, @@ -335,13 +354,22 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the policy set definitions in the given subscription. + * This operation retrieves a list of all the policy set definitions in a given subscription that + * match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list + * includes all policy set definitions associated with the subscription, including those that apply + * directly or from management groups that contain the given subscription. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given subscription. If $filter='policyType -eq {value}' is provided, the returned + * list only includes all policy set definitions whose type match the {value}. Possible policyType + * values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is provided, the + * returned list only includes all policy set definitions whose category match the {value}. * @summary Retrieves the policy set definitions for a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -352,8 +380,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.PolicySetDefinitionsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -364,13 +392,15 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the built-in policy set definitions. + * This operation retrieves a list of all the built-in policy set definitions that match the + * optional given $filter. If $filter='category -eq {value}' is provided, the returned list only + * includes all built-in policy set definitions whose category match the {value}. * @summary Retrieves built-in policy set definitions. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listBuiltInNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListBuiltInNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -381,8 +411,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltInNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listBuiltInNext(nextPageLink: string, options: Models.PolicySetDefinitionsListBuiltInNextOptionalParams, callback: msRest.ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListBuiltInNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -393,14 +423,23 @@ export class PolicySetDefinitions { } /** - * This operation retrieves a list of all the a policy set definition in the given management - * group. + * This operation retrieves a list of all the policy set definitions in a given management group + * that match the optional given $filter. Valid values for $filter are: 'atExactScope()', + * 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered + * list includes all policy set definitions associated with the management group, including those + * that apply directly or from management groups that contain the given management group. If + * $filter=atExactScope() is provided, the returned list only includes all policy set definitions + * that at the given management group. If $filter='policyType -eq {value}' is provided, the + * returned list only includes all policy set definitions whose type match the {value}. Possible + * policyType values are NotSpecified, BuiltIn and Custom. If $filter='category -eq {value}' is + * provided, the returned list only includes all policy set definitions whose category match the + * {value}. * @summary Retrieves all policy set definitions in management group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise */ - listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -411,8 +450,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listByManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByManagementGroupNext(nextPageLink: string, options: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -536,7 +575,9 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -556,7 +597,9 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policySetDefinitions", queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -574,7 +617,7 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId @@ -608,7 +651,7 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId @@ -631,7 +674,7 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", urlParameters: [ Parameters.policySetDefinitionName, Parameters.managementGroupId @@ -655,12 +698,14 @@ const getAtManagementGroupOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", urlParameters: [ Parameters.managementGroupId ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.filter, + Parameters.top ], headerParameters: [ Parameters.acceptLanguage @@ -683,6 +728,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], @@ -704,6 +754,11 @@ const listBuiltInNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], @@ -725,6 +780,11 @@ const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index dc8f8dbde966..d6752f94dc11 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -17,6 +16,7 @@ import { PolicyClientContext } from "./policyClientContext"; class PolicyClient extends PolicyClientContext { // Operation groups + dataPolicyManifests: operations.DataPolicyManifests; policyAssignments: operations.PolicyAssignments; policyDefinitions: operations.PolicyDefinitions; policySetDefinitions: operations.PolicySetDefinitions; @@ -29,6 +29,7 @@ class PolicyClient extends PolicyClientContext { */ constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { super(credentials, subscriptionId, options); + this.dataPolicyManifests = new operations.DataPolicyManifests(this); this.policyAssignments = new operations.PolicyAssignments(this); this.policyDefinitions = new operations.PolicyDefinitions(this); this.policySetDefinitions = new operations.PolicySetDefinitions(this); diff --git a/sdk/policy/arm-policy/src/policyClientContext.ts b/sdk/policy/arm-policy/src/policyClientContext.ts index 60c107079f2e..df0e7d2aa33a 100644 --- a/sdk/policy/arm-policy/src/policyClientContext.ts +++ b/sdk/policy/arm-policy/src/policyClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -17,8 +16,8 @@ const packageVersion = "3.1.0"; export class PolicyClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; - subscriptionId: string; apiVersion?: string; + subscriptionId: string; /** * Initializes a new instance of the PolicyClient class. @@ -44,7 +43,7 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2019-09-01'; + this.apiVersion = '2020-09-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";