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..32799ed2efb9 --- /dev/null +++ b/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts @@ -0,0 +1,23 @@ +/* + * 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, + 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..e4a459446831 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.** @@ -59,305 +59,209 @@ export interface ErrorResponse { } /** - * The value of a parameter. + * 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 ParameterValuesValue { +export interface CloudError { /** - * The value of the parameter. + * The error object. */ - value?: any; + error?: ErrorDetail; } /** - * The policy sku. This property is optional, obsolete, and will be ignored. + * The custom resource function definition. */ -export interface PolicySku { +export interface DataManifestCustomResourceFunctionDefinition { /** - * The name of the policy sku. Possible values are A0 and A1. + * The function name as it will appear in the policy rule. eg - 'vault'. */ - name: string; + name?: string; /** - * The policy sku tier. Possible values are Free and Standard. + * The fully qualified control plane resource type that this function represents. eg - + * 'Microsoft.KeyVault/vaults'. */ - tier?: string; -} - -/** - * Identity for the resource. - */ -export interface Identity { + fullyQualifiedResourceType?: string; /** - * The principal ID of the resource identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly principalId?: string; - /** - * The tenant ID of the resource identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The top-level properties that can be selected on the function's output. eg - [ "name", + * "location" ] if vault().name and vault().location are supported */ - readonly tenantId?: string; + defaultProperties?: string[]; /** - * The identity type. This is the only required field when adding a system assigned identity to a - * resource. Possible values include: 'SystemAssigned', 'None' + * 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'). */ - type?: ResourceIdentityType; + allowCustomProperties?: boolean; } /** - * The policy assignment. + * The data effect definition. */ -export interface PolicyAssignment extends BaseResource { - /** - * The display name of the policy assignment. - */ - displayName?: string; - /** - * The ID of the policy definition or policy set definition being assigned. - */ - policyDefinitionId?: string; - /** - * The scope for the policy assignment. - */ - scope?: string; - /** - * The policy's excluded scopes. - */ - notScopes?: string[]; - /** - * The parameter values for the assigned policy rule. The keys are the parameter names. - */ - parameters?: { [propertyName: string]: ParameterValuesValue }; - /** - * This message will be part of response in case of policy violation. - */ - description?: string; - /** - * The policy assignment metadata. Metadata is an open ended object and is typically a collection - * of key value pairs. - */ - metadata?: any; - /** - * The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. Possible - * values include: 'Default', 'DoNotEnforce' - */ - enforcementMode?: EnforcementMode; - /** - * The ID of the policy assignment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The type of the policy assignment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; +export interface DataEffect { /** - * The name of the policy assignment. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The policy sku. This property is optional, obsolete, and will be ignored. + * The data effect name. */ - sku?: PolicySku; + name?: string; /** - * The location of the policy assignment. Only required when utilizing managed identity. + * The data effect details schema. */ - location?: string; - /** - * The managed identity associated with the policy assignment. - */ - identity?: Identity; + detailsSchema?: any; } /** - * General metadata for the parameter. + * The type of the pattern for an alias path. */ -export interface ParameterDefinitionsValueMetadata { +export interface AliasPattern { /** - * The display name for the parameter. + * The alias pattern phrase. */ - displayName?: string; + phrase?: string; /** - * The description of the parameter. + * The alias pattern variable. */ - description?: string; + variable?: string; /** - * Describes unknown properties. The value of an unknown property can be of "any" type. + * The type of alias pattern. Possible values include: 'NotSpecified', 'Extract' */ - [property: string]: any; + type?: AliasPatternType; } /** - * The definition of a parameter that can be provided to the policy. + * An interface representing AliasPathMetadata. */ -export interface ParameterDefinitionsValue { - /** - * The data type of the parameter. Possible values include: 'String', 'Array', 'Object', - * 'Boolean', 'Integer', 'Float', 'DateTime' - */ - type?: ParameterType; +export interface AliasPathMetadata { /** - * The allowed values for the parameter. - */ - allowedValues?: any[]; - /** - * The default value for the parameter if no value is provided. + * 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.** */ - defaultValue?: any; + readonly type?: AliasPathTokenType; /** - * General metadata for the parameter. + * 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.** */ - metadata?: ParameterDefinitionsValueMetadata; + readonly attributes?: AliasPathAttributes; } /** - * The policy definition. + * The type of the paths for alias. */ -export interface PolicyDefinition extends BaseResource { +export interface AliasPath { /** - * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. - * Possible values include: 'NotSpecified', 'BuiltIn', 'Custom', 'Static' + * The path of an alias. */ - policyType?: PolicyType; + path?: string; /** - * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + * The API versions. */ - mode?: string; + apiVersions?: string[]; /** - * The display name of the policy definition. + * The pattern for an alias path. */ - displayName?: string; + pattern?: AliasPattern; /** - * The policy definition description. + * 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.** */ - description?: string; + readonly metadata?: AliasPathMetadata; +} + +/** + * The alias type. + */ +export interface Alias { /** - * The policy rule. + * The alias name. */ - policyRule?: any; + name?: string; /** - * The policy definition metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. + * The paths for an alias. */ - metadata?: any; + paths?: AliasPath[]; /** - * The parameter definitions for parameters used in the policy rule. The keys are the parameter - * names. + * The type of the alias. Possible values include: 'NotSpecified', 'PlainText', 'Mask' */ - parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + type?: AliasType; /** - * The ID of the policy definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The default path for an alias. */ - readonly id?: string; + defaultPath?: string; /** - * The name of the policy definition. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The default pattern for an alias. */ - readonly name?: string; + defaultPattern?: AliasPattern; /** - * The type of the resource (Microsoft.Authorization/policyDefinitions). + * 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 type?: string; + readonly defaultMetadata?: AliasPathMetadata; } /** - * The policy definition reference. + * The resource type aliases definition. */ -export interface PolicyDefinitionReference { - /** - * The ID of the policy definition or policy set definition. - */ - policyDefinitionId: string; +export interface ResourceTypeAliases { /** - * The parameter values for the referenced policy rule. The keys are the parameter names. + * The resource type name. */ - parameters?: { [propertyName: string]: ParameterValuesValue }; + resourceType?: string; /** - * A unique id (within the policy set definition) for this policy definition reference. + * The aliases for property names. */ - policyDefinitionReferenceId?: string; - /** - * The name of the groups that this policy definition reference belongs to. - */ - groupNames?: string[]; + aliases?: Alias[]; } /** - * The policy definition group. + * The data policy manifest. */ -export interface PolicyDefinitionGroup { - /** - * The name of the group. - */ - name: string; - /** - * The group's display name. - */ - displayName?: string; - /** - * The group's category. - */ - category?: string; +export interface DataPolicyManifest extends BaseResource { /** - * The group's description. + * The list of namespaces for the data policy manifest. */ - description?: string; + namespaces?: string[]; /** - * A resource ID of a resource that contains additional metadata about the group. + * The policy mode of the data policy manifest. */ - additionalMetadataId?: string; -} - -/** - * The policy set definition. - */ -export interface PolicySetDefinition extends BaseResource { + policyMode?: string; /** - * The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. - * Possible values include: 'NotSpecified', 'BuiltIn', 'Custom', 'Static' + * A value indicating whether policy mode is allowed only in built-in definitions. */ - policyType?: PolicyType; + isBuiltInOnly?: boolean; /** - * The display name of the policy set definition. + * An array of resource type aliases. */ - displayName?: string; + resourceTypeAliases?: ResourceTypeAliases[]; /** - * The policy set definition description. + * The effect definition. */ - description?: string; + effects?: DataEffect[]; /** - * The policy set definition metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. + * The non-alias field accessor values that can be used in the policy rule. */ - metadata?: any; + fieldValues?: string[]; /** - * The policy set definition parameters that can be used in policy definition references. + * The standard resource functions (subscription and/or resourceGroup). */ - parameters?: { [propertyName: string]: ParameterDefinitionsValue }; + standard?: string[]; /** - * An array of policy definition references. + * An array of data manifest custom resource definition. */ - policyDefinitions: PolicyDefinitionReference[]; + custom?: DataManifestCustomResourceFunctionDefinition[]; /** - * The metadata describing groups of policy definition references within the policy set - * definition. - */ - policyDefinitionGroups?: PolicyDefinitionGroup[]; - /** - * The ID of the policy set definition. + * 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 policy set definition. + * 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/policySetDefinitions). + * 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; @@ -366,21 +270,12 @@ export interface PolicySetDefinition extends BaseResource { /** * 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. - */ - filter?: string; -} - -/** - * Optional Parameters. - */ -export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { +export interface DataPolicyManifestsListOptionalParams 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: "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; } @@ -388,10 +283,12 @@ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.R /** * Optional Parameters. */ -export interface PolicyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { +export interface DataPolicyManifestsListNextOptionalParams 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: "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; } @@ -405,34 +302,10 @@ export interface PolicyClientOptions extends AzureServiceClientOptions { /** * @interface - * List of policy assignments. - * @extends Array - */ -export interface PolicyAssignmentListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * List of policy definitions. - * @extends Array - */ -export interface PolicyDefinitionListResult extends Array { - /** - * The URL to use for getting the next set of results. - */ - nextLink?: string; -} - -/** - * @interface - * List of policy set definitions. - * @extends Array + * List of data policy manifests. + * @extends Array */ -export interface PolicySetDefinitionListResult extends Array { +export interface DataPolicyManifestListResult extends Array { /** * The URL to use for getting the next set of results. */ @@ -440,141 +313,42 @@ 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..c1330166d2c2 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -1,13 +1,10 @@ /* - * 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 "./policyAssignments"; -export * from "./policyDefinitions"; -export * from "./policySetDefinitions"; +export * from "./dataPolicyManifests"; diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index dc8f8dbde966..9a0b35a66f0b 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,21 +16,16 @@ import { PolicyClientContext } from "./policyClientContext"; class PolicyClient extends PolicyClientContext { // Operation groups - policyAssignments: operations.PolicyAssignments; - policyDefinitions: operations.PolicyDefinitions; - policySetDefinitions: operations.PolicySetDefinitions; + dataPolicyManifests: operations.DataPolicyManifests; /** * Initializes a new instance of the PolicyClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { - super(credentials, subscriptionId, options); - this.policyAssignments = new operations.PolicyAssignments(this); - this.policyDefinitions = new operations.PolicyDefinitions(this); - this.policySetDefinitions = new operations.PolicySetDefinitions(this); + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyClientOptions) { + super(credentials, options); + this.dataPolicyManifests = new operations.DataPolicyManifests(this); } } diff --git a/sdk/policy/arm-policy/src/policyClientContext.ts b/sdk/policy/arm-policy/src/policyClientContext.ts index 60c107079f2e..da05318c48ff 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,22 +16,17 @@ const packageVersion = "3.1.0"; export class PolicyClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; - subscriptionId: string; apiVersion?: string; /** * Initializes a new instance of the PolicyClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.PolicyClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } if (!options) { options = {}; @@ -44,13 +38,12 @@ 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"; this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; - this.subscriptionId = subscriptionId; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage;