From 1de51a741a945f83b7a202c035be5441904f5340 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 4 Oct 2021 19:27:39 +0000 Subject: [PATCH] CodeGen from PR 16273 in Azure/azure-rest-api-specs Merge c34f7ce2c62b4628ca680e6b8bf7ca80cc2355a2 into d07fa4ac0a84f6ae2a367fc79fa53a2ef74b41bf --- sdk/policy/arm-policy/README.md | 8 +- sdk/policy/arm-policy/package.json | 2 +- sdk/policy/arm-policy/rollup.config.js | 10 +- .../src/models/dataPolicyManifestsMappers.ts | 2 + sdk/policy/arm-policy/src/models/index.ts | 1465 ++++++++++------- sdk/policy/arm-policy/src/models/mappers.ts | 294 +++- .../arm-policy/src/models/parameters.ts | 38 +- .../src/models/policyAssignmentsMappers.ts | 3 + .../src/models/policyDefinitionsMappers.ts | 2 + .../src/models/policyExemptionsMappers.ts | 2 + .../src/models/policyPricingsMappers.ts | 38 + .../src/models/policySetDefinitionsMappers.ts | 2 + .../src/operations/dataPolicyManifests.ts | 105 +- sdk/policy/arm-policy/src/operations/index.ts | 1 + .../src/operations/policyAssignments.ts | 744 ++++----- .../src/operations/policyDefinitions.ts | 527 +++--- .../src/operations/policyExemptions.ts | 482 ++---- .../src/operations/policyPricings.ts | 448 +++++ .../src/operations/policySetDefinitions.ts | 527 +++--- sdk/policy/arm-policy/src/policyClient.ts | 16 +- .../arm-policy/src/policyClientContext.ts | 19 +- 21 files changed, 2675 insertions(+), 2060 deletions(-) create mode 100644 sdk/policy/arm-policy/src/models/policyPricingsMappers.ts create mode 100644 sdk/policy/arm-policy/src/operations/policyPricings.ts diff --git a/sdk/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index e981a8c714fe..5de9cda3541e 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -1,11 +1,11 @@ ## Azure PolicyClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for PolicyClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for PolicyClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-policy @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and getByPolicyMode dataPolicyManifests as an example written in JavaScript. ##### Sample code @@ -86,7 +84,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmPolicy.PolicyClient(creds, subscriptionId); const policyMode = "testpolicyMode"; diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 7d32170e0d5a..2a16b1506995 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/policy/arm-policy", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/policy/arm-policy", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/policy/arm-policy/rollup.config.js b/sdk/policy/arm-policy/rollup.config.js index 24c1a68e6916..156fb323dbb5 100644 --- a/sdk/policy/arm-policy/rollup.config.js +++ b/sdk/policy/arm-policy/rollup.config.js @@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps"; */ const config = { input: "./esm/policyClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-policy.js", format: "umd", @@ -25,7 +28,10 @@ const config = { * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] }; export default config; diff --git a/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts b/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts index 773d4f678d42..e955df13e51f 100644 --- a/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts +++ b/sdk/policy/arm-policy/src/models/dataPolicyManifestsMappers.ts @@ -20,6 +20,7 @@ export { ErrorAdditionalInfo, ErrorResponse, Identity, + IdentityUserAssignedIdentitiesValue, NonComplianceMessage, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -29,6 +30,7 @@ export { PolicyDefinitionGroup, PolicyDefinitionReference, PolicyExemption, + PolicyPricing, PolicySetDefinition, ResourceTypeAliases, SystemData diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 7869c5eb0734..43c963a0feb4 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -286,24 +286,81 @@ export interface NonComplianceMessage { } /** - * Identity for the resource. + * An interface representing IdentityUserAssignedIdentitiesValue. + */ +export interface IdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + +/** + * Identity for the resource. Policy assignments support a maximum of one identity. That is + * either a system assigned identity or a single user assigned identity. */ export interface Identity { /** - * The principal ID of the resource identity. + * The principal ID of the resource identity. This property will only be provided for a system + * assigned identity * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly principalId?: string; /** - * The tenant ID of the resource identity. + * The tenant ID of the resource identity. This property will only be provided for a system + * assigned identity * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tenantId?: string; /** - * The identity type. This is the only required field when adding a system assigned identity to a - * resource. Possible values include: 'SystemAssigned', 'None' + * The identity type. This is the only required field when adding a system or user assigned + * identity to a resource. Possible values include: 'SystemAssigned', 'UserAssigned', 'None' */ type?: ResourceIdentityType; + /** + * The user identity associated with the policy. The user identity dictionary key references will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: IdentityUserAssignedIdentitiesValue }; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; } /** @@ -372,6 +429,25 @@ export interface PolicyAssignment extends BaseResource { * The managed identity associated with the policy assignment. */ identity?: Identity; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * An interface representing PolicyAssignmentUpdate. + */ +export interface PolicyAssignmentUpdate { + /** + * The location of the policy assignment. Only required when utilizing managed identity. + */ + location?: string; + /** + * The managed identity associated with the policy assignment. + */ + identity?: Identity; } /** @@ -477,6 +553,11 @@ export interface PolicyDefinition extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** @@ -577,38 +658,11 @@ export interface PolicySetDefinition extends BaseResource { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; -} - -/** - * Metadata pertaining to creation and last modification of the resource. - */ -export interface SystemData { - /** - * The identity that created the resource. - */ - createdBy?: string; - /** - * The type of identity that created the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ - createdByType?: CreatedByType; - /** - * The timestamp of resource creation (UTC). - */ - createdAt?: Date; - /** - * The identity that last modified the resource. - */ - lastModifiedBy?: string; - /** - * The type of identity that last modified the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' - */ - lastModifiedByType?: CreatedByType; /** - * The timestamp of resource last modification (UTC) + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - lastModifiedAt?: Date; + readonly systemData?: SystemData; } /** @@ -669,6 +723,43 @@ export interface PolicyExemption extends BaseResource { readonly type?: string; } +/** + * The policy pricing. + */ +export interface PolicyPricing extends BaseResource { + /** + * The policy pricing tier. Possible values are Advanced and Defender. Possible values include: + * 'Advanced', 'Defender' + */ + pricingTier: PricingTier; + /** + * The provisioning state of the policy pricing resource. Possible values include: 'Accepted', + * 'Succeeded', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * The ID of the policy pricing. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the policy pricing. + * **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/policyPricings). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + /** * Optional Parameters. */ @@ -698,8 +789,7 @@ export interface DataPolicyManifestsListNextOptionalParams extends msRest.Reques /** * Optional Parameters. */ -export interface PolicyAssignmentsListForResourceGroupOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyAssignmentsListForResourceGroupOptionalParams 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 @@ -743,8 +833,7 @@ export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.R /** * Optional Parameters. */ -export interface PolicyAssignmentsListForManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -788,8 +877,7 @@ export interface PolicyAssignmentsListOptionalParams extends msRest.RequestOptio /** * Optional Parameters. */ -export interface PolicyAssignmentsListForResourceGroupNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -811,8 +899,7 @@ export interface PolicyAssignmentsListForResourceGroupNextOptionalParams /** * Optional Parameters. */ -export interface PolicyAssignmentsListForResourceNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -834,8 +921,7 @@ export interface PolicyAssignmentsListForResourceNextOptionalParams /** * Optional Parameters. */ -export interface PolicyAssignmentsListForManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -923,8 +1009,7 @@ export interface PolicyDefinitionsListBuiltInOptionalParams extends msRest.Reque /** * Optional Parameters. */ -export interface PolicyDefinitionsListByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -990,8 +1075,7 @@ export interface PolicyDefinitionsListBuiltInNextOptionalParams extends msRest.R /** * Optional Parameters. */ -export interface PolicyDefinitionsListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -1057,8 +1141,7 @@ export interface PolicySetDefinitionsListBuiltInOptionalParams extends msRest.Re /** * Optional Parameters. */ -export interface PolicySetDefinitionsListByManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -1102,8 +1185,7 @@ export interface PolicySetDefinitionsListNextOptionalParams extends msRest.Reque /** * Optional Parameters. */ -export interface PolicySetDefinitionsListBuiltInNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -1125,8 +1207,7 @@ export interface PolicySetDefinitionsListBuiltInNextOptionalParams /** * Optional Parameters. */ -export interface PolicySetDefinitionsListByManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +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 @@ -1169,8 +1250,7 @@ export interface PolicyExemptionsListOptionalParams extends msRest.RequestOption /** * Optional Parameters. */ -export interface PolicyExemptionsListForResourceGroupOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyExemptionsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { /** * The filter to apply on the operation. Valid values for $filter are: 'atScope()', * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not @@ -1212,8 +1292,7 @@ export interface PolicyExemptionsListForResourceOptionalParams extends msRest.Re /** * Optional Parameters. */ -export interface PolicyExemptionsListForManagementGroupOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyExemptionsListForManagementGroupOptionalParams extends msRest.RequestOptionsBase { /** * The filter to apply on the operation. Valid values for $filter are: 'atScope()', * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not @@ -1255,8 +1334,7 @@ export interface PolicyExemptionsListNextOptionalParams extends msRest.RequestOp /** * Optional Parameters. */ -export interface PolicyExemptionsListForResourceGroupNextOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyExemptionsListForResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { /** * The filter to apply on the operation. Valid values for $filter are: 'atScope()', * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not @@ -1277,8 +1355,7 @@ export interface PolicyExemptionsListForResourceGroupNextOptionalParams /** * Optional Parameters. */ -export interface PolicyExemptionsListForResourceNextOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyExemptionsListForResourceNextOptionalParams extends msRest.RequestOptionsBase { /** * The filter to apply on the operation. Valid values for $filter are: 'atScope()', * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not @@ -1299,8 +1376,7 @@ export interface PolicyExemptionsListForResourceNextOptionalParams /** * Optional Parameters. */ -export interface PolicyExemptionsListForManagementGroupNextOptionalParams - extends msRest.RequestOptionsBase { +export interface PolicyExemptionsListForManagementGroupNextOptionalParams extends msRest.RequestOptionsBase { /** * The filter to apply on the operation. Valid values for $filter are: 'atScope()', * 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not @@ -1325,6 +1401,20 @@ export interface PolicyClientOptions extends AzureServiceClientOptions { baseUri?: string; } +/** + * Defines headers for Delete operation. + */ +export interface PolicyPricingsDeleteHeaders { + /** + * URL to get status of this long-running operation. + */ + location: string; + /** + * Number of seconds to wait before polling for status. + */ + retryAfter: string; +} + /** * @interface * List of data policy manifests. @@ -1386,13 +1476,26 @@ export interface PolicyExemptionListResult extends Array { readonly nextLink?: string; } +/** + * @interface + * List of policy pricings. + * @extends Array + */ +export interface PolicyPricingListResult extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + /** * Defines values for AliasPatternType. * Possible values include: 'NotSpecified', 'Extract' * @readonly * @enum {string} */ -export type AliasPatternType = "NotSpecified" | "Extract"; +export type AliasPatternType = 'NotSpecified' | 'Extract'; /** * Defines values for AliasPathTokenType. @@ -1401,15 +1504,7 @@ export type AliasPatternType = "NotSpecified" | "Extract"; * @readonly * @enum {string} */ -export type AliasPathTokenType = - | "NotSpecified" - | "Any" - | "String" - | "Object" - | "Array" - | "Integer" - | "Number" - | "Boolean"; +export type AliasPathTokenType = 'NotSpecified' | 'Any' | 'String' | 'Object' | 'Array' | 'Integer' | 'Number' | 'Boolean'; /** * Defines values for AliasPathAttributes. @@ -1417,7 +1512,7 @@ export type AliasPathTokenType = * @readonly * @enum {string} */ -export type AliasPathAttributes = "None" | "Modifiable"; +export type AliasPathAttributes = 'None' | 'Modifiable'; /** * Defines values for AliasType. @@ -1425,7 +1520,7 @@ export type AliasPathAttributes = "None" | "Modifiable"; * @readonly * @enum {string} */ -export type AliasType = "NotSpecified" | "PlainText" | "Mask"; +export type AliasType = 'NotSpecified' | 'PlainText' | 'Mask'; /** * Defines values for EnforcementMode. @@ -1433,15 +1528,23 @@ export type AliasType = "NotSpecified" | "PlainText" | "Mask"; * @readonly * @enum {string} */ -export type EnforcementMode = "Default" | "DoNotEnforce"; +export type EnforcementMode = 'Default' | 'DoNotEnforce'; /** * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'None' + * Possible values include: 'SystemAssigned', 'UserAssigned', 'None' * @readonly * @enum {string} */ -export type ResourceIdentityType = "SystemAssigned" | "None"; +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'None'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; /** * Defines values for PolicyType. @@ -1449,7 +1552,7 @@ export type ResourceIdentityType = "SystemAssigned" | "None"; * @readonly * @enum {string} */ -export type PolicyType = "NotSpecified" | "BuiltIn" | "Custom" | "Static"; +export type PolicyType = 'NotSpecified' | 'BuiltIn' | 'Custom' | 'Static'; /** * Defines values for ParameterType. @@ -1457,14 +1560,7 @@ export type PolicyType = "NotSpecified" | "BuiltIn" | "Custom" | "Static"; * @readonly * @enum {string} */ -export type ParameterType = - | "String" - | "Array" - | "Object" - | "Boolean" - | "Integer" - | "Float" - | "DateTime"; +export type ParameterType = 'String' | 'Array' | 'Object' | 'Boolean' | 'Integer' | 'Float' | 'DateTime'; /** * Defines values for ExemptionCategory. @@ -1472,15 +1568,23 @@ export type ParameterType = * @readonly * @enum {string} */ -export type ExemptionCategory = "Waiver" | "Mitigated"; +export type ExemptionCategory = 'Waiver' | 'Mitigated'; /** - * Defines values for CreatedByType. - * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * Defines values for PricingTier. + * Possible values include: 'Advanced', 'Defender' * @readonly * @enum {string} */ -export type CreatedByType = "User" | "Application" | "ManagedIdentity" | "Key"; +export type PricingTier = 'Advanced' | 'Defender'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Accepted', 'Succeeded', 'Deleting' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Accepted' | 'Succeeded' | 'Deleting'; /** * Contains response data for the getByPolicyMode operation. @@ -1490,16 +1594,16 @@ export type DataPolicyManifestsGetByPolicyModeResponse = DataPolicyManifest & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataPolicyManifest; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataPolicyManifest; + }; }; /** @@ -1510,16 +1614,16 @@ export type DataPolicyManifestsListResponse = DataPolicyManifestListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataPolicyManifestListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataPolicyManifestListResult; + }; }; /** @@ -1530,16 +1634,16 @@ export type DataPolicyManifestsListNextResponse = DataPolicyManifestListResult & * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DataPolicyManifestListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DataPolicyManifestListResult; + }; }; /** @@ -1550,16 +1654,16 @@ export type PolicyAssignmentsDeleteMethodResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1570,16 +1674,16 @@ export type PolicyAssignmentsCreateResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1590,16 +1694,36 @@ export type PolicyAssignmentsGetResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PolicyAssignmentsUpdateResponse = PolicyAssignment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1610,16 +1734,16 @@ export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentList * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1630,16 +1754,16 @@ export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResul * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1650,16 +1774,16 @@ export type PolicyAssignmentsListForManagementGroupResponse = PolicyAssignmentLi * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1670,16 +1794,16 @@ export type PolicyAssignmentsListResponse = PolicyAssignmentListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1690,16 +1814,16 @@ export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1710,16 +1834,16 @@ export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1730,16 +1854,36 @@ export type PolicyAssignmentsGetByIdResponse = PolicyAssignment & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignment; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; +}; + +/** + * Contains response data for the updateById operation. + */ +export type PolicyAssignmentsUpdateByIdResponse = PolicyAssignment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignment; + }; }; /** @@ -1750,16 +1894,16 @@ export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignment * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1770,16 +1914,16 @@ export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListR * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1790,16 +1934,16 @@ export type PolicyAssignmentsListForManagementGroupNextResponse = PolicyAssignme * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1810,16 +1954,16 @@ export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyAssignmentListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyAssignmentListResult; + }; }; /** @@ -1830,16 +1974,16 @@ export type PolicyDefinitionsCreateOrUpdateResponse = PolicyDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinition; + }; }; /** @@ -1850,16 +1994,16 @@ export type PolicyDefinitionsGetResponse = PolicyDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinition; + }; }; /** @@ -1870,16 +2014,16 @@ export type PolicyDefinitionsGetBuiltInResponse = PolicyDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinition; + }; }; /** @@ -1890,16 +2034,16 @@ export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicyDef * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinition; + }; }; /** @@ -1910,16 +2054,16 @@ export type PolicyDefinitionsGetAtManagementGroupResponse = PolicyDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinition; + }; }; /** @@ -1930,16 +2074,16 @@ export type PolicyDefinitionsListResponse = PolicyDefinitionListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -1950,16 +2094,16 @@ export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult & * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -1970,16 +2114,16 @@ export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionLis * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -1990,16 +2134,16 @@ export type PolicyDefinitionsListNextResponse = PolicyDefinitionListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -2010,16 +2154,16 @@ export type PolicyDefinitionsListBuiltInNextResponse = PolicyDefinitionListResul * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -2030,16 +2174,16 @@ export type PolicyDefinitionsListByManagementGroupNextResponse = PolicyDefinitio * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyDefinitionListResult; + }; }; /** @@ -2050,16 +2194,16 @@ export type PolicySetDefinitionsCreateOrUpdateResponse = PolicySetDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinition; + }; }; /** @@ -2070,16 +2214,16 @@ export type PolicySetDefinitionsGetResponse = PolicySetDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinition; + }; }; /** @@ -2090,16 +2234,16 @@ export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinition; + }; }; /** @@ -2110,16 +2254,16 @@ export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2130,16 +2274,16 @@ export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListRes * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2150,16 +2294,16 @@ export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = Policy * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinition; + }; }; /** @@ -2170,16 +2314,16 @@ export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefiniti * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinition; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinition; + }; }; /** @@ -2190,16 +2334,16 @@ export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinit * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2210,16 +2354,16 @@ export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2230,16 +2374,16 @@ export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionLis * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2250,16 +2394,16 @@ export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDef * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicySetDefinitionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicySetDefinitionListResult; + }; }; /** @@ -2270,16 +2414,16 @@ export type PolicyExemptionsCreateOrUpdateResponse = PolicyExemption & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemption; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemption; + }; }; /** @@ -2290,16 +2434,16 @@ export type PolicyExemptionsGetResponse = PolicyExemption & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemption; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemption; + }; }; /** @@ -2310,16 +2454,16 @@ export type PolicyExemptionsListResponse = PolicyExemptionListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2330,16 +2474,16 @@ export type PolicyExemptionsListForResourceGroupResponse = PolicyExemptionListRe * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2350,16 +2494,16 @@ export type PolicyExemptionsListForResourceResponse = PolicyExemptionListResult * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2370,16 +2514,16 @@ export type PolicyExemptionsListForManagementGroupResponse = PolicyExemptionList * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2390,16 +2534,16 @@ export type PolicyExemptionsListNextResponse = PolicyExemptionListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2410,16 +2554,16 @@ export type PolicyExemptionsListForResourceGroupNextResponse = PolicyExemptionLi * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2430,16 +2574,16 @@ export type PolicyExemptionsListForResourceNextResponse = PolicyExemptionListRes * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; }; /** @@ -2450,14 +2594,169 @@ export type PolicyExemptionsListForManagementGroupNextResponse = PolicyExemption * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PolicyExemptionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyExemptionListResult; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type PolicyPricingsDeleteResponse = PolicyPricingsDeleteHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PolicyPricingsDeleteHeaders; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PolicyPricingsCreateOrUpdateResponse = PolicyPricing & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricing; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PolicyPricingsGetResponse = PolicyPricing & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricing; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicyPricingsListResponse = PolicyPricingListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricingListResult; + }; +}; + +/** + * Contains response data for the listForManagementGroup operation. + */ +export type PolicyPricingsListForManagementGroupResponse = PolicyPricingListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricingListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type PolicyPricingsBeginCreateOrUpdateResponse = PolicyPricing & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricing; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicyPricingsListNextResponse = PolicyPricingListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricingListResult; + }; +}; + +/** + * Contains response data for the listForManagementGroupNext operation. + */ +export type PolicyPricingsListForManagementGroupNextResponse = PolicyPricingListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PolicyPricingListResult; + }; }; diff --git a/sdk/policy/arm-policy/src/models/mappers.ts b/sdk/policy/arm-policy/src/models/mappers.ts index 5d65cc75eb5f..7c71ab90d3e9 100644 --- a/sdk/policy/arm-policy/src/models/mappers.ts +++ b/sdk/policy/arm-policy/src/models/mappers.ts @@ -176,7 +176,10 @@ export const AliasPattern: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["NotSpecified", "Extract"] + allowedValues: [ + "NotSpecified", + "Extract" + ] } } } @@ -277,7 +280,11 @@ export const Alias: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["NotSpecified", "PlainText", "Mask"] + allowedValues: [ + "NotSpecified", + "PlainText", + "Mask" + ] } }, defaultPath: { @@ -484,6 +491,30 @@ export const NonComplianceMessage: msRest.CompositeMapper = { } }; +export const IdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "Identity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "IdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + export const Identity: msRest.CompositeMapper = { serializedName: "Identity", type: { @@ -508,7 +539,69 @@ export const Identity: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["SystemAssigned", "None"] + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "IdentityUserAssignedIdentitiesValue" + } + } + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" } } } @@ -577,7 +670,7 @@ export const PolicyAssignment: msRest.CompositeMapper = { }, enforcementMode: { serializedName: "properties.enforcementMode", - defaultValue: "Default", + defaultValue: 'Default', type: { name: "String" } @@ -615,6 +708,37 @@ export const PolicyAssignment: msRest.CompositeMapper = { name: "String" } }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const PolicyAssignmentUpdate: msRest.CompositeMapper = { + serializedName: "PolicyAssignmentUpdate", + type: { + name: "Composite", + className: "PolicyAssignmentUpdate", + modelProperties: { location: { serializedName: "location", type: { @@ -730,7 +854,7 @@ export const PolicyDefinition: msRest.CompositeMapper = { }, mode: { serializedName: "properties.mode", - defaultValue: "Indexed", + defaultValue: 'Indexed', type: { name: "String" } @@ -791,6 +915,14 @@ export const PolicyDefinition: msRest.CompositeMapper = { type: { name: "String" } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -970,51 +1102,13 @@ export const PolicySetDefinition: msRest.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const SystemData: msRest.CompositeMapper = { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String" - } - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + systemData: { + readOnly: true, + serializedName: "systemData", type: { - name: "DateTime" + name: "Composite", + className: "SystemData" } } } @@ -1109,6 +1203,81 @@ export const PolicyExemption: msRest.CompositeMapper = { } }; +export const PolicyPricing: msRest.CompositeMapper = { + serializedName: "PolicyPricing", + type: { + name: "Composite", + className: "PolicyPricing", + modelProperties: { + pricingTier: { + required: true, + serializedName: "properties.pricingTier", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyPricingsDeleteHeaders: msRest.CompositeMapper = { + serializedName: "policypricings-delete-headers", + type: { + name: "Composite", + className: "PolicyPricingsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + } + } + } +}; + export const DataPolicyManifestListResult: msRest.CompositeMapper = { serializedName: "DataPolicyManifestListResult", type: { @@ -1249,3 +1418,32 @@ export const PolicyExemptionListResult: msRest.CompositeMapper = { } } }; + +export const PolicyPricingListResult: msRest.CompositeMapper = { + serializedName: "PolicyPricingListResult", + type: { + name: "Composite", + className: "PolicyPricingListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyPricing" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/policy/arm-policy/src/models/parameters.ts b/sdk/policy/arm-policy/src/models/parameters.ts index a9a001b4fb46..a6d3e8039139 100644 --- a/sdk/policy/arm-policy/src/models/parameters.ts +++ b/sdk/policy/arm-policy/src/models/parameters.ts @@ -13,7 +13,7 @@ export const acceptLanguage: msRest.OperationParameter = { parameterPath: "acceptLanguage", mapper: { serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: 'en-US', type: { name: "String" } @@ -25,7 +25,7 @@ export const apiVersion0: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: "2020-09-01", + defaultValue: '2020-09-01', type: { name: "String" } @@ -37,14 +37,29 @@ export const apiVersion1: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: "2020-07-01-preview", + defaultValue: '2021-06-01', + type: { + name: "String" + } + } +}; +export const apiVersion2: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2021-07-01', type: { name: "String" } } }; export const filter: msRest.OperationQueryParameter = { - parameterPath: ["options", "filter"], + parameterPath: [ + "options", + "filter" + ], mapper: { serializedName: "$filter", type: { @@ -136,6 +151,16 @@ export const policyMode: msRest.OperationURLParameter = { } } }; +export const policyPricingName: msRest.OperationURLParameter = { + parameterPath: "policyPricingName", + mapper: { + required: true, + serializedName: "policyPricingName", + type: { + name: "String" + } + } +}; export const policySetDefinitionName: msRest.OperationURLParameter = { parameterPath: "policySetDefinitionName", mapper: { @@ -214,7 +239,10 @@ export const subscriptionId: msRest.OperationURLParameter = { } }; export const top: msRest.OperationQueryParameter = { - parameterPath: ["options", "top"], + parameterPath: [ + "options", + "top" + ], mapper: { serializedName: "$top", constraints: { diff --git a/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts b/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts index b12434787b8d..db8b52dac01e 100644 --- a/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policyAssignmentsMappers.ts @@ -19,16 +19,19 @@ export { ErrorAdditionalInfo, ErrorResponse, Identity, + IdentityUserAssignedIdentitiesValue, NonComplianceMessage, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, ParameterValuesValue, PolicyAssignment, PolicyAssignmentListResult, + PolicyAssignmentUpdate, PolicyDefinition, PolicyDefinitionGroup, PolicyDefinitionReference, PolicyExemption, + PolicyPricing, PolicySetDefinition, ResourceTypeAliases, SystemData diff --git a/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts b/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts index a3fd3a9803f4..461ca4fae400 100644 --- a/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policyDefinitionsMappers.ts @@ -19,6 +19,7 @@ export { ErrorAdditionalInfo, ErrorResponse, Identity, + IdentityUserAssignedIdentitiesValue, NonComplianceMessage, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -29,6 +30,7 @@ export { PolicyDefinitionListResult, PolicyDefinitionReference, PolicyExemption, + PolicyPricing, PolicySetDefinition, ResourceTypeAliases, SystemData diff --git a/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts b/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts index bcd80c1df0e2..5ce1adea287a 100644 --- a/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policyExemptionsMappers.ts @@ -19,6 +19,7 @@ export { ErrorAdditionalInfo, ErrorResponse, Identity, + IdentityUserAssignedIdentitiesValue, NonComplianceMessage, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -29,6 +30,7 @@ export { PolicyDefinitionReference, PolicyExemption, PolicyExemptionListResult, + PolicyPricing, PolicySetDefinition, ResourceTypeAliases, SystemData diff --git a/sdk/policy/arm-policy/src/models/policyPricingsMappers.ts b/sdk/policy/arm-policy/src/models/policyPricingsMappers.ts new file mode 100644 index 000000000000..a69d14327df3 --- /dev/null +++ b/sdk/policy/arm-policy/src/models/policyPricingsMappers.ts @@ -0,0 +1,38 @@ +/* + * 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, + ErrorAdditionalInfo, + ErrorResponse, + Identity, + IdentityUserAssignedIdentitiesValue, + NonComplianceMessage, + ParameterDefinitionsValue, + ParameterDefinitionsValueMetadata, + ParameterValuesValue, + PolicyAssignment, + PolicyDefinition, + PolicyDefinitionGroup, + PolicyDefinitionReference, + PolicyExemption, + PolicyPricing, + PolicyPricingListResult, + PolicyPricingsDeleteHeaders, + PolicySetDefinition, + ResourceTypeAliases, + SystemData +} from "../models/mappers"; diff --git a/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts b/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts index 02ef9565058b..7196e2152bb9 100644 --- a/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts +++ b/sdk/policy/arm-policy/src/models/policySetDefinitionsMappers.ts @@ -19,6 +19,7 @@ export { ErrorAdditionalInfo, ErrorResponse, Identity, + IdentityUserAssignedIdentitiesValue, NonComplianceMessage, ParameterDefinitionsValue, ParameterDefinitionsValueMetadata, @@ -28,6 +29,7 @@ export { PolicyDefinitionGroup, PolicyDefinitionReference, PolicyExemption, + PolicyPricing, PolicySetDefinition, PolicySetDefinitionListResult, ResourceTypeAliases, diff --git a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts index 1b303f4dfae0..ce84e7431a6f 100644 --- a/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts +++ b/sdk/policy/arm-policy/src/operations/dataPolicyManifests.ts @@ -32,41 +32,26 @@ export class DataPolicyManifests { * @param [options] The optional parameters * @returns Promise */ - getByPolicyMode( - policyMode: string, - options?: msRest.RequestOptionsBase - ): Promise; + 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; + 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 { + 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; + callback) as Promise; } /** @@ -79,9 +64,7 @@ export class DataPolicyManifests { * @param [options] The optional parameters * @returns Promise */ - list( - options?: Models.DataPolicyManifestsListOptionalParams - ): Promise; + list(options?: Models.DataPolicyManifestsListOptionalParams): Promise; /** * @param callback The callback */ @@ -90,23 +73,14 @@ export class DataPolicyManifests { * @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 { + 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; + callback) as Promise; } /** @@ -120,43 +94,26 @@ export class DataPolicyManifests { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: Models.DataPolicyManifestsListNextOptionalParams - ): 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; + 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 { + 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; + callback) as Promise; } } @@ -165,9 +122,15 @@ const serializer = new msRest.Serializer(Mappers); const getByPolicyModeOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}", - urlParameters: [Parameters.policyMode], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policyMode + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.DataPolicyManifest @@ -182,8 +145,13 @@ const getByPolicyModeOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/dataPolicyManifests", - queryParameters: [Parameters.apiVersion0, Parameters.filter], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion0, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.DataPolicyManifestListResult @@ -199,9 +167,16 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion0, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.DataPolicyManifestListResult diff --git a/sdk/policy/arm-policy/src/operations/index.ts b/sdk/policy/arm-policy/src/operations/index.ts index 6b7b36b67585..8f4165ff96ea 100644 --- a/sdk/policy/arm-policy/src/operations/index.ts +++ b/sdk/policy/arm-policy/src/operations/index.ts @@ -12,3 +12,4 @@ export * from "./policyAssignments"; export * from "./policyDefinitions"; export * from "./policySetDefinitions"; export * from "./policyExemptions"; +export * from "./policyPricings"; diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index 23fcfff37602..5d1856d8a52c 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -39,11 +39,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - scope: string, - policyAssignmentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteMethod(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -53,11 +49,7 @@ export class PolicyAssignments { * @param policyAssignmentName The name of the policy assignment to delete. * @param callback The callback */ - deleteMethod( - scope: string, - policyAssignmentName: string, - callback: msRest.ServiceCallback - ): void; + deleteMethod(scope: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -68,18 +60,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - deleteMethod( - scope: string, - policyAssignmentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - scope: string, - policyAssignmentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteMethod(scope: string, policyAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -87,8 +69,7 @@ export class PolicyAssignments { options }, deleteMethodOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -106,12 +87,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - create( - scope: string, - policyAssignmentName: string, - parameters: Models.PolicyAssignment, - options?: msRest.RequestOptionsBase - ): Promise; + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -122,12 +98,7 @@ export class PolicyAssignments { * @param parameters Parameters for the policy assignment. * @param callback The callback */ - create( - scope: string, - policyAssignmentName: string, - parameters: Models.PolicyAssignment, - callback: msRest.ServiceCallback - ): void; + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -139,20 +110,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - create( - scope: string, - policyAssignmentName: string, - parameters: Models.PolicyAssignment, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - create( - scope: string, - policyAssignmentName: string, - parameters: Models.PolicyAssignment, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -161,8 +120,7 @@ export class PolicyAssignments { options }, createOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -178,11 +136,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - get( - scope: string, - policyAssignmentName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -192,11 +146,7 @@ export class PolicyAssignments { * @param policyAssignmentName The name of the policy assignment to get. * @param callback The callback */ - get( - scope: string, - policyAssignmentName: string, - callback: msRest.ServiceCallback - ): void; + get(scope: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: @@ -207,18 +157,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - get( - scope: string, - policyAssignmentName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - scope: string, - policyAssignmentName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(scope: string, policyAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -226,8 +166,58 @@ export class PolicyAssignments { options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; + } + + /** + * This operation updates a policy assignment with the given scope and name. Policy assignments + * apply to all resources contained within their scope. For example, when you assign a policy at + * resource group scope, that policy applies to all resources in the group. + * @summary Updates a policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for policy assignment patch request. + * @param [options] The optional parameters + * @returns Promise + */ + update(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignmentUpdate, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for policy assignment patch request. + * @param callback The callback + */ + update(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignmentUpdate, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for policy assignment patch request. + * @param options The optional parameters + * @param callback The callback + */ + update(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignmentUpdate, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignmentUpdate, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyAssignmentName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; } /** @@ -248,43 +238,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForResourceGroup( - resourceGroupName: string, - options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams - ): Promise; + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group that contains policy assignments. * @param callback The callback */ - listForResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group that contains policy assignments. * @param options The optional parameters * @param callback The callback */ - listForResourceGroup( - resourceGroupName: string, - options: Models.PolicyAssignmentsListForResourceGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceGroup( - resourceGroupName: string, - options?: - | Models.PolicyAssignmentsListForResourceGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResourceGroup(resourceGroupName: string, options: Models.PolicyAssignmentsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, listForResourceGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -322,14 +295,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: Models.PolicyAssignmentsListForResourceOptionalParams - ): Promise; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -340,14 +306,7 @@ export class PolicyAssignments { * @param resourceName The name of the resource. * @param callback The callback */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -359,26 +318,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options: Models.PolicyAssignmentsListForResourceOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: - | Models.PolicyAssignmentsListForResourceOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.PolicyAssignmentsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -389,8 +330,7 @@ export class PolicyAssignments { options }, listForResourceOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -407,43 +347,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForManagementGroup( - managementGroupId: string, - options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams - ): Promise; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyAssignmentsListForManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback */ - listForManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - listForManagementGroup( - managementGroupId: string, - options: Models.PolicyAssignmentsListForManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForManagementGroup( - managementGroupId: string, - options?: - | Models.PolicyAssignmentsListForManagementGroupOptionalParams - | 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, options }, listForManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -462,9 +385,7 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - list( - options?: Models.PolicyAssignmentsListOptionalParams - ): Promise; + list(options?: Models.PolicyAssignmentsListOptionalParams): Promise; /** * @param callback The callback */ @@ -473,23 +394,14 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - list( - options: Models.PolicyAssignmentsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.PolicyAssignmentsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: Models.PolicyAssignmentsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicyAssignmentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -506,43 +418,28 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - deleteById( - policyAssignmentId: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteById(policyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyAssignmentId The ID of the policy assignment to delete. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param callback The callback */ - deleteById( - policyAssignmentId: string, - callback: msRest.ServiceCallback - ): void; + deleteById(policyAssignmentId: string, callback: msRest.ServiceCallback): void; /** * @param policyAssignmentId The ID of the policy assignment to delete. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param options The optional parameters * @param callback The callback */ - deleteById( - policyAssignmentId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteById( - policyAssignmentId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteById(policyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteById(policyAssignmentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, deleteByIdOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -563,22 +460,14 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - createById( - policyAssignmentId: string, - parameters: Models.PolicyAssignment, - options?: msRest.RequestOptionsBase - ): Promise; + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase): Promise; /** * @param policyAssignmentId The ID of the policy assignment to create. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param parameters Parameters for policy assignment. * @param callback The callback */ - createById( - policyAssignmentId: string, - parameters: Models.PolicyAssignment, - callback: msRest.ServiceCallback - ): void; + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, callback: msRest.ServiceCallback): void; /** * @param policyAssignmentId The ID of the policy assignment to create. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. @@ -586,18 +475,8 @@ export class PolicyAssignments { * @param options The optional parameters * @param callback The callback */ - createById( - policyAssignmentId: string, - parameters: Models.PolicyAssignment, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createById( - policyAssignmentId: string, - parameters: Models.PolicyAssignment, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyAssignmentId, @@ -605,8 +484,7 @@ export class PolicyAssignments { options }, createByIdOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -623,43 +501,73 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - getById( - policyAssignmentId: string, - options?: msRest.RequestOptionsBase - ): Promise; + getById(policyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyAssignmentId The ID of the policy assignment to get. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param callback The callback */ - getById( - policyAssignmentId: string, - callback: msRest.ServiceCallback - ): void; + getById(policyAssignmentId: string, callback: msRest.ServiceCallback): void; /** * @param policyAssignmentId The ID of the policy assignment to get. Use the format * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param options The optional parameters * @param callback The callback */ - getById( - policyAssignmentId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getById( - policyAssignmentId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + getById(policyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(policyAssignmentId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyAssignmentId, options }, getByIdOperationSpec, - callback - ) as Promise; + callback) as Promise; + } + + /** + * This operation updates the policy assignment with the given ID. Policy assignments made on a + * scope apply to all resources contained in that scope. For example, when you assign a policy to a + * resource group that policy applies to all resources in the group. Policy assignment IDs have + * this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid + * scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @summary Updates a policy assignment. + * @param policyAssignmentId The ID of the policy assignment to update. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. + * @param [options] The optional parameters + * @returns Promise + */ + updateById(policyAssignmentId: string, parameters: Models.PolicyAssignmentUpdate, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyAssignmentId The ID of the policy assignment to update. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. + * @param callback The callback + */ + updateById(policyAssignmentId: string, parameters: Models.PolicyAssignmentUpdate, callback: msRest.ServiceCallback): void; + /** + * @param policyAssignmentId The ID of the policy assignment to update. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. + * @param options The optional parameters + * @param callback The callback + */ + updateById(policyAssignmentId: string, parameters: Models.PolicyAssignmentUpdate, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + updateById(policyAssignmentId: string, parameters: Models.PolicyAssignmentUpdate, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyAssignmentId, + parameters, + options + }, + updateByIdOperationSpec, + callback) as Promise; } /** @@ -680,43 +588,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForResourceGroupNext( - nextPageLink: string, - options?: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams - ): Promise; + listForResourceGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForResourceGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForResourceGroupNext(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 */ - listForResourceGroupNext( - nextPageLink: string, - options: Models.PolicyAssignmentsListForResourceGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceGroupNext( - nextPageLink: string, - options?: - | Models.PolicyAssignmentsListForResourceGroupNextOptionalParams - | 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, options }, listForResourceGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -748,43 +639,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForResourceNext( - nextPageLink: string, - options?: Models.PolicyAssignmentsListForResourceNextOptionalParams - ): Promise; + listForResourceNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForResourceNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForResourceNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForResourceNext(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 */ - listForResourceNext( - nextPageLink: string, - options: Models.PolicyAssignmentsListForResourceNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceNext( - nextPageLink: string, - options?: - | Models.PolicyAssignmentsListForResourceNextOptionalParams - | 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, options }, listForResourceNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -801,43 +675,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listForManagementGroupNext( - nextPageLink: string, - options?: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams - ): Promise; + listForManagementGroupNext(nextPageLink: string, options?: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForManagementGroupNext(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 */ - listForManagementGroupNext( - nextPageLink: string, - options: Models.PolicyAssignmentsListForManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForManagementGroupNext( - nextPageLink: string, - options?: - | Models.PolicyAssignmentsListForManagementGroupNextOptionalParams - | 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, options }, listForManagementGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -857,43 +714,26 @@ export class PolicyAssignments { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: Models.PolicyAssignmentsListNextOptionalParams - ): Promise; + listNext(nextPageLink: string, options?: Models.PolicyAssignmentsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + 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.PolicyAssignmentsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.PolicyAssignmentsListNextOptionalParams - | 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, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -902,9 +742,16 @@ const serializer = new msRest.Serializer(Mappers); const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", - urlParameters: [Parameters.scope, Parameters.policyAssignmentName], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignment @@ -920,9 +767,16 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { const createOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", - urlParameters: [Parameters.scope, Parameters.policyAssignmentName], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -944,9 +798,47 @@ const createOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", - urlParameters: [Parameters.scope, Parameters.policyAssignmentName], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyAssignmentUpdate, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.PolicyAssignment @@ -960,11 +852,19 @@ const getOperationSpec: msRest.OperationSpec = { const listForResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -978,8 +878,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, @@ -988,8 +887,14 @@ const listForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceName, Parameters.subscriptionId ], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1003,11 +908,18 @@ const listForResourceOperationSpec: msRest.OperationSpec = { const listForManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1022,9 +934,17 @@ const listForManagementGroupOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1039,9 +959,15 @@ const listOperationSpec: msRest.OperationSpec = { const deleteByIdOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "{policyAssignmentId}", - urlParameters: [Parameters.policyAssignmentId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignment @@ -1057,9 +983,15 @@ const deleteByIdOperationSpec: msRest.OperationSpec = { const createByIdOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "{policyAssignmentId}", - urlParameters: [Parameters.policyAssignmentId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -1081,9 +1013,45 @@ const createByIdOperationSpec: msRest.OperationSpec = { const getByIdOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{policyAssignmentId}", - urlParameters: [Parameters.policyAssignmentId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{policyAssignmentId}", + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyAssignmentUpdate, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.PolicyAssignment @@ -1099,9 +1067,17 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1117,9 +1093,17 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1135,9 +1119,17 @@ const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult @@ -1153,9 +1145,17 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.top, Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyAssignmentListResult diff --git a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts index 1dc67b41c038..a2a9b06b957c 100644 --- a/sdk/policy/arm-policy/src/operations/policyDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policyDefinitions.ts @@ -34,39 +34,21 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - createOrUpdate( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - options?: msRest.RequestOptionsBase - ): Promise; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param callback The callback */ - createOrUpdate( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - callback: msRest.ServiceCallback - ): void; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param options The optional parameters * @param callback The callback */ - createOrUpdate( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, @@ -74,8 +56,7 @@ export class PolicyDefinitions { options }, createOrUpdateOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -85,10 +66,7 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to delete. * @param callback The callback @@ -99,24 +77,15 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - deleteMethod( - policyDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteMethod(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, deleteMethodOperationSpec, - callback - ); + callback); } /** @@ -126,41 +95,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - get( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to get. * @param callback The callback */ - get( - policyDefinitionName: string, - callback: msRest.ServiceCallback - ): void; + get(policyDefinitionName: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to get. * @param options The optional parameters * @param callback The callback */ - get( - policyDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policyDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -170,41 +124,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - getBuiltIn( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + getBuiltIn(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the built-in policy definition to get. * @param callback The callback */ - getBuiltIn( - policyDefinitionName: string, - callback: msRest.ServiceCallback - ): void; + getBuiltIn(policyDefinitionName: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the built-in policy definition to get. * @param options The optional parameters * @param callback The callback */ - getBuiltIn( - policyDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getBuiltIn( - policyDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + getBuiltIn(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBuiltIn(policyDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, options }, getBuiltInOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -217,24 +156,14 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtManagementGroup( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. * @param managementGroupId The ID of the management group. * @param callback The callback */ - createOrUpdateAtManagementGroup( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to create. * @param parameters The policy definition properties. @@ -242,20 +171,8 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - createOrUpdateAtManagementGroup( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateAtManagementGroup( - policyDefinitionName: string, - parameters: Models.PolicyDefinition, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, @@ -264,8 +181,7 @@ export class PolicyDefinitions { options }, createOrUpdateAtManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -276,39 +192,21 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - deleteAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. * @param callback The callback */ - deleteAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to delete. * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - deleteAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, @@ -316,8 +214,7 @@ export class PolicyDefinitions { options }, deleteAtManagementGroupOperationSpec, - callback - ); + callback); } /** @@ -329,39 +226,21 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - getAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. * @param callback The callback */ - getAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policyDefinitionName The name of the policy definition to get. * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - getAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtManagementGroup( - policyDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policyDefinitionName, @@ -369,8 +248,7 @@ export class PolicyDefinitions { options }, getAtManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -388,9 +266,7 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - list( - options?: Models.PolicyDefinitionsListOptionalParams - ): Promise; + list(options?: Models.PolicyDefinitionsListOptionalParams): Promise; /** * @param callback The callback */ @@ -399,23 +275,14 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - list( - options: Models.PolicyDefinitionsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.PolicyDefinitionsListOptionalParams - | 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 }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -428,9 +295,7 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - listBuiltIn( - options?: Models.PolicyDefinitionsListBuiltInOptionalParams - ): Promise; + listBuiltIn(options?: Models.PolicyDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -439,23 +304,14 @@ export class PolicyDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn( - options: Models.PolicyDefinitionsListBuiltInOptionalParams, - callback: msRest.ServiceCallback - ): void; - listBuiltIn( - options?: - | Models.PolicyDefinitionsListBuiltInOptionalParams - | 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 }, listBuiltInOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -475,43 +331,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup( - managementGroupId: string, - options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams - ): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicyDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + listByManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - listByManagementGroup( - managementGroupId: string, - options: Models.PolicyDefinitionsListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.PolicyDefinitionsListByManagementGroupOptionalParams - | 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, options }, listByManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -530,43 +369,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: Models.PolicyDefinitionsListNextOptionalParams - ): Promise; + listNext(nextPageLink: string, options?: Models.PolicyDefinitionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + 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.PolicyDefinitionsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.PolicyDefinitionsListNextOptionalParams - | 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, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -580,43 +402,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - listBuiltInNext( - nextPageLink: string, - options?: Models.PolicyDefinitionsListBuiltInNextOptionalParams - ): Promise; + listBuiltInNext(nextPageLink: string, options?: Models.PolicyDefinitionsListBuiltInNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listBuiltInNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listBuiltInNext(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 */ - listBuiltInNext( - nextPageLink: string, - options: Models.PolicyDefinitionsListBuiltInNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listBuiltInNext( - nextPageLink: string, - options?: - | Models.PolicyDefinitionsListBuiltInNextOptionalParams - | 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, options }, listBuiltInNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -636,43 +441,26 @@ export class PolicyDefinitions { * @param [options] The optional parameters * @returns Promise */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams - ): Promise; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listByManagementGroupNext(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 */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.PolicyDefinitionsListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.PolicyDefinitionsListByManagementGroupNextOptionalParams - | 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, options }, listByManagementGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -680,11 +468,17 @@ export class PolicyDefinitions { const serializer = new msRest.Serializer(Mappers); const createOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -705,11 +499,17 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 204: {}, @@ -722,11 +522,17 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinition @@ -741,9 +547,15 @@ const getOperationSpec: msRest.OperationSpec = { const getBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policyDefinitionName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinition @@ -757,11 +569,17 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -782,11 +600,17 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 204: {}, @@ -799,11 +623,17 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", - urlParameters: [Parameters.policyDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinition @@ -818,9 +648,17 @@ const getAtManagementGroupOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult @@ -835,8 +673,14 @@ const listOperationSpec: msRest.OperationSpec = { const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policyDefinitions", - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult @@ -850,11 +694,18 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult @@ -870,9 +721,17 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult @@ -888,9 +747,17 @@ const listBuiltInNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult @@ -906,9 +773,17 @@ const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyDefinitionListResult diff --git a/sdk/policy/arm-policy/src/operations/policyExemptions.ts b/sdk/policy/arm-policy/src/operations/policyExemptions.ts index 871d37124eb7..741ae3a6f3ba 100644 --- a/sdk/policy/arm-policy/src/operations/policyExemptions.ts +++ b/sdk/policy/arm-policy/src/operations/policyExemptions.ts @@ -35,51 +35,33 @@ export class PolicyExemptions { * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - scope: string, - policyExemptionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteMethod(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param callback The callback */ - deleteMethod( - scope: string, - policyExemptionName: string, - callback: msRest.ServiceCallback - ): void; + deleteMethod(scope: string, policyExemptionName: string, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param options The optional parameters * @param callback The callback */ - deleteMethod( - scope: string, - policyExemptionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - scope: string, - policyExemptionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteMethod(scope: string, policyExemptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -87,8 +69,7 @@ export class PolicyExemptions { options }, deleteMethodOperationSpec, - callback - ); + callback); } /** @@ -102,58 +83,36 @@ export class PolicyExemptions { * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param parameters Parameters for the policy exemption. * @param [options] The optional parameters * @returns Promise */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: Models.PolicyExemption, - options?: msRest.RequestOptionsBase - ): Promise; + createOrUpdate(scope: string, policyExemptionName: string, parameters: Models.PolicyExemption, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param parameters Parameters for the policy exemption. * @param callback The callback */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: Models.PolicyExemption, - callback: msRest.ServiceCallback - ): void; + createOrUpdate(scope: string, policyExemptionName: string, parameters: Models.PolicyExemption, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param parameters Parameters for the policy exemption. * @param options The optional parameters * @param callback The callback */ - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: Models.PolicyExemption, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - scope: string, - policyExemptionName: string, - parameters: Models.PolicyExemption, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createOrUpdate(scope: string, policyExemptionName: string, parameters: Models.PolicyExemption, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(scope: string, policyExemptionName: string, parameters: Models.PolicyExemption, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -162,8 +121,7 @@ export class PolicyExemptions { options }, createOrUpdateOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -175,51 +133,33 @@ export class PolicyExemptions { * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param [options] The optional parameters * @returns Promise */ - get( - scope: string, - policyExemptionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param callback The callback */ - get( - scope: string, - policyExemptionName: string, - callback: msRest.ServiceCallback - ): void; + get(scope: string, policyExemptionName: string, callback: msRest.ServiceCallback): void; /** * @param scope The scope of the policy exemption. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * @param policyExemptionName The name of the policy exemption to delete. + * @param policyExemptionName The name of the policy exemption. * @param options The optional parameters * @param callback The callback */ - get( - scope: string, - policyExemptionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - scope: string, - policyExemptionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(scope: string, policyExemptionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, policyExemptionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { scope, @@ -227,8 +167,7 @@ export class PolicyExemptions { options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -242,9 +181,7 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - list( - options?: Models.PolicyExemptionsListOptionalParams - ): Promise; + list(options?: Models.PolicyExemptionsListOptionalParams): Promise; /** * @param callback The callback */ @@ -253,23 +190,14 @@ export class PolicyExemptions { * @param options The optional parameters * @param callback The callback */ - list( - options: Models.PolicyExemptionsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.PolicyExemptionsListOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: Models.PolicyExemptionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicyExemptionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -284,43 +212,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForResourceGroup( - resourceGroupName: string, - options?: Models.PolicyExemptionsListForResourceGroupOptionalParams - ): Promise; + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyExemptionsListForResourceGroupOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group containing the resource. * @param callback The callback */ - listForResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group containing the resource. * @param options The optional parameters * @param callback The callback */ - listForResourceGroup( - resourceGroupName: string, - options: Models.PolicyExemptionsListForResourceGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceGroup( - resourceGroupName: string, - options?: - | Models.PolicyExemptionsListForResourceGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResourceGroup(resourceGroupName: string, options: Models.PolicyExemptionsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyExemptionsListForResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, listForResourceGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -353,14 +264,7 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: Models.PolicyExemptionsListForResourceOptionalParams - ): Promise; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyExemptionsListForResourceOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -371,14 +275,7 @@ export class PolicyExemptions { * @param resourceName The name of the resource. * @param callback The callback */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - callback: msRest.ServiceCallback - ): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group containing the resource. * @param resourceProviderNamespace The namespace of the resource provider. For example, the @@ -390,26 +287,8 @@ export class PolicyExemptions { * @param options The optional parameters * @param callback The callback */ - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options: Models.PolicyExemptionsListForResourceOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResource( - resourceGroupName: string, - resourceProviderNamespace: string, - parentResourcePath: string, - resourceType: string, - resourceName: string, - options?: - | Models.PolicyExemptionsListForResourceOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.PolicyExemptionsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyExemptionsListForResourceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -420,8 +299,7 @@ export class PolicyExemptions { options }, listForResourceOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -435,43 +313,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForManagementGroup( - managementGroupId: string, - options?: Models.PolicyExemptionsListForManagementGroupOptionalParams - ): Promise; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyExemptionsListForManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback */ - listForManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - listForManagementGroup( - managementGroupId: string, - options: Models.PolicyExemptionsListForManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForManagementGroup( - managementGroupId: string, - options?: - | Models.PolicyExemptionsListForManagementGroupOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForManagementGroup(managementGroupId: string, options: Models.PolicyExemptionsListForManagementGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: Models.PolicyExemptionsListForManagementGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { managementGroupId, options }, listForManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -486,43 +347,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: Models.PolicyExemptionsListNextOptionalParams - ): Promise; + listNext(nextPageLink: string, options?: Models.PolicyExemptionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + 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.PolicyExemptionsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.PolicyExemptionsListNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listNext(nextPageLink: string, options: Models.PolicyExemptionsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.PolicyExemptionsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -537,43 +381,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForResourceGroupNext( - nextPageLink: string, - options?: Models.PolicyExemptionsListForResourceGroupNextOptionalParams - ): Promise; + listForResourceGroupNext(nextPageLink: string, options?: Models.PolicyExemptionsListForResourceGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForResourceGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForResourceGroupNext(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 */ - listForResourceGroupNext( - nextPageLink: string, - options: Models.PolicyExemptionsListForResourceGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceGroupNext( - nextPageLink: string, - options?: - | Models.PolicyExemptionsListForResourceGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResourceGroupNext(nextPageLink: string, options: Models.PolicyExemptionsListForResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options?: Models.PolicyExemptionsListForResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listForResourceGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -600,43 +427,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForResourceNext( - nextPageLink: string, - options?: Models.PolicyExemptionsListForResourceNextOptionalParams - ): Promise; + listForResourceNext(nextPageLink: string, options?: Models.PolicyExemptionsListForResourceNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForResourceNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForResourceNext(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 */ - listForResourceNext( - nextPageLink: string, - options: Models.PolicyExemptionsListForResourceNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForResourceNext( - nextPageLink: string, - options?: - | Models.PolicyExemptionsListForResourceNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForResourceNext(nextPageLink: string, options: Models.PolicyExemptionsListForResourceNextOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceNext(nextPageLink: string, options?: Models.PolicyExemptionsListForResourceNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listForResourceNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -650,43 +460,26 @@ export class PolicyExemptions { * @param [options] The optional parameters * @returns Promise */ - listForManagementGroupNext( - nextPageLink: string, - options?: Models.PolicyExemptionsListForManagementGroupNextOptionalParams - ): Promise; + listForManagementGroupNext(nextPageLink: string, options?: Models.PolicyExemptionsListForManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listForManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listForManagementGroupNext(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 */ - listForManagementGroupNext( - nextPageLink: string, - options: Models.PolicyExemptionsListForManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listForManagementGroupNext( - nextPageLink: string, - options?: - | Models.PolicyExemptionsListForManagementGroupNextOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listForManagementGroupNext(nextPageLink: string, options: Models.PolicyExemptionsListForManagementGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listForManagementGroupNext(nextPageLink: string, options?: Models.PolicyExemptionsListForManagementGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listForManagementGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -695,9 +488,16 @@ const serializer = new msRest.Serializer(Mappers); const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - urlParameters: [Parameters.scope, Parameters.policyExemptionName], - queryParameters: [Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 204: {}, @@ -711,9 +511,16 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { const createOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - urlParameters: [Parameters.scope, Parameters.policyExemptionName], - queryParameters: [Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -738,9 +545,16 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{scope}/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}", - urlParameters: [Parameters.scope, Parameters.policyExemptionName], - queryParameters: [Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.scope, + Parameters.policyExemptionName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemption @@ -755,9 +569,16 @@ const getOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyExemptions", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -771,11 +592,18 @@ const listOperationSpec: msRest.OperationSpec = { const listForResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyExemptions", - urlParameters: [Parameters.subscriptionId, Parameters.resourceGroupName], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -789,8 +617,7 @@ const listForResourceGroupOperationSpec: msRest.OperationSpec = { const listForResourceOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyExemptions", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyExemptions", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -799,8 +626,13 @@ const listForResourceOperationSpec: msRest.OperationSpec = { Parameters.resourceType, Parameters.resourceName ], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -814,11 +646,17 @@ const listForResourceOperationSpec: msRest.OperationSpec = { const listForManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyExemptions", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyExemptions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -834,9 +672,16 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -852,9 +697,16 @@ const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -870,9 +722,16 @@ const listForResourceNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult @@ -888,9 +747,16 @@ const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.filter, Parameters.apiVersion1], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicyExemptionListResult diff --git a/sdk/policy/arm-policy/src/operations/policyPricings.ts b/sdk/policy/arm-policy/src/operations/policyPricings.ts new file mode 100644 index 000000000000..09553b0ff75a --- /dev/null +++ b/sdk/policy/arm-policy/src/operations/policyPricings.ts @@ -0,0 +1,448 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/policyPricingsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClientContext } from "../policyClientContext"; + +/** Class representing a PolicyPricings. */ +export class PolicyPricings { + private readonly client: PolicyClientContext; + + /** + * Create a PolicyPricings. + * @param {PolicyClientContext} client Reference to the service client. + */ + constructor(client: PolicyClientContext) { + this.client = client; + } + + /** + * This operation deletes a policy pricing, given its name and the scope it was created in. The + * scope of a policy pricing is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyPricings/{policyPricingName}'. + * @summary Deletes a policy pricing. + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(scope: string, policyPricingName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(scope,policyPricingName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * This operation creates or updates a policy pricing with the given scope and name. + * @summary Creates or updates a policy pricing. + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param parameters Parameters for the policy pricing. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(scope: string, policyPricingName: string, parameters: Models.PolicyPricing, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(scope,policyPricingName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * This operation retrieves a single policy pricing, given its name and the scope it was created + * at. + * @summary Retrieves a policy pricing. + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param [options] The optional parameters + * @returns Promise + */ + get(scope: string, policyPricingName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param callback The callback + */ + get(scope: string, policyPricingName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param options The optional parameters + * @param callback The callback + */ + get(scope: string, policyPricingName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, policyPricingName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyPricingName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy pricings associated with the given subscription + * and the management group ancestors. + * @summary Retrieves all policy pricings that apply to a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @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 { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy pricings associated with the given subscription + * and the management group ancestors. + * @summary Retrieves all policy pricings that apply to a management group. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + listForManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + listForManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + options + }, + listForManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes a policy pricing, given its name and the scope it was created in. The + * scope of a policy pricing is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyPricings/{policyPricingName}'. + * @summary Deletes a policy pricing. + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(scope: string, policyPricingName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + scope, + policyPricingName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * This operation creates or updates a policy pricing with the given scope and name. + * @summary Creates or updates a policy pricing. + * @param scope The scope of the policy pricing. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}') or subscription (format: + * '/subscriptions/{subscriptionId}') + * @param policyPricingName The name of the policy pricing. + * @param parameters Parameters for the policy pricing. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(scope: string, policyPricingName: string, parameters: Models.PolicyPricing, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + scope, + policyPricingName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * This operation retrieves the list of all policy pricings associated with the given subscription + * and the management group ancestors. + * @summary Retrieves all policy pricings 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; + /** + * @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: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy pricings associated with the given subscription + * and the management group ancestors. + * @summary Retrieves all policy pricings 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; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForManagementGroupNext(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 + */ + listForManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForManagementGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Authorization/policyPricings/{policyPricingName}", + urlParameters: [ + Parameters.scope, + Parameters.policyPricingName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyPricing + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyPricings", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyPricingListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyPricings", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyPricingListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Authorization/policyPricings/{policyPricingName}", + urlParameters: [ + Parameters.scope, + Parameters.policyPricingName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + headersMapper: Mappers.PolicyPricingsDeleteHeaders + }, + 202: { + headersMapper: Mappers.PolicyPricingsDeleteHeaders + }, + 204: { + headersMapper: Mappers.PolicyPricingsDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.PolicyPricingsDeleteHeaders + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Authorization/policyPricings/{policyPricingName}", + urlParameters: [ + Parameters.scope, + Parameters.policyPricingName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyPricing, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PolicyPricing + }, + 201: { + bodyMapper: Mappers.PolicyPricing + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyPricingListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listForManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyPricingListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts index 9635fcdb9fbb..9fe2c1bc1623 100644 --- a/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts +++ b/sdk/policy/arm-policy/src/operations/policySetDefinitions.ts @@ -34,39 +34,21 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - createOrUpdate( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - options?: msRest.RequestOptionsBase - ): Promise; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param callback The callback */ - createOrUpdate( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - callback: msRest.ServiceCallback - ): void; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param options The optional parameters * @param callback The callback */ - createOrUpdate( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdate( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, @@ -74,8 +56,7 @@ export class PolicySetDefinitions { options }, createOrUpdateOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -85,10 +66,7 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to delete. * @param callback The callback @@ -99,24 +77,15 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - deleteMethod( - policySetDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteMethod( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteMethod(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, deleteMethodOperationSpec, - callback - ); + callback); } /** @@ -127,41 +96,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - get( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param callback The callback */ - get( - policySetDefinitionName: string, - callback: msRest.ServiceCallback - ): void; + get(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param options The optional parameters * @param callback The callback */ - get( - policySetDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -171,41 +125,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - getBuiltIn( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + getBuiltIn(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param callback The callback */ - getBuiltIn( - policySetDefinitionName: string, - callback: msRest.ServiceCallback - ): void; + getBuiltIn(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param options The optional parameters * @param callback The callback */ - getBuiltIn( - policySetDefinitionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getBuiltIn( - policySetDefinitionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + getBuiltIn(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBuiltIn(policySetDefinitionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, options }, getBuiltInOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -223,9 +162,7 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - list( - options?: Models.PolicySetDefinitionsListOptionalParams - ): Promise; + list(options?: Models.PolicySetDefinitionsListOptionalParams): Promise; /** * @param callback The callback */ @@ -234,23 +171,14 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - list( - options: Models.PolicySetDefinitionsListOptionalParams, - callback: msRest.ServiceCallback - ): void; - list( - options?: - | Models.PolicySetDefinitionsListOptionalParams - | 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 }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -261,9 +189,7 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - listBuiltIn( - options?: Models.PolicySetDefinitionsListBuiltInOptionalParams - ): Promise; + listBuiltIn(options?: Models.PolicySetDefinitionsListBuiltInOptionalParams): Promise; /** * @param callback The callback */ @@ -272,23 +198,14 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - listBuiltIn( - options: Models.PolicySetDefinitionsListBuiltInOptionalParams, - callback: msRest.ServiceCallback - ): void; - listBuiltIn( - options?: - | Models.PolicySetDefinitionsListBuiltInOptionalParams - | 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 }, listBuiltInOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -301,24 +218,14 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtManagementGroup( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. * @param managementGroupId The ID of the management group. * @param callback The callback */ - createOrUpdateAtManagementGroup( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to create. * @param parameters The policy set definition properties. @@ -326,20 +233,8 @@ export class PolicySetDefinitions { * @param options The optional parameters * @param callback The callback */ - createOrUpdateAtManagementGroup( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - createOrUpdateAtManagementGroup( - policySetDefinitionName: string, - parameters: Models.PolicySetDefinition, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, @@ -348,8 +243,7 @@ export class PolicySetDefinitions { options }, createOrUpdateAtManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -361,39 +255,21 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - deleteAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. * @param callback The callback */ - deleteAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to delete. * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - deleteAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - deleteAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, @@ -401,8 +277,7 @@ export class PolicySetDefinitions { options }, deleteAtManagementGroupOperationSpec, - callback - ); + callback); } /** @@ -414,39 +289,21 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - getAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase - ): Promise; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. * @param callback The callback */ - getAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param policySetDefinitionName The name of the policy set definition to get. * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - getAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - getAtManagementGroup( - policySetDefinitionName: string, - managementGroupId: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { policySetDefinitionName, @@ -454,8 +311,7 @@ export class PolicySetDefinitions { options }, getAtManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -475,43 +331,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - listByManagementGroup( - managementGroupId: string, - options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams - ): Promise; + listByManagementGroup(managementGroupId: string, options?: Models.PolicySetDefinitionsListByManagementGroupOptionalParams): Promise; /** * @param managementGroupId The ID of the management group. * @param callback The callback */ - listByManagementGroup( - managementGroupId: string, - callback: msRest.ServiceCallback - ): void; + listByManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; /** * @param managementGroupId The ID of the management group. * @param options The optional parameters * @param callback The callback */ - listByManagementGroup( - managementGroupId: string, - options: Models.PolicySetDefinitionsListByManagementGroupOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroup( - managementGroupId: string, - options?: - | Models.PolicySetDefinitionsListByManagementGroupOptionalParams - | 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, options }, listByManagementGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -530,43 +369,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: Models.PolicySetDefinitionsListNextOptionalParams - ): Promise; + listNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + 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.PolicySetDefinitionsListNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: - | Models.PolicySetDefinitionsListNextOptionalParams - | 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, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -578,43 +400,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - listBuiltInNext( - nextPageLink: string, - options?: Models.PolicySetDefinitionsListBuiltInNextOptionalParams - ): Promise; + listBuiltInNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListBuiltInNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listBuiltInNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listBuiltInNext(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 */ - listBuiltInNext( - nextPageLink: string, - options: Models.PolicySetDefinitionsListBuiltInNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listBuiltInNext( - nextPageLink: string, - options?: - | Models.PolicySetDefinitionsListBuiltInNextOptionalParams - | 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, options }, listBuiltInNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -634,43 +439,26 @@ export class PolicySetDefinitions { * @param [options] The optional parameters * @returns Promise */ - listByManagementGroupNext( - nextPageLink: string, - options?: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams - ): Promise; + listByManagementGroupNext(nextPageLink: string, options?: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listByManagementGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listByManagementGroupNext(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 */ - listByManagementGroupNext( - nextPageLink: string, - options: Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams, - callback: msRest.ServiceCallback - ): void; - listByManagementGroupNext( - nextPageLink: string, - options?: - | Models.PolicySetDefinitionsListByManagementGroupNextOptionalParams - | 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, options }, listByManagementGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -678,11 +466,17 @@ export class PolicySetDefinitions { const serializer = new msRest.Serializer(Mappers); const createOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -706,11 +500,17 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { const deleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 204: {}, @@ -723,11 +523,17 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinition @@ -742,9 +548,15 @@ const getOperationSpec: msRest.OperationSpec = { const getBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.policySetDefinitionName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinition @@ -759,9 +571,17 @@ const getBuiltInOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult @@ -776,8 +596,14 @@ const listOperationSpec: msRest.OperationSpec = { const listBuiltInOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Authorization/policySetDefinitions", - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult @@ -791,11 +617,17 @@ const listBuiltInOperationSpec: msRest.OperationSpec = { const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "parameters", mapper: { @@ -819,11 +651,17 @@ const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 204: {}, @@ -836,11 +674,17 @@ const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { const getAtManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", - urlParameters: [Parameters.policySetDefinitionName, Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinition @@ -854,11 +698,18 @@ const getAtManagementGroupOperationSpec: msRest.OperationSpec = { const listByManagementGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", - urlParameters: [Parameters.managementGroupId], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + path: "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult @@ -874,9 +725,17 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult @@ -892,9 +751,17 @@ const listBuiltInNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult @@ -910,9 +777,17 @@ const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion0, Parameters.filter, Parameters.top], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion1, + Parameters.filter, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PolicySetDefinitionListResult diff --git a/sdk/policy/arm-policy/src/policyClient.ts b/sdk/policy/arm-policy/src/policyClient.ts index 32b3a1885e4d..610957bbcadf 100644 --- a/sdk/policy/arm-policy/src/policyClient.ts +++ b/sdk/policy/arm-policy/src/policyClient.ts @@ -14,6 +14,7 @@ import * as Mappers from "./models/mappers"; import * as operations from "./operations"; import { PolicyClientContext } from "./policyClientContext"; + class PolicyClient extends PolicyClientContext { // Operation groups dataPolicyManifests: operations.DataPolicyManifests; @@ -21,6 +22,7 @@ class PolicyClient extends PolicyClientContext { policyDefinitions: operations.PolicyDefinitions; policySetDefinitions: operations.PolicySetDefinitions; policyExemptions: operations.PolicyExemptions; + policyPricings: operations.PolicyPricings; /** * Initializes a new instance of the PolicyClient class. @@ -33,21 +35,23 @@ class PolicyClient extends PolicyClientContext { * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, - subscriptionId: string, - options?: Models.PolicyClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, 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); this.policyExemptions = new operations.PolicyExemptions(this); + this.policyPricings = new operations.PolicyPricings(this); } } // Operation Specifications -export { PolicyClient, PolicyClientContext, Models as PolicyModels, Mappers as PolicyMappers }; +export { + PolicyClient, + PolicyClientContext, + Models as PolicyModels, + Mappers as PolicyMappers +}; export * from "./operations"; diff --git a/sdk/policy/arm-policy/src/policyClientContext.ts b/sdk/policy/arm-policy/src/policyClientContext.ts index 5391da808148..7c771566f6c4 100644 --- a/sdk/policy/arm-policy/src/policyClientContext.ts +++ b/sdk/policy/arm-policy/src/policyClientContext.ts @@ -9,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-policy"; const packageVersion = "4.1.2"; @@ -30,16 +30,12 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, - subscriptionId: string, - options?: Models.PolicyClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.PolicyClientOptions) { if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + throw new Error('\'subscriptionId\' cannot be null.'); } if (!options) { @@ -52,7 +48,7 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.acceptLanguage = "en-US"; + this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; this.requestContentType = "application/json; charset=utf-8"; @@ -62,10 +58,7 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } }