From 3fc2cd3ad9f6b7d50429025ca036b5b168c1c8e4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 20 Mar 2019 17:49:08 +0000 Subject: [PATCH] Generated from 1a3aa3cf53ff44ebd904b68d314a115eedb4a2c6 Update FrontDoor WAF API definitions and examples --- lib/services/frontdoorManagement/LICENSE.txt | 42 +- lib/services/frontdoorManagement/README.md | 86 +- .../lib/frontDoorManagementClient.d.ts | 1 + .../lib/frontDoorManagementClient.js | 1 + .../lib/models/azureAsyncOperationResult.js | 14 +- .../frontdoorManagement/lib/models/backend.js | 16 +- .../lib/models/backendPool.js | 19 +- .../lib/models/backendPoolListResult.js | 6 +- .../lib/models/backendPoolUpdateParameters.js | 10 +- .../lib/models/cacheConfiguration.js | 4 +- .../lib/models/checkNameAvailabilityInput.js | 4 +- .../lib/models/checkNameAvailabilityOutput.js | 6 +- .../lib/models/customHttpsConfiguration.js | 17 +- .../lib/models/customRule.js | 62 +- .../lib/models/customRuleList.js | 60 + .../lib/models/errorDetails.js | 6 +- .../lib/models/errorModel.js | 10 +- .../lib/models/errorResponse.js | 6 +- .../lib/models/frontDoor.js | 27 +- .../lib/models/frontDoorListResult.js | 6 +- .../lib/models/frontDoorUpdateParameters.js | 20 +- .../lib/models/frontendEndpoint.js | 49 +- .../lib/models/frontendEndpointLink.js | 52 + .../frontendEndpointUpdateParameters.js | 12 +- ...ametersWebApplicationFirewallPolicyLink.js | 2 +- .../lib/models/frontendEndpointsListResult.js | 6 +- .../models/healthProbeSettingsListResult.js | 7 +- .../lib/models/healthProbeSettingsModel.js | 18 +- .../healthProbeSettingsUpdateParameters.js | 9 +- .../frontdoorManagement/lib/models/index.d.ts | 1278 +++++++++-------- .../frontdoorManagement/lib/models/index.js | 21 +- ...eyVaultCertificateSourceParametersVault.js | 2 +- .../models/loadBalancingSettingsListResult.js | 4 +- .../lib/models/loadBalancingSettingsModel.js | 19 +- .../loadBalancingSettingsUpdateParameters.js | 10 +- .../lib/models/managedRuleDefinition.js | 63 + .../lib/models/managedRuleGroupDefinition.js | 79 + .../lib/models/managedRuleGroupOverride.js | 70 + .../lib/models/managedRuleOverride.js | 72 + .../lib/models/managedRuleSet.js | 50 +- .../lib/models/managedRuleSetDefinition.js | 138 ++ .../models/managedRuleSetDefinitionList.js | 69 + .../lib/models/managedRuleSetList.js | 60 + .../lib/models/matchCondition.js | 113 ++ .../lib/models/policySettings.js | 42 +- .../lib/models/purgeParameters.js | 2 +- .../lib/models/resource.js | 10 +- .../lib/models/routingRule.js | 33 +- .../lib/models/routingRuleListResult.js | 6 +- .../lib/models/routingRuleUpdateParameters.js | 24 +- .../lib/models/subResource.js | 2 +- .../lib/models/tagsObject.js | 2 +- .../lib/models/validateCustomDomainInput.js | 2 +- .../lib/models/validateCustomDomainOutput.js | 8 +- .../models/webApplicationFirewallPolicy1.js | 57 +- .../webApplicationFirewallPolicyList.js | 71 + .../lib/operations/frontendEndpoints.js | 10 +- .../lib/operations/index.d.ts | 437 +++++- .../lib/operations/index.js | 1 + .../lib/operations/managedRuleSets.js | 457 ++++++ .../lib/operations/policies.js | 755 +++++++--- lib/services/frontdoorManagement/package.json | 2 +- 62 files changed, 3338 insertions(+), 1209 deletions(-) create mode 100644 lib/services/frontdoorManagement/lib/models/customRuleList.js create mode 100644 lib/services/frontdoorManagement/lib/models/frontendEndpointLink.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleDefinition.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleGroupDefinition.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleGroupOverride.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleOverride.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleSetDefinition.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleSetDefinitionList.js create mode 100644 lib/services/frontdoorManagement/lib/models/managedRuleSetList.js create mode 100644 lib/services/frontdoorManagement/lib/models/matchCondition.js create mode 100644 lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyList.js create mode 100644 lib/services/frontdoorManagement/lib/operations/managedRuleSets.js diff --git a/lib/services/frontdoorManagement/LICENSE.txt b/lib/services/frontdoorManagement/LICENSE.txt index a70e8cf660..8f3d856145 100644 --- a/lib/services/frontdoorManagement/LICENSE.txt +++ b/lib/services/frontdoorManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/frontdoorManagement/README.md b/lib/services/frontdoorManagement/README.md index 5fafbcbd2a..5e99d92521 100644 --- a/lib/services/frontdoorManagement/README.md +++ b/lib/services/frontdoorManagement/README.md @@ -1,43 +1,43 @@ ---- -uid: azure-arm-frontdoor -summary: *content - ---- -# Microsoft Azure SDK for Node.js - FrontDoorManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-frontdoor -``` - -## How to use - -### Authentication, client creation and list frontDoors as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const FrontDoorManagementClient = require("azure-arm-frontdoor"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new FrontDoorManagementClient(creds, subscriptionId); - return client.frontDoors.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FfrontdoorManagement%2FREADME.png) +--- +uid: azure-arm-frontdoor +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - FrontDoorManagementClient + +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-arm-frontdoor +``` + +### How to use + +#### Authentication, client creation, and list frontDoors as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const FrontDoorManagementClient = require("azure-arm-frontdoor"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new FrontDoorManagementClient(creds, subscriptionId); + + return client.frontDoors.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); +``` +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/frontdoorManagement/lib/frontDoorManagementClient.d.ts b/lib/services/frontdoorManagement/lib/frontDoorManagementClient.d.ts index fd822239cb..88a69877d4 100644 --- a/lib/services/frontdoorManagement/lib/frontDoorManagementClient.d.ts +++ b/lib/services/frontdoorManagement/lib/frontDoorManagementClient.d.ts @@ -62,6 +62,7 @@ export default class FrontDoorManagementClient extends AzureServiceClient { frontendEndpoints: operations.FrontendEndpoints; endpoints: operations.Endpoints; policies: operations.Policies; + managedRuleSets: operations.ManagedRuleSets; /** diff --git a/lib/services/frontdoorManagement/lib/frontDoorManagementClient.js b/lib/services/frontdoorManagement/lib/frontDoorManagementClient.js index 28185bb692..e925f0bf36 100644 --- a/lib/services/frontdoorManagement/lib/frontDoorManagementClient.js +++ b/lib/services/frontdoorManagement/lib/frontDoorManagementClient.js @@ -396,6 +396,7 @@ class FrontDoorManagementClient extends ServiceClient { this.frontendEndpoints = new operations.FrontendEndpoints(this); this.endpoints = new operations.Endpoints(this); this.policies = new operations.Policies(this); + this.managedRuleSets = new operations.ManagedRuleSets(this); this.models = models; this._checkFrontDoorNameAvailability = _checkFrontDoorNameAvailability; this._checkFrontDoorNameAvailabilityWithSubscription = _checkFrontDoorNameAvailabilityWithSubscription; diff --git a/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js b/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js index 4870803217..7f6d7a5d49 100644 --- a/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js +++ b/lib/services/frontdoorManagement/lib/models/azureAsyncOperationResult.js @@ -24,15 +24,15 @@ class AzureAsyncOperationResult { /** * Create a AzureAsyncOperationResult. - * @member {string} [status] Status of the Azure async operation. Possible + * @property {string} [status] Status of the Azure async operation. Possible * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values * include: 'InProgress', 'Succeeded', 'Failed' - * @member {object} [error] - * @member {string} [error.code] - * @member {string} [error.message] - * @member {string} [error.target] - * @member {array} [error.details] - * @member {string} [error.innerError] + * @property {object} [error] + * @property {string} [error.code] + * @property {string} [error.message] + * @property {string} [error.target] + * @property {array} [error.details] + * @property {string} [error.innerError] */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/backend.js b/lib/services/frontdoorManagement/lib/models/backend.js index a20e8a4083..9eb98025db 100644 --- a/lib/services/frontdoorManagement/lib/models/backend.js +++ b/lib/services/frontdoorManagement/lib/models/backend.js @@ -17,20 +17,20 @@ class Backend { /** * Create a Backend. - * @member {string} [address] Location of the backend (IP address or FQDN) - * @member {number} [httpPort] The HTTP TCP port number. Must be between 1 + * @property {string} [address] Location of the backend (IP address or FQDN) + * @property {number} [httpPort] The HTTP TCP port number. Must be between 1 * and 65535. - * @member {number} [httpsPort] The HTTPS TCP port number. Must be between 1 - * and 65535. - * @member {string} [enabledState] Whether to enable use of this backend. + * @property {number} [httpsPort] The HTTPS TCP port number. Must be between + * 1 and 65535. + * @property {string} [enabledState] Whether to enable use of this backend. * Permitted values are 'Enabled' or 'Disabled'. Possible values include: * 'Enabled', 'Disabled' - * @member {number} [priority] Priority to use for load balancing. Higher + * @property {number} [priority] Priority to use for load balancing. Higher * priorities will not be used for load balancing if any lower priority * backend is healthy. - * @member {number} [weight] Weight of this endpoint for load balancing + * @property {number} [weight] Weight of this endpoint for load balancing * purposes. - * @member {string} [backendHostHeader] The value to use as the host header + * @property {string} [backendHostHeader] The value to use as the host header * sent to the backend. If blank or unspecified, this defaults to the * incoming host. */ diff --git a/lib/services/frontdoorManagement/lib/models/backendPool.js b/lib/services/frontdoorManagement/lib/models/backendPool.js index f7ff8a02f2..5aeec2c638 100644 --- a/lib/services/frontdoorManagement/lib/models/backendPool.js +++ b/lib/services/frontdoorManagement/lib/models/backendPool.js @@ -20,17 +20,18 @@ const models = require('./index'); class BackendPool extends models['SubResource'] { /** * Create a BackendPool. - * @member {array} [backends] The set of backends for this pool - * @member {object} [loadBalancingSettings] Load balancing settings for a + * @property {array} [backends] The set of backends for this pool + * @property {object} [loadBalancingSettings] Load balancing settings for a * backend pool - * @member {string} [loadBalancingSettings.id] Resource ID. - * @member {object} [healthProbeSettings] L7 health probe settings for a + * @property {string} [loadBalancingSettings.id] Resource ID. + * @property {object} [healthProbeSettings] L7 health probe settings for a * backend pool - * @member {string} [healthProbeSettings.id] Resource ID. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {string} [healthProbeSettings.id] Resource ID. + * @property {string} [resourceState] Resource status. Possible values + * include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js b/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js index 4d77352f50..d1635bf6f5 100644 --- a/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js +++ b/lib/services/frontdoorManagement/lib/models/backendPoolListResult.js @@ -12,13 +12,13 @@ /** * Result of the request to list Backend Pools. It contains a list of Backend - * Pools objects and a URL link to get the the next set of results. + * Pools objects and a URL link to get the next set of results. */ class BackendPoolListResult extends Array { /** * Create a BackendPoolListResult. - * @member {string} [nextLink] URL to get the next set of BackendPool objects - * if there are any. + * @property {string} [nextLink] URL to get the next set of BackendPool + * objects if there are any. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js index f812b39aa7..7c20bdc91d 100644 --- a/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/backendPoolUpdateParameters.js @@ -17,13 +17,13 @@ class BackendPoolUpdateParameters { /** * Create a BackendPoolUpdateParameters. - * @member {array} [backends] The set of backends for this pool - * @member {object} [loadBalancingSettings] Load balancing settings for a + * @property {array} [backends] The set of backends for this pool + * @property {object} [loadBalancingSettings] Load balancing settings for a * backend pool - * @member {string} [loadBalancingSettings.id] Resource ID. - * @member {object} [healthProbeSettings] L7 health probe settings for a + * @property {string} [loadBalancingSettings.id] Resource ID. + * @property {object} [healthProbeSettings] L7 health probe settings for a * backend pool - * @member {string} [healthProbeSettings.id] Resource ID. + * @property {string} [healthProbeSettings.id] Resource ID. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js b/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js index 198afe5622..36217493d2 100644 --- a/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js +++ b/lib/services/frontdoorManagement/lib/models/cacheConfiguration.js @@ -18,10 +18,10 @@ class CacheConfiguration { /** * Create a CacheConfiguration. - * @member {string} [queryParameterStripDirective] Treatment of URL query + * @property {string} [queryParameterStripDirective] Treatment of URL query * terms when forming the cache key. Possible values include: 'StripNone', * 'StripAll' - * @member {string} [dynamicCompression] Whether to use dynamic compression + * @property {string} [dynamicCompression] Whether to use dynamic compression * for cached content. Possible values include: 'Enabled', 'Disabled' */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js index a3108083d2..a68f49cf36 100644 --- a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js +++ b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityInput.js @@ -17,8 +17,8 @@ class CheckNameAvailabilityInput { /** * Create a CheckNameAvailabilityInput. - * @member {string} name The resource name to validate. - * @member {string} type The type of the resource whose name is to be + * @property {string} name The resource name to validate. + * @property {string} type The type of the resource whose name is to be * validated. Possible values include: 'Microsoft.Network/frontDoors', * 'Microsoft.Network/frontDoors/frontendEndpoints' */ diff --git a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js index 7699b34c79..dcc5696bc3 100644 --- a/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js +++ b/lib/services/frontdoorManagement/lib/models/checkNameAvailabilityOutput.js @@ -17,10 +17,10 @@ class CheckNameAvailabilityOutput { /** * Create a CheckNameAvailabilityOutput. - * @member {string} [nameAvailability] Indicates whether the name is + * @property {string} [nameAvailability] Indicates whether the name is * available. Possible values include: 'Available', 'Unavailable' - * @member {string} [reason] The reason why the name is not available. - * @member {string} [message] The detailed error message describing why the + * @property {string} [reason] The reason why the name is not available. + * @property {string} [message] The detailed error message describing why the * name is not available. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js b/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js index 6efe7fe9fe..4f6bec0b63 100644 --- a/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js +++ b/lib/services/frontdoorManagement/lib/models/customHttpsConfiguration.js @@ -17,17 +17,18 @@ class CustomHttpsConfiguration { /** * Create a CustomHttpsConfiguration. - * @member {string} [certificateSource] Defines the source of the SSL + * @property {string} [certificateSource] Defines the source of the SSL * certificate. Possible values include: 'AzureKeyVault', 'FrontDoor' - * @member {string} [protocolType] Defines the TLS extension protocol that is - * used for secure delivery. Possible values include: 'ServerNameIndication' - * @member {object} [vault] The Key Vault containing the SSL certificate - * @member {string} [vault.id] Resource ID. - * @member {string} [secretName] The name of the Key Vault secret + * @property {string} [protocolType] Defines the TLS extension protocol that + * is used for secure delivery. Possible values include: + * 'ServerNameIndication' + * @property {object} [vault] The Key Vault containing the SSL certificate + * @property {string} [vault.id] Resource ID. + * @property {string} [secretName] The name of the Key Vault secret * representing the full certificate PFX - * @member {string} [secretVersion] The version of the Key Vault secret + * @property {string} [secretVersion] The version of the Key Vault secret * representing the full certificate PFX - * @member {string} [certificateType] Defines the type of the certificate + * @property {string} [certificateType] Defines the type of the certificate * used for secure connections to a frontendEndpoint. Possible values * include: 'Dedicated' */ diff --git a/lib/services/frontdoorManagement/lib/models/customRule.js b/lib/services/frontdoorManagement/lib/models/customRule.js index 1276b3f49a..41ff9a1f8a 100644 --- a/lib/services/frontdoorManagement/lib/models/customRule.js +++ b/lib/services/frontdoorManagement/lib/models/customRule.js @@ -17,21 +17,20 @@ class CustomRule { /** * Create a CustomRule. - * @member {string} [name] Gets name of the resource that is unique within a - * policy. This name can be used to access the resource. - * @member {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - * @member {number} priority Describes priority of the rule. Rules with a - * lower value will be evaluated before rules with a higher value - * @member {string} ruleType Describes type of rule. Possible values include: - * 'MatchRule', 'RateLimitRule' - * @member {number} [rateLimitDurationInMinutes] Defines rate limit duration. - * Default - 1 minute - * @member {number} [rateLimitThreshold] Defines rate limit thresold - * @member {array} matchConditions List of match conditions - * @member {string} action Type of Actions. Possible values include: 'Allow', - * 'Block', 'Log' - * @member {array} [transforms] List of transforms + * @property {string} [name] Describes the name of the rule. + * @property {number} priority Describes priority of the rule. Rules with a + * lower value will be evaluated before rules with a higher value. + * @property {string} [enabledState] Describes if the custom rule is in + * enabled or disabled state. Defaults to Enabled if not specified. Possible + * values include: 'Disabled', 'Enabled' + * @property {string} ruleType Describes type of rule. Possible values + * include: 'MatchRule', 'RateLimitRule' + * @property {number} [rateLimitDurationInMinutes] Defines rate limit + * duration. Default is 1 minute. + * @property {number} [rateLimitThreshold] Defines rate limit threshold. + * @property {array} matchConditions List of match conditions. + * @property {string} action Describes what action to be applied when rule + * matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' */ constructor() { } @@ -60,14 +59,6 @@ class CustomRule { name: 'String' } }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - }, priority: { required: true, serializedName: 'priority', @@ -75,6 +66,13 @@ class CustomRule { name: 'Number' } }, + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + }, ruleType: { required: true, serializedName: 'ruleType', @@ -103,10 +101,10 @@ class CustomRule { name: 'Sequence', element: { required: false, - serializedName: 'MatchCondition1ElementType', + serializedName: 'MatchConditionElementType', type: { name: 'Composite', - className: 'MatchCondition1' + className: 'MatchCondition' } } } @@ -117,20 +115,6 @@ class CustomRule { type: { name: 'String' } - }, - transforms: { - required: false, - serializedName: 'transforms', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TransformElementType', - type: { - name: 'String' - } - } - } } } } diff --git a/lib/services/frontdoorManagement/lib/models/customRuleList.js b/lib/services/frontdoorManagement/lib/models/customRuleList.js new file mode 100644 index 0000000000..32db164f7f --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/customRuleList.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines contents of custom rules + * + */ +class CustomRuleList { + /** + * Create a CustomRuleList. + * @property {array} [rules] List of rules + */ + constructor() { + } + + /** + * Defines the metadata of CustomRuleList + * + * @returns {object} metadata of CustomRuleList + * + */ + mapper() { + return { + required: false, + serializedName: 'CustomRuleList', + type: { + name: 'Composite', + className: 'CustomRuleList', + modelProperties: { + rules: { + required: false, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CustomRuleElementType', + type: { + name: 'Composite', + className: 'CustomRule' + } + } + } + } + } + } + }; + } +} + +module.exports = CustomRuleList; diff --git a/lib/services/frontdoorManagement/lib/models/errorDetails.js b/lib/services/frontdoorManagement/lib/models/errorDetails.js index fcac88503a..7393f66139 100644 --- a/lib/services/frontdoorManagement/lib/models/errorDetails.js +++ b/lib/services/frontdoorManagement/lib/models/errorDetails.js @@ -16,9 +16,9 @@ class ErrorDetails { /** * Create a ErrorDetails. - * @member {string} [code] - * @member {string} [target] - * @member {string} [message] + * @property {string} [code] + * @property {string} [target] + * @property {string} [message] */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/errorModel.js b/lib/services/frontdoorManagement/lib/models/errorModel.js index 955cde1528..6ef42630b7 100644 --- a/lib/services/frontdoorManagement/lib/models/errorModel.js +++ b/lib/services/frontdoorManagement/lib/models/errorModel.js @@ -16,11 +16,11 @@ class ErrorModel { /** * Create a ErrorModel. - * @member {string} [code] - * @member {string} [message] - * @member {string} [target] - * @member {array} [details] - * @member {string} [innerError] + * @property {string} [code] + * @property {string} [message] + * @property {string} [target] + * @property {array} [details] + * @property {string} [innerError] */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/errorResponse.js b/lib/services/frontdoorManagement/lib/models/errorResponse.js index f7411b7340..7277f3bb5d 100644 --- a/lib/services/frontdoorManagement/lib/models/errorResponse.js +++ b/lib/services/frontdoorManagement/lib/models/errorResponse.js @@ -11,15 +11,15 @@ 'use strict'; /** - * Error reponse indicates Front Door service is not able to process the + * Error response indicates Front Door service is not able to process the * incoming request. The reason is provided in the error message. * */ class ErrorResponse { /** * Create a ErrorResponse. - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation + * @property {string} [code] Error code. + * @property {string} [message] Error message indicating why the operation * failed. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/frontDoor.js b/lib/services/frontdoorManagement/lib/models/frontDoor.js index 90c3366037..371180f0fb 100644 --- a/lib/services/frontdoorManagement/lib/models/frontDoor.js +++ b/lib/services/frontdoorManagement/lib/models/frontDoor.js @@ -21,24 +21,25 @@ const models = require('./index'); class FrontDoor extends models['Resource'] { /** * Create a FrontDoor. - * @member {string} [friendlyName] A friendly name for the frontDoor - * @member {array} [routingRules] Routing rules associated with this Front + * @property {string} [friendlyName] A friendly name for the frontDoor + * @property {array} [routingRules] Routing rules associated with this Front * Door. - * @member {array} [loadBalancingSettings] Load balancing settings associated + * @property {array} [loadBalancingSettings] Load balancing settings + * associated with this Front Door instance. + * @property {array} [healthProbeSettings] Health probe settings associated * with this Front Door instance. - * @member {array} [healthProbeSettings] Health probe settings associated - * with this Front Door instance. - * @member {array} [backendPools] Backend pools available to routing rules. - * @member {array} [frontendEndpoints] Frontend endpoints available to + * @property {array} [backendPools] Backend pools available to routing rules. + * @property {array} [frontendEndpoints] Frontend endpoints available to * routing rules. - * @member {string} [enabledState] Operational status of the Front Door load - * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values - * include: 'Enabled', 'Disabled' - * @member {string} [resourceState] Resource status of the Front Door. + * @property {string} [enabledState] Operational status of the Front Door + * load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + * @property {string} [resourceState] Resource status of the Front Door. * Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', * 'Disabled', 'Deleting' - * @member {string} [provisioningState] Provisioning state of the Front Door. - * @member {string} [cname] The host that each frontendEndpoint must CNAME + * @property {string} [provisioningState] Provisioning state of the Front + * Door. + * @property {string} [cname] The host that each frontendEndpoint must CNAME * to. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js b/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js index d719fd6e2e..7e24b70138 100644 --- a/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js +++ b/lib/services/frontdoorManagement/lib/models/frontDoorListResult.js @@ -12,13 +12,13 @@ /** * Result of the request to list Front Doors. It contains a list of Front Door - * objects and a URL link to get the the next set of results. + * objects and a URL link to get the next set of results. */ class FrontDoorListResult extends Array { /** * Create a FrontDoorListResult. - * @member {string} [nextLink] URL to get the next set of Front Door objects - * if there are any. + * @property {string} [nextLink] URL to get the next set of Front Door + * objects if there are any. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js index f6dd2a0426..9fc5dcd53a 100644 --- a/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/frontDoorUpdateParameters.js @@ -17,19 +17,19 @@ class FrontDoorUpdateParameters { /** * Create a FrontDoorUpdateParameters. - * @member {string} [friendlyName] A friendly name for the frontDoor - * @member {array} [routingRules] Routing rules associated with this Front + * @property {string} [friendlyName] A friendly name for the frontDoor + * @property {array} [routingRules] Routing rules associated with this Front * Door. - * @member {array} [loadBalancingSettings] Load balancing settings associated + * @property {array} [loadBalancingSettings] Load balancing settings + * associated with this Front Door instance. + * @property {array} [healthProbeSettings] Health probe settings associated * with this Front Door instance. - * @member {array} [healthProbeSettings] Health probe settings associated - * with this Front Door instance. - * @member {array} [backendPools] Backend pools available to routing rules. - * @member {array} [frontendEndpoints] Frontend endpoints available to + * @property {array} [backendPools] Backend pools available to routing rules. + * @property {array} [frontendEndpoints] Frontend endpoints available to * routing rules. - * @member {string} [enabledState] Operational status of the Front Door load - * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values - * include: 'Enabled', 'Disabled' + * @property {string} [enabledState] Operational status of the Front Door + * load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js b/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js index d4cd4f4d82..eb8df59aea 100644 --- a/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpoint.js @@ -20,22 +20,23 @@ const models = require('./index'); class FrontendEndpoint extends models['SubResource'] { /** * Create a FrontendEndpoint. - * @member {string} [hostName] The host name of the frontendEndpoint. Must be - * a domain name. - * @member {string} [sessionAffinityEnabledState] Whether to allow session + * @property {string} [hostName] The host name of the frontendEndpoint. Must + * be a domain name. + * @property {string} [sessionAffinityEnabledState] Whether to allow session * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible * values include: 'Enabled', 'Disabled' - * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * @property {number} [sessionAffinityTtlSeconds] UNUSED. This field will be * ignored. The TTL to use in seconds for session affinity, if applicable. - * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * @property {object} [webApplicationFirewallPolicyLink] Defines the Web * Application Firewall policy for each host (if applicable) - * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [customHttpsProvisioningState] Provisioning status of + * @property {string} [webApplicationFirewallPolicyLink.id] Resource ID. + * @property {string} [resourceState] Resource status. Possible values + * include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @property {string} [customHttpsProvisioningState] Provisioning status of * Custom Https of the frontendEndpoint. Possible values include: 'Enabling', * 'Enabled', 'Disabling', 'Disabled', 'Failed' - * @member {string} [customHttpsProvisioningSubstate] Provisioning substate + * @property {string} [customHttpsProvisioningSubstate] Provisioning substate * shows the progress of custom HTTPS enabling/disabling process step by * step. Possible values include: 'SubmittingDomainControlValidationRequest', * 'PendingDomainControlValidationREquestApproval', @@ -44,26 +45,26 @@ class FrontendEndpoint extends models['SubResource'] { * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', * 'CertificateDeleted' - * @member {object} [customHttpsConfiguration] The configuration specifying + * @property {object} [customHttpsConfiguration] The configuration specifying * how to enable HTTPS - * @member {string} [customHttpsConfiguration.certificateSource] Defines the - * source of the SSL certificate. Possible values include: 'AzureKeyVault', - * 'FrontDoor' - * @member {string} [customHttpsConfiguration.protocolType] Defines the TLS + * @property {string} [customHttpsConfiguration.certificateSource] Defines + * the source of the SSL certificate. Possible values include: + * 'AzureKeyVault', 'FrontDoor' + * @property {string} [customHttpsConfiguration.protocolType] Defines the TLS * extension protocol that is used for secure delivery. Possible values * include: 'ServerNameIndication' - * @member {object} [customHttpsConfiguration.vault] The Key Vault containing - * the SSL certificate - * @member {string} [customHttpsConfiguration.vault.id] Resource ID. - * @member {string} [customHttpsConfiguration.secretName] The name of the Key - * Vault secret representing the full certificate PFX - * @member {string} [customHttpsConfiguration.secretVersion] The version of + * @property {object} [customHttpsConfiguration.vault] The Key Vault + * containing the SSL certificate + * @property {string} [customHttpsConfiguration.vault.id] Resource ID. + * @property {string} [customHttpsConfiguration.secretName] The name of the + * Key Vault secret representing the full certificate PFX + * @property {string} [customHttpsConfiguration.secretVersion] The version of * the Key Vault secret representing the full certificate PFX - * @member {string} [customHttpsConfiguration.certificateType] Defines the + * @property {string} [customHttpsConfiguration.certificateType] Defines the * type of the certificate used for secure connections to a frontendEndpoint. * Possible values include: 'Dedicated' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointLink.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointLink.js new file mode 100644 index 0000000000..80767932b9 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointLink.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines the Resource ID for a Frontend Endpoint. + * + */ +class FrontendEndpointLink { + /** + * Create a FrontendEndpointLink. + * @property {string} [id] Resource ID. + */ + constructor() { + } + + /** + * Defines the metadata of FrontendEndpointLink + * + * @returns {object} metadata of FrontendEndpointLink + * + */ + mapper() { + return { + required: false, + serializedName: 'FrontendEndpointLink', + type: { + name: 'Composite', + className: 'FrontendEndpointLink', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FrontendEndpointLink; diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js index 4661f6aed1..cb81e5faca 100644 --- a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParameters.js @@ -17,16 +17,16 @@ class FrontendEndpointUpdateParameters { /** * Create a FrontendEndpointUpdateParameters. - * @member {string} [hostName] The host name of the frontendEndpoint. Must be - * a domain name. - * @member {string} [sessionAffinityEnabledState] Whether to allow session + * @property {string} [hostName] The host name of the frontendEndpoint. Must + * be a domain name. + * @property {string} [sessionAffinityEnabledState] Whether to allow session * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible * values include: 'Enabled', 'Disabled' - * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be + * @property {number} [sessionAffinityTtlSeconds] UNUSED. This field will be * ignored. The TTL to use in seconds for session affinity, if applicable. - * @member {object} [webApplicationFirewallPolicyLink] Defines the Web + * @property {object} [webApplicationFirewallPolicyLink] Defines the Web * Application Firewall policy for each host (if applicable) - * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. + * @property {string} [webApplicationFirewallPolicyLink.id] Resource ID. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js index 3fa1e51455..17f6c065ec 100644 --- a/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointUpdateParametersWebApplicationFirewallPolicyLink.js @@ -17,7 +17,7 @@ class FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink { /** * Create a FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink. - * @member {string} [id] Resource ID. + * @property {string} [id] Resource ID. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js b/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js index 381bdce9c5..3c9a9b8d6d 100644 --- a/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js +++ b/lib/services/frontdoorManagement/lib/models/frontendEndpointsListResult.js @@ -12,13 +12,13 @@ /** * Result of the request to list frontend endpoints. It contains a list of - * Frontend endpoint objects and a URL link to get the the next set of results. + * Frontend endpoint objects and a URL link to get the next set of results. */ class FrontendEndpointsListResult extends Array { /** * Create a FrontendEndpointsListResult. - * @member {string} [nextLink] URL to get the next set of frontend endpoints - * if there are any. + * @property {string} [nextLink] URL to get the next set of frontend + * endpoints if there are any. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js index 6449669558..926ec93975 100644 --- a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsListResult.js @@ -12,14 +12,13 @@ /** * Result of the request to list HealthProbeSettings. It contains a list of - * HealthProbeSettings objects and a URL link to get the the next set of - * results. + * HealthProbeSettings objects and a URL link to get the next set of results. */ class HealthProbeSettingsListResult extends Array { /** * Create a HealthProbeSettingsListResult. - * @member {string} [nextLink] URL to get the next set of HealthProbeSettings - * objects if there are any. + * @property {string} [nextLink] URL to get the next set of + * HealthProbeSettings objects if there are any. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js index 551e3d35b2..ce2068c453 100644 --- a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsModel.js @@ -20,15 +20,17 @@ const models = require('./index'); class HealthProbeSettingsModel extends models['SubResource'] { /** * Create a HealthProbeSettingsModel. - * @member {string} [path] The path to use for the health probe. Default is / - * @member {string} [protocol] Protocol scheme to use for this probe. + * @property {string} [path] The path to use for the health probe. Default is + * / + * @property {string} [protocol] Protocol scheme to use for this probe. * Possible values include: 'Http', 'Https' - * @member {number} [intervalInSeconds] The number of seconds between health - * probes. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {number} [intervalInSeconds] The number of seconds between + * health probes. + * @property {string} [resourceState] Resource status. Possible values + * include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js index 6c87904add..b526599c9d 100644 --- a/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/healthProbeSettingsUpdateParameters.js @@ -17,11 +17,12 @@ class HealthProbeSettingsUpdateParameters { /** * Create a HealthProbeSettingsUpdateParameters. - * @member {string} [path] The path to use for the health probe. Default is / - * @member {string} [protocol] Protocol scheme to use for this probe. + * @property {string} [path] The path to use for the health probe. Default is + * / + * @property {string} [protocol] Protocol scheme to use for this probe. * Possible values include: 'Http', 'Https' - * @member {number} [intervalInSeconds] The number of seconds between health - * probes. + * @property {number} [intervalInSeconds] The number of seconds between + * health probes. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/index.d.ts b/lib/services/frontdoorManagement/lib/models/index.d.ts index 78bf28e1b7..505a731ecd 100644 --- a/lib/services/frontdoorManagement/lib/models/index.d.ts +++ b/lib/services/frontdoorManagement/lib/models/index.d.ts @@ -1,656 +1,661 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * Common resource representation. - * - * @member {string} [id] Resource ID. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} [location] Resource location. - * @member {object} [tags] Resource tags. */ export interface Resource extends BaseResource { + /** + * Resource ID. + */ readonly id?: string; + /** + * Resource name. + */ readonly name?: string; + /** + * Resource type. + */ readonly type?: string; + /** + * Resource location. + */ location?: string; + /** + * Resource tags. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the FrontDoor class. - * @constructor - * Front Door represents a collection of backend endpoints to route traffic to - * along with rules that specify how traffic is sent there. - * - * @member {string} [friendlyName] A friendly name for the frontDoor - * @member {array} [routingRules] Routing rules associated with this Front - * Door. - * @member {array} [loadBalancingSettings] Load balancing settings associated - * with this Front Door instance. - * @member {array} [healthProbeSettings] Health probe settings associated with - * this Front Door instance. - * @member {array} [backendPools] Backend pools available to routing rules. - * @member {array} [frontendEndpoints] Frontend endpoints available to routing - * rules. - * @member {string} [enabledState] Operational status of the Front Door load - * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values - * include: 'Enabled', 'Disabled' - * @member {string} [resourceState] Resource status of the Front Door. Possible - * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', - * 'Deleting' - * @member {string} [provisioningState] Provisioning state of the Front Door. - * @member {string} [cname] The host that each frontendEndpoint must CNAME to. + * Front Door represents a collection of backend endpoints to route traffic to along with rules + * that specify how traffic is sent there. */ export interface FrontDoor extends Resource { + /** + * A friendly name for the frontDoor + */ friendlyName?: string; + /** + * Routing rules associated with this Front Door. + */ routingRules?: RoutingRule[]; + /** + * Load balancing settings associated with this Front Door instance. + */ loadBalancingSettings?: LoadBalancingSettingsModel[]; + /** + * Health probe settings associated with this Front Door instance. + */ healthProbeSettings?: HealthProbeSettingsModel[]; + /** + * Backend pools available to routing rules. + */ backendPools?: BackendPool[]; + /** + * Frontend endpoints available to routing rules. + */ frontendEndpoints?: FrontendEndpoint[]; + /** + * Operational status of the Front Door load balancer. Permitted values are 'Enabled' or + * 'Disabled'. Possible values include: 'Enabled', 'Disabled' + */ enabledState?: string; + /** + * Resource status of the Front Door. Possible values include: 'Creating', 'Enabling', 'Enabled', + * 'Disabling', 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Provisioning state of the Front Door. + */ readonly provisioningState?: string; + /** + * The host that each frontendEndpoint must CNAME to. + */ readonly cname?: string; } /** - * @class - * Initializes a new instance of the SubResource class. - * @constructor * Reference to another subresource. - * - * @member {string} [id] Resource ID. */ export interface SubResource extends BaseResource { + /** + * Resource ID. + */ id?: string; } /** - * @class - * Initializes a new instance of the RoutingRule class. - * @constructor - * A routing rule represents a specification for traffic to treat and where to - * send it, along with health probe information. - * - * @member {array} [frontendEndpoints] Frontend endpoints associated with this - * rule - * @member {array} [acceptedProtocols] Protocol schemes to match for this rule - * @member {array} [patternsToMatch] The route patterns of the rule. - * @member {string} [customForwardingPath] A custom path used to rewrite - * resource paths matched by this rule. Leave empty to use incoming path. - * @member {string} [forwardingProtocol] Protocol this rule will use when - * forwarding traffic to backends. Possible values include: 'HttpOnly', - * 'HttpsOnly', 'MatchRequest' - * @member {object} [cacheConfiguration] The caching configuration associated - * with this rule. - * @member {string} [cacheConfiguration.queryParameterStripDirective] Treatment - * of URL query terms when forming the cache key. Possible values include: - * 'StripNone', 'StripAll' - * @member {string} [cacheConfiguration.dynamicCompression] Whether to use - * dynamic compression for cached content. Possible values include: 'Enabled', - * 'Disabled' - * @member {object} [backendPool] A reference to the BackendPool which this - * rule routes to. - * @member {string} [backendPool.id] Resource ID. - * @member {string} [enabledState] Whether to enable use of this rule. - * Permitted values are 'Enabled' or 'Disabled'. Possible values include: - * 'Enabled', 'Disabled' - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * A routing rule represents a specification for traffic to treat and where to send it, along with + * health probe information. */ export interface RoutingRule extends SubResource { + /** + * Frontend endpoints associated with this rule + */ frontendEndpoints?: SubResource[]; + /** + * Protocol schemes to match for this rule + */ acceptedProtocols?: string[]; + /** + * The route patterns of the rule. + */ patternsToMatch?: string[]; + /** + * A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming + * path. + */ customForwardingPath?: string; + /** + * Protocol this rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + */ forwardingProtocol?: string; + /** + * The caching configuration associated with this rule. + */ cacheConfiguration?: CacheConfiguration; + /** + * A reference to the BackendPool which this rule routes to. + */ backendPool?: SubResource; + /** + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + */ enabledState?: string; + /** + * Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Resource name. + */ name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the LoadBalancingSettingsModel class. - * @constructor * Load balancing settings for a backend pool - * - * @member {number} [sampleSize] The number of samples to consider for load - * balancing decisions - * @member {number} [successfulSamplesRequired] The number of samples within - * the sample period that must succeed - * @member {number} [additionalLatencyMilliseconds] The additional latency in - * milliseconds for probes to fall into the lowest latency bucket - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. */ export interface LoadBalancingSettingsModel extends SubResource { + /** + * The number of samples to consider for load balancing decisions + */ sampleSize?: number; + /** + * The number of samples within the sample period that must succeed + */ successfulSamplesRequired?: number; + /** + * The additional latency in milliseconds for probes to fall into the lowest latency bucket + */ additionalLatencyMilliseconds?: number; + /** + * Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Resource name. + */ name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the HealthProbeSettingsModel class. - * @constructor * Load balancing settings for a backend pool - * - * @member {string} [path] The path to use for the health probe. Default is / - * @member {string} [protocol] Protocol scheme to use for this probe. Possible - * values include: 'Http', 'Https' - * @member {number} [intervalInSeconds] The number of seconds between health - * probes. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. */ export interface HealthProbeSettingsModel extends SubResource { + /** + * The path to use for the health probe. Default is / + */ path?: string; + /** + * Protocol scheme to use for this probe. Possible values include: 'Http', 'Https' + */ protocol?: string; + /** + * The number of seconds between health probes. + */ intervalInSeconds?: number; + /** + * Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Resource name. + */ name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the BackendPool class. - * @constructor * A backend pool is a collection of backends that can be routed to. - * - * @member {array} [backends] The set of backends for this pool - * @member {object} [loadBalancingSettings] Load balancing settings for a - * backend pool - * @member {string} [loadBalancingSettings.id] Resource ID. - * @member {object} [healthProbeSettings] L7 health probe settings for a - * backend pool - * @member {string} [healthProbeSettings.id] Resource ID. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. */ export interface BackendPool extends SubResource { + /** + * The set of backends for this pool + */ backends?: Backend[]; + /** + * Load balancing settings for a backend pool + */ loadBalancingSettings?: SubResource; + /** + * L7 health probe settings for a backend pool + */ healthProbeSettings?: SubResource; + /** + * Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Resource name. + */ name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the KeyVaultCertificateSourceParametersVault class. - * @constructor * The Key Vault containing the SSL certificate - * - * @member {string} [id] Resource ID. */ export interface KeyVaultCertificateSourceParametersVault { + /** + * Resource ID. + */ id?: string; } /** - * @class - * Initializes a new instance of the CustomHttpsConfiguration class. - * @constructor * Https settings for a domain - * - * @member {string} [certificateSource] Defines the source of the SSL - * certificate. Possible values include: 'AzureKeyVault', 'FrontDoor' - * @member {string} [protocolType] Defines the TLS extension protocol that is - * used for secure delivery. Possible values include: 'ServerNameIndication' - * @member {object} [vault] The Key Vault containing the SSL certificate - * @member {string} [vault.id] Resource ID. - * @member {string} [secretName] The name of the Key Vault secret representing - * the full certificate PFX - * @member {string} [secretVersion] The version of the Key Vault secret - * representing the full certificate PFX - * @member {string} [certificateType] Defines the type of the certificate used - * for secure connections to a frontendEndpoint. Possible values include: - * 'Dedicated' */ export interface CustomHttpsConfiguration { + /** + * Defines the source of the SSL certificate. Possible values include: 'AzureKeyVault', + * 'FrontDoor' + */ certificateSource?: string; + /** + * Defines the TLS extension protocol that is used for secure delivery. Possible values include: + * 'ServerNameIndication' + */ protocolType?: string; + /** + * The Key Vault containing the SSL certificate + */ vault?: KeyVaultCertificateSourceParametersVault; + /** + * The name of the Key Vault secret representing the full certificate PFX + */ secretName?: string; + /** + * The version of the Key Vault secret representing the full certificate PFX + */ secretVersion?: string; + /** + * Defines the type of the certificate used for secure connections to a frontendEndpoint. + * Possible values include: 'Dedicated' + */ certificateType?: string; } /** - * @class - * Initializes a new instance of the FrontendEndpoint class. - * @constructor * A frontend endpoint used for routing. - * - * @member {string} [hostName] The host name of the frontendEndpoint. Must be a - * domain name. - * @member {string} [sessionAffinityEnabledState] Whether to allow session - * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible - * values include: 'Enabled', 'Disabled' - * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be - * ignored. The TTL to use in seconds for session affinity, if applicable. - * @member {object} [webApplicationFirewallPolicyLink] Defines the Web - * Application Firewall policy for each host (if applicable) - * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [customHttpsProvisioningState] Provisioning status of - * Custom Https of the frontendEndpoint. Possible values include: 'Enabling', - * 'Enabled', 'Disabling', 'Disabled', 'Failed' - * @member {string} [customHttpsProvisioningSubstate] Provisioning substate - * shows the progress of custom HTTPS enabling/disabling process step by step. - * Possible values include: 'SubmittingDomainControlValidationRequest', - * 'PendingDomainControlValidationREquestApproval', - * 'DomainControlValidationRequestApproved', - * 'DomainControlValidationRequestRejected', - * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', - * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', - * 'CertificateDeleted' - * @member {object} [customHttpsConfiguration] The configuration specifying how - * to enable HTTPS - * @member {string} [customHttpsConfiguration.certificateSource] Defines the - * source of the SSL certificate. Possible values include: 'AzureKeyVault', - * 'FrontDoor' - * @member {string} [customHttpsConfiguration.protocolType] Defines the TLS - * extension protocol that is used for secure delivery. Possible values - * include: 'ServerNameIndication' - * @member {object} [customHttpsConfiguration.vault] The Key Vault containing - * the SSL certificate - * @member {string} [customHttpsConfiguration.vault.id] Resource ID. - * @member {string} [customHttpsConfiguration.secretName] The name of the Key - * Vault secret representing the full certificate PFX - * @member {string} [customHttpsConfiguration.secretVersion] The version of the - * Key Vault secret representing the full certificate PFX - * @member {string} [customHttpsConfiguration.certificateType] Defines the type - * of the certificate used for secure connections to a frontendEndpoint. - * Possible values include: 'Dedicated' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. */ export interface FrontendEndpoint extends SubResource { + /** + * The host name of the frontendEndpoint. Must be a domain name. + */ hostName?: string; + /** + * Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + */ sessionAffinityEnabledState?: string; + /** + * UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if + * applicable. + */ sessionAffinityTtlSeconds?: number; + /** + * Defines the Web Application Firewall policy for each host (if applicable) + */ webApplicationFirewallPolicyLink?: FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; + /** + * Resource status. Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ resourceState?: string; + /** + * Provisioning status of Custom Https of the frontendEndpoint. Possible values include: + * 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' + */ readonly customHttpsProvisioningState?: string; + /** + * Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by + * step. Possible values include: 'SubmittingDomainControlValidationRequest', + * 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', + * 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', + * 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', + * 'CertificateDeleted' + */ readonly customHttpsProvisioningSubstate?: string; + /** + * The configuration specifying how to enable HTTPS + */ readonly customHttpsConfiguration?: CustomHttpsConfiguration; + /** + * Resource name. + */ name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the FrontDoorUpdateParameters class. - * @constructor * The properties needed to update a Front Door - * - * @member {string} [friendlyName] A friendly name for the frontDoor - * @member {array} [routingRules] Routing rules associated with this Front - * Door. - * @member {array} [loadBalancingSettings] Load balancing settings associated - * with this Front Door instance. - * @member {array} [healthProbeSettings] Health probe settings associated with - * this Front Door instance. - * @member {array} [backendPools] Backend pools available to routing rules. - * @member {array} [frontendEndpoints] Frontend endpoints available to routing - * rules. - * @member {string} [enabledState] Operational status of the Front Door load - * balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values - * include: 'Enabled', 'Disabled' */ export interface FrontDoorUpdateParameters { + /** + * A friendly name for the frontDoor + */ friendlyName?: string; + /** + * Routing rules associated with this Front Door. + */ routingRules?: RoutingRule[]; + /** + * Load balancing settings associated with this Front Door instance. + */ loadBalancingSettings?: LoadBalancingSettingsModel[]; + /** + * Health probe settings associated with this Front Door instance. + */ healthProbeSettings?: HealthProbeSettingsModel[]; + /** + * Backend pools available to routing rules. + */ backendPools?: BackendPool[]; + /** + * Frontend endpoints available to routing rules. + */ frontendEndpoints?: FrontendEndpoint[]; + /** + * Operational status of the Front Door load balancer. Permitted values are 'Enabled' or + * 'Disabled'. Possible values include: 'Enabled', 'Disabled' + */ enabledState?: string; } /** - * @class - * Initializes a new instance of the PurgeParameters class. - * @constructor * Parameters required for content purge. - * - * @member {array} contentPaths The path to the content to be purged. Can - * describe a file path or a wild card directory. */ export interface PurgeParameters { + /** + * The path to the content to be purged. Can describe a file path or a wild card directory. + */ contentPaths: string[]; } /** - * @class - * Initializes a new instance of the CacheConfiguration class. - * @constructor - * Caching settings for a caching-type route. To disable caching, do not - * provide a cacheConfiguration object. - * - * @member {string} [queryParameterStripDirective] Treatment of URL query terms - * when forming the cache key. Possible values include: 'StripNone', 'StripAll' - * @member {string} [dynamicCompression] Whether to use dynamic compression for - * cached content. Possible values include: 'Enabled', 'Disabled' + * Caching settings for a caching-type route. To disable caching, do not provide a + * cacheConfiguration object. */ export interface CacheConfiguration { + /** + * Treatment of URL query terms when forming the cache key. Possible values include: 'StripNone', + * 'StripAll' + */ queryParameterStripDirective?: string; + /** + * Whether to use dynamic compression for cached content. Possible values include: 'Enabled', + * 'Disabled' + */ dynamicCompression?: string; } /** - * @class - * Initializes a new instance of the RoutingRuleUpdateParameters class. - * @constructor * Routing rules to apply to an endpoint - * - * @member {array} [frontendEndpoints] Frontend endpoints associated with this - * rule - * @member {array} [acceptedProtocols] Protocol schemes to match for this rule - * @member {array} [patternsToMatch] The route patterns of the rule. - * @member {string} [customForwardingPath] A custom path used to rewrite - * resource paths matched by this rule. Leave empty to use incoming path. - * @member {string} [forwardingProtocol] Protocol this rule will use when - * forwarding traffic to backends. Possible values include: 'HttpOnly', - * 'HttpsOnly', 'MatchRequest' - * @member {object} [cacheConfiguration] The caching configuration associated - * with this rule. - * @member {string} [cacheConfiguration.queryParameterStripDirective] Treatment - * of URL query terms when forming the cache key. Possible values include: - * 'StripNone', 'StripAll' - * @member {string} [cacheConfiguration.dynamicCompression] Whether to use - * dynamic compression for cached content. Possible values include: 'Enabled', - * 'Disabled' - * @member {object} [backendPool] A reference to the BackendPool which this - * rule routes to. - * @member {string} [backendPool.id] Resource ID. - * @member {string} [enabledState] Whether to enable use of this rule. - * Permitted values are 'Enabled' or 'Disabled'. Possible values include: - * 'Enabled', 'Disabled' */ export interface RoutingRuleUpdateParameters { + /** + * Frontend endpoints associated with this rule + */ frontendEndpoints?: SubResource[]; + /** + * Protocol schemes to match for this rule + */ acceptedProtocols?: string[]; + /** + * The route patterns of the rule. + */ patternsToMatch?: string[]; + /** + * A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming + * path. + */ customForwardingPath?: string; + /** + * Protocol this rule will use when forwarding traffic to backends. Possible values include: + * 'HttpOnly', 'HttpsOnly', 'MatchRequest' + */ forwardingProtocol?: string; + /** + * The caching configuration associated with this rule. + */ cacheConfiguration?: CacheConfiguration; + /** + * A reference to the BackendPool which this rule routes to. + */ backendPool?: SubResource; + /** + * Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + */ enabledState?: string; } /** - * @class - * Initializes a new instance of the Backend class. - * @constructor * Backend address of a frontDoor load balancer. - * - * @member {string} [address] Location of the backend (IP address or FQDN) - * @member {number} [httpPort] The HTTP TCP port number. Must be between 1 and - * 65535. - * @member {number} [httpsPort] The HTTPS TCP port number. Must be between 1 - * and 65535. - * @member {string} [enabledState] Whether to enable use of this backend. - * Permitted values are 'Enabled' or 'Disabled'. Possible values include: - * 'Enabled', 'Disabled' - * @member {number} [priority] Priority to use for load balancing. Higher - * priorities will not be used for load balancing if any lower priority backend - * is healthy. - * @member {number} [weight] Weight of this endpoint for load balancing - * purposes. - * @member {string} [backendHostHeader] The value to use as the host header - * sent to the backend. If blank or unspecified, this defaults to the incoming - * host. */ export interface Backend { + /** + * Location of the backend (IP address or FQDN) + */ address?: string; + /** + * The HTTP TCP port number. Must be between 1 and 65535. + */ httpPort?: number; + /** + * The HTTPS TCP port number. Must be between 1 and 65535. + */ httpsPort?: number; + /** + * Whether to enable use of this backend. Permitted values are 'Enabled' or 'Disabled'. Possible + * values include: 'Enabled', 'Disabled' + */ enabledState?: string; + /** + * Priority to use for load balancing. Higher priorities will not be used for load balancing if + * any lower priority backend is healthy. + */ priority?: number; + /** + * Weight of this endpoint for load balancing purposes. + */ weight?: number; + /** + * The value to use as the host header sent to the backend. If blank or unspecified, this + * defaults to the incoming host. + */ backendHostHeader?: string; } /** - * @class - * Initializes a new instance of the LoadBalancingSettingsUpdateParameters class. - * @constructor * Round-Robin load balancing settings for a backend pool - * - * @member {number} [sampleSize] The number of samples to consider for load - * balancing decisions - * @member {number} [successfulSamplesRequired] The number of samples within - * the sample period that must succeed - * @member {number} [additionalLatencyMilliseconds] The additional latency in - * milliseconds for probes to fall into the lowest latency bucket */ export interface LoadBalancingSettingsUpdateParameters { + /** + * The number of samples to consider for load balancing decisions + */ sampleSize?: number; + /** + * The number of samples within the sample period that must succeed + */ successfulSamplesRequired?: number; + /** + * The additional latency in milliseconds for probes to fall into the lowest latency bucket + */ additionalLatencyMilliseconds?: number; } /** - * @class - * Initializes a new instance of the HealthProbeSettingsUpdateParameters class. - * @constructor * L7 health probe settings for a backend pool - * - * @member {string} [path] The path to use for the health probe. Default is / - * @member {string} [protocol] Protocol scheme to use for this probe. Possible - * values include: 'Http', 'Https' - * @member {number} [intervalInSeconds] The number of seconds between health - * probes. */ export interface HealthProbeSettingsUpdateParameters { + /** + * The path to use for the health probe. Default is / + */ path?: string; + /** + * Protocol scheme to use for this probe. Possible values include: 'Http', 'Https' + */ protocol?: string; + /** + * The number of seconds between health probes. + */ intervalInSeconds?: number; } /** - * @class - * Initializes a new instance of the BackendPoolUpdateParameters class. - * @constructor * A collection of backends that can be routed to. - * - * @member {array} [backends] The set of backends for this pool - * @member {object} [loadBalancingSettings] Load balancing settings for a - * backend pool - * @member {string} [loadBalancingSettings.id] Resource ID. - * @member {object} [healthProbeSettings] L7 health probe settings for a - * backend pool - * @member {string} [healthProbeSettings.id] Resource ID. */ export interface BackendPoolUpdateParameters { + /** + * The set of backends for this pool + */ backends?: Backend[]; + /** + * Load balancing settings for a backend pool + */ loadBalancingSettings?: SubResource; + /** + * L7 health probe settings for a backend pool + */ healthProbeSettings?: SubResource; } /** - * @class - * Initializes a new instance of the FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink class. - * @constructor * Defines the Web Application Firewall policy for each host (if applicable) - * - * @member {string} [id] Resource ID. */ export interface FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink { + /** + * Resource ID. + */ id?: string; } /** - * @class - * Initializes a new instance of the FrontendEndpointUpdateParameters class. - * @constructor * Frontend endpoint used in routing rule - * - * @member {string} [hostName] The host name of the frontendEndpoint. Must be a - * domain name. - * @member {string} [sessionAffinityEnabledState] Whether to allow session - * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible - * values include: 'Enabled', 'Disabled' - * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be - * ignored. The TTL to use in seconds for session affinity, if applicable. - * @member {object} [webApplicationFirewallPolicyLink] Defines the Web - * Application Firewall policy for each host (if applicable) - * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID. */ export interface FrontendEndpointUpdateParameters { + /** + * The host name of the frontendEndpoint. Must be a domain name. + */ hostName?: string; + /** + * Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. + * Possible values include: 'Enabled', 'Disabled' + */ sessionAffinityEnabledState?: string; + /** + * UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if + * applicable. + */ sessionAffinityTtlSeconds?: number; + /** + * Defines the Web Application Firewall policy for each host (if applicable) + */ webApplicationFirewallPolicyLink?: FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink; } /** - * @class - * Initializes a new instance of the ValidateCustomDomainInput class. - * @constructor * Input of the custom domain to be validated for DNS mapping. - * - * @member {string} hostName The host name of the custom domain. Must be a - * domain name. */ export interface ValidateCustomDomainInput { + /** + * The host name of the custom domain. Must be a domain name. + */ hostName: string; } /** - * @class - * Initializes a new instance of the ValidateCustomDomainOutput class. - * @constructor * Output of custom domain validation. - * - * @member {boolean} [customDomainValidated] Indicates whether the custom - * domain is valid or not. - * @member {string} [reason] The reason why the custom domain is not valid. - * @member {string} [message] Error message describing why the custom domain is - * not valid. */ export interface ValidateCustomDomainOutput { + /** + * Indicates whether the custom domain is valid or not. + */ readonly customDomainValidated?: boolean; + /** + * The reason why the custom domain is not valid. + */ readonly reason?: string; + /** + * Error message describing why the custom domain is not valid. + */ readonly message?: string; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * Error reponse indicates Front Door service is not able to process the - * incoming request. The reason is provided in the error message. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. + * Error response indicates Front Door service is not able to process the incoming request. The + * reason is provided in the error message. */ export interface ErrorResponse { + /** + * Error code. + */ readonly code?: string; + /** + * Error message indicating why the operation failed. + */ readonly message?: string; } /** - * @class - * Initializes a new instance of the CheckNameAvailabilityInput class. - * @constructor * Input of CheckNameAvailability API. - * - * @member {string} name The resource name to validate. - * @member {string} type The type of the resource whose name is to be - * validated. Possible values include: 'Microsoft.Network/frontDoors', - * 'Microsoft.Network/frontDoors/frontendEndpoints' */ export interface CheckNameAvailabilityInput { + /** + * The resource name to validate. + */ name: string; + /** + * The type of the resource whose name is to be validated. Possible values include: + * 'Microsoft.Network/frontDoors', 'Microsoft.Network/frontDoors/frontendEndpoints' + */ type: string; } /** - * @class - * Initializes a new instance of the CheckNameAvailabilityOutput class. - * @constructor * Output of check name availability API. - * - * @member {string} [nameAvailability] Indicates whether the name is available. - * Possible values include: 'Available', 'Unavailable' - * @member {string} [reason] The reason why the name is not available. - * @member {string} [message] The detailed error message describing why the - * name is not available. */ export interface CheckNameAvailabilityOutput { + /** + * Indicates whether the name is available. Possible values include: 'Available', 'Unavailable' + */ readonly nameAvailability?: string; + /** + * The reason why the name is not available. + */ readonly reason?: string; + /** + * The detailed error message describing why the name is not available. + */ readonly message?: string; } -/** - * @class - * Initializes a new instance of the ErrorDetails class. - * @constructor - * @member {string} [code] - * @member {string} [target] - * @member {string} [message] - */ export interface ErrorDetails { code?: string; target?: string; message?: string; } -/** - * @class - * Initializes a new instance of the ErrorModel class. - * @constructor - * @member {string} [code] - * @member {string} [message] - * @member {string} [target] - * @member {array} [details] - * @member {string} [innerError] - */ export interface ErrorModel { code?: string; message?: string; @@ -660,323 +665,392 @@ export interface ErrorModel { } /** - * @class - * Initializes a new instance of the AzureAsyncOperationResult class. - * @constructor - * The response body contains the status of the specified asynchronous - * operation, indicating whether it has succeeded, is in progress, or has - * failed. Note that this status is distinct from the HTTP status code returned - * for the Get Operation Status operation itself. If the asynchronous operation - * succeeded, the response body includes the HTTP status code for the - * successful request. If the asynchronous operation failed, the response body - * includes the HTTP status code for the failed request and error information - * regarding the failure. - * - * @member {string} [status] Status of the Azure async operation. Possible - * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values - * include: 'InProgress', 'Succeeded', 'Failed' - * @member {object} [error] - * @member {string} [error.code] - * @member {string} [error.message] - * @member {string} [error.target] - * @member {array} [error.details] - * @member {string} [error.innerError] - */ + * The response body contains the status of the specified asynchronous operation, indicating + * whether it has succeeded, is in progress, or has failed. Note that this status is distinct from + * the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous + * operation succeeded, the response body includes the HTTP status code for the successful request. + * If the asynchronous operation failed, the response body includes the HTTP status code for the + * failed request and error information regarding the failure. +*/ export interface AzureAsyncOperationResult { + /** + * Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and + * 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' + */ status?: string; error?: ErrorModel; } /** - * @class - * Initializes a new instance of the TagsObject class. - * @constructor * Tags object for patch operations. - * - * @member {object} [tags] Resource tags. - */ +*/ export interface TagsObject { + /** + * Resource tags. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the PolicySettings class. - * @constructor - * Defines contents of a web application firewall global configuration - * - * @member {string} [enabledState] describes if the policy is in enabled state - * or disabled state. Possible values include: 'Disabled', 'Enabled' - * @member {string} [mode] Describes if it is in detection mode or prevention - * mode at policy level. Possible values include: 'Prevention', 'Detection' - */ + * Defines top-level WebApplicationFirewallPolicy configuration settings. +*/ export interface PolicySettings { + /** + * Describes if the policy is in enabled or disabled state. Defaults to Enabled if not specified. + * Possible values include: 'Disabled', 'Enabled' + */ enabledState?: string; + /** + * Describes if it is in detection mode or prevention mode at policy level. Possible values + * include: 'Prevention', 'Detection' + */ mode?: string; + /** + * If action type is redirect, this field represents redirect URL for the client. + */ + redirectUrl?: string; + /** + * If the action type is block, customer can override the response status code. + */ + customBlockResponseStatusCode?: number; + /** + * If the action type is block, customer can override the response body. The body must be + * specified in base64 encoding. + */ + customBlockResponseBody?: string; } /** - * @class - * Initializes a new instance of the MatchCondition1 class. - * @constructor - * Define match conditions - * - * @member {string} matchVariable Match Variable. Possible values include: - * 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri', - * 'RequestHeader', 'RequestBody' - * @member {string} [selector] Name of selector in RequestHeader or RequestBody - * to be matched - * @member {string} operator Describes operator to be matched. Possible values - * include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', 'LessThan', - * 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', - * 'EndsWith' - * @member {boolean} [negateCondition] Describes if this is negate condition or - * not - * @member {array} matchValue Match value - */ -export interface MatchCondition1 { + * Define a match condition. +*/ +export interface MatchCondition { + /** + * Match variable to compare against. Possible values include: 'RemoteAddr', 'RequestMethod', + * 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies' + */ matchVariable: string; + /** + * Selector can used to match against a specific key from QueryString, PostArgs, RequestHeader or + * Cookies. + */ selector?: string; + /** + * Describes operator to be matched. Possible values include: 'Any', 'IPMatch', 'GeoMatch', + * 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', + * 'BeginsWith', 'EndsWith', 'RegEx' + */ operator: string; + /** + * Describes if the result of this condition should be negated. + */ negateCondition?: boolean; + /** + * List of possible match values. + */ matchValue: string[]; + /** + * List of transforms. + */ + transforms?: string[]; } /** - * @class - * Initializes a new instance of the CustomRule class. - * @constructor * Defines contents of a web application rule - * - * @member {string} [name] Gets name of the resource that is unique within a - * policy. This name can be used to access the resource. - * @member {string} [etag] Gets a unique read-only string that changes whenever - * the resource is updated. - * @member {number} priority Describes priority of the rule. Rules with a lower - * value will be evaluated before rules with a higher value - * @member {string} ruleType Describes type of rule. Possible values include: - * 'MatchRule', 'RateLimitRule' - * @member {number} [rateLimitDurationInMinutes] Defines rate limit duration. - * Default - 1 minute - * @member {number} [rateLimitThreshold] Defines rate limit thresold - * @member {array} matchConditions List of match conditions - * @member {string} action Type of Actions. Possible values include: 'Allow', - * 'Block', 'Log' - * @member {array} [transforms] List of transforms - */ +*/ export interface CustomRule { + /** + * Describes the name of the rule. + */ name?: string; - readonly etag?: string; + /** + * Describes priority of the rule. Rules with a lower value will be evaluated before rules with a + * higher value. + */ priority: number; + /** + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + */ + enabledState?: string; + /** + * Describes type of rule. Possible values include: 'MatchRule', 'RateLimitRule' + */ ruleType: string; + /** + * Defines rate limit duration. Default is 1 minute. + */ rateLimitDurationInMinutes?: number; + /** + * Defines rate limit threshold. + */ rateLimitThreshold?: number; - matchConditions: MatchCondition1[]; + /** + * List of match conditions. + */ + matchConditions: MatchCondition[]; + /** + * Describes what action to be applied when rule matches. Possible values include: 'Allow', + * 'Block', 'Log', 'Redirect' + */ action: string; - transforms?: string[]; } /** - * @class - * Initializes a new instance of the CustomRules class. - * @constructor * Defines contents of custom rules - * - * @member {array} [rules] List of rules - */ -export interface CustomRules { +*/ +export interface CustomRuleList { + /** + * List of rules + */ rules?: CustomRule[]; } /** - * @class - * Initializes a new instance of the ManagedRuleSet class. - * @constructor - * Base class for all types of ManagedRuleSet. - * - * @member {number} [priority] Describes priority of the rule - * @member {number} [version] defines version of the ruleset - * @member {string} ruleSetType Polymorphic Discriminator - */ + * Defines a managed rule group override setting. +*/ +export interface ManagedRuleOverride { + /** + * Identifier for the managed rule. + */ + ruleId: string; + /** + * Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + */ + enabledState?: string; + /** + * Describes the override action to be applied when rule matches. Possible values include: + * 'Allow', 'Block', 'Log', 'Redirect' + */ + action?: string; +} + +/** + * Defines a managed rule group override setting. +*/ +export interface ManagedRuleGroupOverride { + /** + * Describes the managed rule group to override. + */ + ruleGroupName: string; + /** + * List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + */ + rules?: ManagedRuleOverride[]; +} + +/** + * Defines a managed rule set. +*/ export interface ManagedRuleSet { - priority?: number; - version?: number; + /** + * Defines the rule set type to use. + */ ruleSetType: string; + /** + * Defines the version of the rule set to use. + */ + ruleSetVersion: string; + /** + * Defines the rule group overrides to apply to the rule set. + */ + ruleGroupOverrides?: ManagedRuleGroupOverride[]; } /** - * @class - * Initializes a new instance of the ManagedRuleSets class. - * @constructor - * Defines ManagedRuleSets - array of managedRuleSet - * - * @member {array} [ruleSets] List of rules - */ -export interface ManagedRuleSets { - ruleSets?: ManagedRuleSet[]; + * Defines the list of managed rule sets for the policy. +*/ +export interface ManagedRuleSetList { + /** + * List of rule sets. + */ + managedRuleSets?: ManagedRuleSet[]; +} + +/** + * Defines the Resource ID for a Frontend Endpoint. +*/ +export interface FrontendEndpointLink { + /** + * Resource ID. + */ + id?: string; } /** - * @class - * Initializes a new instance of the WebApplicationFirewallPolicy1 class. - * @constructor * Defines web application firewall policy. - * - * @member {object} [policySettings] Describes policySettings for policy - * @member {string} [policySettings.enabledState] describes if the policy is in - * enabled state or disabled state. Possible values include: 'Disabled', - * 'Enabled' - * @member {string} [policySettings.mode] Describes if it is in detection mode - * or prevention mode at policy level. Possible values include: 'Prevention', - * 'Detection' - * @member {object} [customRules] Describes custom rules inside the policy - * @member {array} [customRules.rules] List of rules - * @member {object} [managedRules] Describes managed rules inside the policy - * @member {array} [managedRules.ruleSets] List of rules - * @member {string} [provisioningState] Provisioning state of the - * WebApplicationFirewallPolicy. - * @member {string} [resourceState] Resource status of the policy. Possible - * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', - * 'Deleting' - * @member {string} [etag] Gets a unique read-only string that changes whenever - * the resource is updated. - */ +*/ export interface WebApplicationFirewallPolicy1 extends Resource { + /** + * Describes settings for the policy. + */ policySettings?: PolicySettings; - customRules?: CustomRules; - managedRules?: ManagedRuleSets; + /** + * Describes custom rules inside the policy. + */ + customRules?: CustomRuleList; + /** + * Describes managed rules inside the policy. + */ + managedRules?: ManagedRuleSetList; + /** + * Describes Frontend Endpoints associated with this Web Application Firewall policy. + */ + readonly frontendEndpointLinks?: FrontendEndpointLink[]; + /** + * Provisioning state of the policy. + */ readonly provisioningState?: string; + /** + * @summary Resource status of the policy. + * @description Possible values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', + * 'Disabled', 'Deleting' + */ readonly resourceState?: string; + /** + * Gets a unique read-only string that changes whenever the resource is updated. + */ etag?: string; } /** - * @class - * Initializes a new instance of the AzureManagedOverrideRuleGroup class. - * @constructor - * Defines contents of a web application rule - * - * @member {string} ruleGroupOverride Describes overrideruleGroup. Possible - * values include: 'SqlInjection', 'XSS' - * @member {string} action Type of Actions. Possible values include: 'Allow', - * 'Block', 'Log' - */ -export interface AzureManagedOverrideRuleGroup { - ruleGroupOverride: string; - action: string; + * Describes a managed rule definition. +*/ +export interface ManagedRuleDefinition { + /** + * Identifier for the managed rule. + */ + readonly ruleId?: string; + /** + * Describes the functionality of the managed rule. + */ + readonly description?: string; } /** - * @class - * Initializes a new instance of the AzureManagedRuleSet class. - * @constructor - * Describes azure managed provider. - * - * @member {array} [ruleGroupOverrides] List of azure managed provider override - * configuration (optional) - */ -export interface AzureManagedRuleSet extends ManagedRuleSet { - ruleGroupOverrides?: AzureManagedOverrideRuleGroup[]; + * Describes a managed rule group. +*/ +export interface ManagedRuleGroupDefinition { + /** + * Name of the managed rule group. + */ + readonly ruleGroupName?: string; + /** + * Description of the managed rule group. + */ + readonly description?: string; + /** + * List of rules within the managed rule group. + */ + readonly rules?: ManagedRuleDefinition[]; } +/** + * Describes the a managed rule set definition. +*/ +export interface ManagedRuleSetDefinition extends Resource { + /** + * Provisioning state of the managed rule set. + */ + readonly provisioningState?: string; + /** + * Type of the managed rule set. + */ + readonly ruleSetType?: string; + /** + * Version of the managed rule set type. + */ + readonly ruleSetVersion?: string; + /** + * Rule groups of the managed rule set. + */ + readonly ruleGroups?: ManagedRuleGroupDefinition[]; +} /** - * @class - * Initializes a new instance of the FrontDoorListResult class. - * @constructor - * Result of the request to list Front Doors. It contains a list of Front Door - * objects and a URL link to get the the next set of results. - * - * @member {string} [nextLink] URL to get the next set of Front Door objects if - * there are any. - */ + * Result of the request to list Front Doors. It contains a list of Front Door objects and a URL + * link to get the next set of results. +*/ export interface FrontDoorListResult extends Array { + /** + * URL to get the next set of Front Door objects if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the RoutingRuleListResult class. - * @constructor - * Result of the request to list Routing Rules. It contains a list of Routing - * Rule objects and a URL link to get the the next set of results. - * - * @member {string} [nextLink] URL to get the next set of RoutingRule objects - * if there are any. - */ + * Result of the request to list Routing Rules. It contains a list of Routing Rule objects and a + * URL link to get the next set of results. +*/ export interface RoutingRuleListResult extends Array { + /** + * URL to get the next set of RoutingRule objects if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the HealthProbeSettingsListResult class. - * @constructor - * Result of the request to list HealthProbeSettings. It contains a list of - * HealthProbeSettings objects and a URL link to get the the next set of - * results. - * - * @member {string} [nextLink] URL to get the next set of HealthProbeSettings - * objects if there are any. - */ + * Result of the request to list HealthProbeSettings. It contains a list of HealthProbeSettings + * objects and a URL link to get the next set of results. +*/ export interface HealthProbeSettingsListResult extends Array { + /** + * URL to get the next set of HealthProbeSettings objects if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the LoadBalancingSettingsListResult class. - * @constructor - * Result of the request to list load balancing settings. It contains a list of - * load balancing settings objects and a URL link to get the the next set of - * results. - * - * @member {string} [nextLink] URL to get the next set of LoadBalancingSettings - * objects if there are any. - */ + * Result of the request to list load balancing settings. It contains a list of load balancing + * settings objects and a URL link to get the next set of results. +*/ export interface LoadBalancingSettingsListResult extends Array { + /** + * URL to get the next set of LoadBalancingSettings objects if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the BackendPoolListResult class. - * @constructor - * Result of the request to list Backend Pools. It contains a list of Backend - * Pools objects and a URL link to get the the next set of results. - * - * @member {string} [nextLink] URL to get the next set of BackendPool objects - * if there are any. - */ + * Result of the request to list Backend Pools. It contains a list of Backend Pools objects and a + * URL link to get the next set of results. +*/ export interface BackendPoolListResult extends Array { + /** + * URL to get the next set of BackendPool objects if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the FrontendEndpointsListResult class. - * @constructor - * Result of the request to list frontend endpoints. It contains a list of - * Frontend endpoint objects and a URL link to get the the next set of results. - * - * @member {string} [nextLink] URL to get the next set of frontend endpoints if - * there are any. - */ + * Result of the request to list frontend endpoints. It contains a list of Frontend endpoint + * objects and a URL link to get the next set of results. +*/ export interface FrontendEndpointsListResult extends Array { + /** + * URL to get the next set of frontend endpoints if there are any. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the WebApplicationFirewallPolicyListResult class. - * @constructor - * Result of the request to list WebApplicationFirewallPolicies. It contains a - * list of WebApplicationFirewallPolicy objects and a URL link to get the the - * next set of results. - * - * @member {string} [nextLink] URL to get the next set of - * WebApplicationFirewallPolicy objects if there are any. - */ -export interface WebApplicationFirewallPolicyListResult extends Array { + * Defines a list of WebApplicationFirewallPolicies. It contains a list of + * WebApplicationFirewallPolicy objects and a URL link to get the the next set of results. +*/ +export interface WebApplicationFirewallPolicyList extends Array { + /** + * URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + */ + nextLink?: string; +} + +/** + * List of managed rule set definitions available for use in a policy. +*/ +export interface ManagedRuleSetDefinitionList extends Array { + /** + * URL to retrieve next set of managed rule set definitions. + */ nextLink?: string; } diff --git a/lib/services/frontdoorManagement/lib/models/index.js b/lib/services/frontdoorManagement/lib/models/index.js index 52d1260ba6..8e791a03cf 100644 --- a/lib/services/frontdoorManagement/lib/models/index.js +++ b/lib/services/frontdoorManagement/lib/models/index.js @@ -48,22 +48,23 @@ exports.ErrorModel = require('./errorModel'); exports.AzureAsyncOperationResult = require('./azureAsyncOperationResult'); exports.TagsObject = require('./tagsObject'); exports.PolicySettings = require('./policySettings'); -exports.MatchCondition1 = require('./matchCondition1'); +exports.MatchCondition = require('./matchCondition'); exports.CustomRule = require('./customRule'); -exports.CustomRules = require('./customRules'); +exports.CustomRuleList = require('./customRuleList'); +exports.ManagedRuleOverride = require('./managedRuleOverride'); +exports.ManagedRuleGroupOverride = require('./managedRuleGroupOverride'); exports.ManagedRuleSet = require('./managedRuleSet'); -exports.ManagedRuleSets = require('./managedRuleSets'); +exports.ManagedRuleSetList = require('./managedRuleSetList'); +exports.FrontendEndpointLink = require('./frontendEndpointLink'); exports.WebApplicationFirewallPolicy1 = require('./webApplicationFirewallPolicy1'); -exports.AzureManagedOverrideRuleGroup = require('./azureManagedOverrideRuleGroup'); -exports.AzureManagedRuleSet = require('./azureManagedRuleSet'); +exports.ManagedRuleDefinition = require('./managedRuleDefinition'); +exports.ManagedRuleGroupDefinition = require('./managedRuleGroupDefinition'); +exports.ManagedRuleSetDefinition = require('./managedRuleSetDefinition'); exports.FrontDoorListResult = require('./frontDoorListResult'); exports.RoutingRuleListResult = require('./routingRuleListResult'); exports.HealthProbeSettingsListResult = require('./healthProbeSettingsListResult'); exports.LoadBalancingSettingsListResult = require('./loadBalancingSettingsListResult'); exports.BackendPoolListResult = require('./backendPoolListResult'); exports.FrontendEndpointsListResult = require('./frontendEndpointsListResult'); -exports.WebApplicationFirewallPolicyListResult = require('./webApplicationFirewallPolicyListResult'); -exports.discriminators = { - 'Unknown' : exports.ManagedRuleSet, - 'ManagedRuleSet.AzureManagedRuleSet' : exports.AzureManagedRuleSet -}; +exports.WebApplicationFirewallPolicyList = require('./webApplicationFirewallPolicyList'); +exports.ManagedRuleSetDefinitionList = require('./managedRuleSetDefinitionList'); diff --git a/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js b/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js index b7cef60222..c0eaca4274 100644 --- a/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js +++ b/lib/services/frontdoorManagement/lib/models/keyVaultCertificateSourceParametersVault.js @@ -17,7 +17,7 @@ class KeyVaultCertificateSourceParametersVault { /** * Create a KeyVaultCertificateSourceParametersVault. - * @member {string} [id] Resource ID. + * @property {string} [id] Resource ID. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js index e184b7ccde..cd8f567c79 100644 --- a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsListResult.js @@ -12,13 +12,13 @@ /** * Result of the request to list load balancing settings. It contains a list of - * load balancing settings objects and a URL link to get the the next set of + * load balancing settings objects and a URL link to get the next set of * results. */ class LoadBalancingSettingsListResult extends Array { /** * Create a LoadBalancingSettingsListResult. - * @member {string} [nextLink] URL to get the next set of + * @property {string} [nextLink] URL to get the next set of * LoadBalancingSettings objects if there are any. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js index e1388e021e..ed829f110f 100644 --- a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsModel.js @@ -20,16 +20,17 @@ const models = require('./index'); class LoadBalancingSettingsModel extends models['SubResource'] { /** * Create a LoadBalancingSettingsModel. - * @member {number} [sampleSize] The number of samples to consider for load + * @property {number} [sampleSize] The number of samples to consider for load * balancing decisions - * @member {number} [successfulSamplesRequired] The number of samples within - * the sample period that must succeed - * @member {number} [additionalLatencyMilliseconds] The additional latency in - * milliseconds for probes to fall into the lowest latency bucket - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {number} [successfulSamplesRequired] The number of samples + * within the sample period that must succeed + * @property {number} [additionalLatencyMilliseconds] The additional latency + * in milliseconds for probes to fall into the lowest latency bucket + * @property {string} [resourceState] Resource status. Possible values + * include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js index 1abb521224..c171819fe3 100644 --- a/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/loadBalancingSettingsUpdateParameters.js @@ -17,12 +17,12 @@ class LoadBalancingSettingsUpdateParameters { /** * Create a LoadBalancingSettingsUpdateParameters. - * @member {number} [sampleSize] The number of samples to consider for load + * @property {number} [sampleSize] The number of samples to consider for load * balancing decisions - * @member {number} [successfulSamplesRequired] The number of samples within - * the sample period that must succeed - * @member {number} [additionalLatencyMilliseconds] The additional latency in - * milliseconds for probes to fall into the lowest latency bucket + * @property {number} [successfulSamplesRequired] The number of samples + * within the sample period that must succeed + * @property {number} [additionalLatencyMilliseconds] The additional latency + * in milliseconds for probes to fall into the lowest latency bucket */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleDefinition.js b/lib/services/frontdoorManagement/lib/models/managedRuleDefinition.js new file mode 100644 index 0000000000..0a8e670e53 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleDefinition.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a managed rule definition. + * + */ +class ManagedRuleDefinition { + /** + * Create a ManagedRuleDefinition. + * @property {string} [ruleId] Identifier for the managed rule. + * @property {string} [description] Describes the functionality of the + * managed rule. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleDefinition + * + * @returns {object} metadata of ManagedRuleDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleDefinition', + type: { + name: 'Composite', + className: 'ManagedRuleDefinition', + modelProperties: { + ruleId: { + required: false, + readOnly: true, + serializedName: 'ruleId', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedRuleDefinition; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleGroupDefinition.js b/lib/services/frontdoorManagement/lib/models/managedRuleGroupDefinition.js new file mode 100644 index 0000000000..6e1dd302b8 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleGroupDefinition.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a managed rule group. + * + */ +class ManagedRuleGroupDefinition { + /** + * Create a ManagedRuleGroupDefinition. + * @property {string} [ruleGroupName] Name of the managed rule group. + * @property {string} [description] Description of the managed rule group. + * @property {array} [rules] List of rules within the managed rule group. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleGroupDefinition + * + * @returns {object} metadata of ManagedRuleGroupDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleGroupDefinition', + type: { + name: 'Composite', + className: 'ManagedRuleGroupDefinition', + modelProperties: { + ruleGroupName: { + required: false, + readOnly: true, + serializedName: 'ruleGroupName', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + rules: { + required: false, + readOnly: true, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleDefinitionElementType', + type: { + name: 'Composite', + className: 'ManagedRuleDefinition' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedRuleGroupDefinition; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleGroupOverride.js b/lib/services/frontdoorManagement/lib/models/managedRuleGroupOverride.js new file mode 100644 index 0000000000..3d9e5e12d0 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleGroupOverride.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines a managed rule group override setting. + * + */ +class ManagedRuleGroupOverride { + /** + * Create a ManagedRuleGroupOverride. + * @property {string} ruleGroupName Describes the managed rule group to + * override. + * @property {array} [rules] List of rules that will be disabled. If none + * specified, all rules in the group will be disabled. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleGroupOverride + * + * @returns {object} metadata of ManagedRuleGroupOverride + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleGroupOverride', + type: { + name: 'Composite', + className: 'ManagedRuleGroupOverride', + modelProperties: { + ruleGroupName: { + required: true, + serializedName: 'ruleGroupName', + type: { + name: 'String' + } + }, + rules: { + required: false, + serializedName: 'rules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleOverrideElementType', + type: { + name: 'Composite', + className: 'ManagedRuleOverride' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedRuleGroupOverride; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleOverride.js b/lib/services/frontdoorManagement/lib/models/managedRuleOverride.js new file mode 100644 index 0000000000..c26a501c7d --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleOverride.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines a managed rule group override setting. + * + */ +class ManagedRuleOverride { + /** + * Create a ManagedRuleOverride. + * @property {string} ruleId Identifier for the managed rule. + * @property {string} [enabledState] Describes if the managed rule is in + * enabled or disabled state. Defaults to Disabled if not specified. Possible + * values include: 'Disabled', 'Enabled' + * @property {string} [action] Describes the override action to be applied + * when rule matches. Possible values include: 'Allow', 'Block', 'Log', + * 'Redirect' + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleOverride + * + * @returns {object} metadata of ManagedRuleOverride + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleOverride', + type: { + name: 'Composite', + className: 'ManagedRuleOverride', + modelProperties: { + ruleId: { + required: true, + serializedName: 'ruleId', + type: { + name: 'String' + } + }, + enabledState: { + required: false, + serializedName: 'enabledState', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedRuleOverride; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSet.js b/lib/services/frontdoorManagement/lib/models/managedRuleSet.js index e115d2a68c..8b2daedc25 100644 --- a/lib/services/frontdoorManagement/lib/models/managedRuleSet.js +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSet.js @@ -11,15 +11,17 @@ 'use strict'; /** - * Base class for all types of ManagedRuleSet. + * Defines a managed rule set. * */ class ManagedRuleSet { /** * Create a ManagedRuleSet. - * @member {number} [priority] Describes priority of the rule - * @member {number} [version] defines version of the ruleset - * @member {string} ruleSetType Polymorphic Discriminator + * @property {string} ruleSetType Defines the rule set type to use. + * @property {string} ruleSetVersion Defines the version of the rule set to + * use. + * @property {array} [ruleGroupOverrides] Defines the rule group overrides to + * apply to the rule set. */ constructor() { } @@ -33,36 +35,38 @@ class ManagedRuleSet { mapper() { return { required: false, - serializedName: 'Unknown', + serializedName: 'ManagedRuleSet', type: { name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'ruleSetType', - clientName: 'ruleSetType' - }, - uberParent: 'ManagedRuleSet', className: 'ManagedRuleSet', modelProperties: { - priority: { - required: false, - serializedName: 'priority', + ruleSetType: { + required: true, + serializedName: 'ruleSetType', type: { - name: 'Number' + name: 'String' } }, - version: { - required: false, - serializedName: 'version', + ruleSetVersion: { + required: true, + serializedName: 'ruleSetVersion', type: { - name: 'Number' + name: 'String' } }, - ruleSetType: { - required: true, - serializedName: 'ruleSetType', - isPolymorphicDiscriminator: true, + ruleGroupOverrides: { + required: false, + serializedName: 'ruleGroupOverrides', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleGroupOverrideElementType', + type: { + name: 'Composite', + className: 'ManagedRuleGroupOverride' + } + } } } } diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinition.js b/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinition.js new file mode 100644 index 0000000000..f35bb879d0 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinition.js @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the a managed rule set definition. + * + * @extends models['Resource'] + */ +class ManagedRuleSetDefinition extends models['Resource'] { + /** + * Create a ManagedRuleSetDefinition. + * @property {string} [provisioningState] Provisioning state of the managed + * rule set. + * @property {string} [ruleSetType] Type of the managed rule set. + * @property {string} [ruleSetVersion] Version of the managed rule set type. + * @property {array} [ruleGroups] Rule groups of the managed rule set. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedRuleSetDefinition + * + * @returns {object} metadata of ManagedRuleSetDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleSetDefinition', + type: { + name: 'Composite', + className: 'ManagedRuleSetDefinition', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + ruleSetType: { + required: false, + readOnly: true, + serializedName: 'properties.ruleSetType', + type: { + name: 'String' + } + }, + ruleSetVersion: { + required: false, + readOnly: true, + serializedName: 'properties.ruleSetVersion', + type: { + name: 'String' + } + }, + ruleGroups: { + required: false, + readOnly: true, + serializedName: 'properties.ruleGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleGroupDefinitionElementType', + type: { + name: 'Composite', + className: 'ManagedRuleGroupDefinition' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedRuleSetDefinition; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinitionList.js b/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinitionList.js new file mode 100644 index 0000000000..c70a99cf57 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSetDefinitionList.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * List of managed rule set definitions available for use in a policy. + */ +class ManagedRuleSetDefinitionList extends Array { + /** + * Create a ManagedRuleSetDefinitionList. + * @property {string} [nextLink] URL to retrieve next set of managed rule set + * definitions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedRuleSetDefinitionList + * + * @returns {object} metadata of ManagedRuleSetDefinitionList + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleSetDefinitionList', + type: { + name: 'Composite', + className: 'ManagedRuleSetDefinitionList', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleSetDefinitionElementType', + type: { + name: 'Composite', + className: 'ManagedRuleSetDefinition' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedRuleSetDefinitionList; diff --git a/lib/services/frontdoorManagement/lib/models/managedRuleSetList.js b/lib/services/frontdoorManagement/lib/models/managedRuleSetList.js new file mode 100644 index 0000000000..1fdf3192ce --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/managedRuleSetList.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines the list of managed rule sets for the policy. + * + */ +class ManagedRuleSetList { + /** + * Create a ManagedRuleSetList. + * @property {array} [managedRuleSets] List of rule sets. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedRuleSetList + * + * @returns {object} metadata of ManagedRuleSetList + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedRuleSetList', + type: { + name: 'Composite', + className: 'ManagedRuleSetList', + modelProperties: { + managedRuleSets: { + required: false, + serializedName: 'managedRuleSets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedRuleSetElementType', + type: { + name: 'Composite', + className: 'ManagedRuleSet' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedRuleSetList; diff --git a/lib/services/frontdoorManagement/lib/models/matchCondition.js b/lib/services/frontdoorManagement/lib/models/matchCondition.js new file mode 100644 index 0000000000..7ae69d55ac --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/matchCondition.js @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Define a match condition. + * + */ +class MatchCondition { + /** + * Create a MatchCondition. + * @property {string} matchVariable Match variable to compare against. + * Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', + * 'PostArgs', 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies' + * @property {string} [selector] Selector can used to match against a + * specific key from QueryString, PostArgs, RequestHeader or Cookies. + * @property {string} operator Describes operator to be matched. Possible + * values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', + * 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', + * 'BeginsWith', 'EndsWith', 'RegEx' + * @property {boolean} [negateCondition] Describes if the result of this + * condition should be negated. + * @property {array} matchValue List of possible match values. + * @property {array} [transforms] List of transforms. + */ + constructor() { + } + + /** + * Defines the metadata of MatchCondition + * + * @returns {object} metadata of MatchCondition + * + */ + mapper() { + return { + required: false, + serializedName: 'MatchCondition', + type: { + name: 'Composite', + className: 'MatchCondition', + modelProperties: { + matchVariable: { + required: true, + serializedName: 'matchVariable', + type: { + name: 'String' + } + }, + selector: { + required: false, + serializedName: 'selector', + type: { + name: 'String' + } + }, + operator: { + required: true, + serializedName: 'operator', + type: { + name: 'String' + } + }, + negateCondition: { + required: false, + serializedName: 'negateCondition', + type: { + name: 'Boolean' + } + }, + matchValue: { + required: true, + serializedName: 'matchValue', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + transforms: { + required: false, + serializedName: 'transforms', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TransformTypeElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MatchCondition; diff --git a/lib/services/frontdoorManagement/lib/models/policySettings.js b/lib/services/frontdoorManagement/lib/models/policySettings.js index f75fd99adb..1450915739 100644 --- a/lib/services/frontdoorManagement/lib/models/policySettings.js +++ b/lib/services/frontdoorManagement/lib/models/policySettings.js @@ -11,17 +11,25 @@ 'use strict'; /** - * Defines contents of a web application firewall global configuration + * Defines top-level WebApplicationFirewallPolicy configuration settings. * */ class PolicySettings { /** * Create a PolicySettings. - * @member {string} [enabledState] describes if the policy is in enabled - * state or disabled state. Possible values include: 'Disabled', 'Enabled' - * @member {string} [mode] Describes if it is in detection mode or + * @property {string} [enabledState] Describes if the policy is in enabled or + * disabled state. Defaults to Enabled if not specified. Possible values + * include: 'Disabled', 'Enabled' + * @property {string} [mode] Describes if it is in detection mode or * prevention mode at policy level. Possible values include: 'Prevention', * 'Detection' + * @property {string} [redirectUrl] If action type is redirect, this field + * represents redirect URL for the client. + * @property {number} [customBlockResponseStatusCode] If the action type is + * block, customer can override the response status code. + * @property {string} [customBlockResponseBody] If the action type is block, + * customer can override the response body. The body must be specified in + * base64 encoding. */ constructor() { } @@ -35,7 +43,7 @@ class PolicySettings { mapper() { return { required: false, - serializedName: 'policySettings', + serializedName: 'PolicySettings', type: { name: 'Composite', className: 'PolicySettings', @@ -53,6 +61,30 @@ class PolicySettings { type: { name: 'String' } + }, + redirectUrl: { + required: false, + serializedName: 'redirectUrl', + type: { + name: 'String' + } + }, + customBlockResponseStatusCode: { + required: false, + serializedName: 'customBlockResponseStatusCode', + type: { + name: 'Number' + } + }, + customBlockResponseBody: { + required: false, + serializedName: 'customBlockResponseBody', + constraints: { + Pattern: /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$/ + }, + type: { + name: 'String' + } } } } diff --git a/lib/services/frontdoorManagement/lib/models/purgeParameters.js b/lib/services/frontdoorManagement/lib/models/purgeParameters.js index e3be748479..8d01f8a0ca 100644 --- a/lib/services/frontdoorManagement/lib/models/purgeParameters.js +++ b/lib/services/frontdoorManagement/lib/models/purgeParameters.js @@ -17,7 +17,7 @@ class PurgeParameters { /** * Create a PurgeParameters. - * @member {array} contentPaths The path to the content to be purged. Can + * @property {array} contentPaths The path to the content to be purged. Can * describe a file path or a wild card directory. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/resource.js b/lib/services/frontdoorManagement/lib/models/resource.js index 4b70929508..740d1b9d45 100644 --- a/lib/services/frontdoorManagement/lib/models/resource.js +++ b/lib/services/frontdoorManagement/lib/models/resource.js @@ -20,11 +20,11 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource ID. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} [location] Resource location. - * @member {object} [tags] Resource tags. + * @property {string} [id] Resource ID. + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. + * @property {string} [location] Resource location. + * @property {object} [tags] Resource tags. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/routingRule.js b/lib/services/frontdoorManagement/lib/models/routingRule.js index 4bbb21cafb..5b137c7c8f 100644 --- a/lib/services/frontdoorManagement/lib/models/routingRule.js +++ b/lib/services/frontdoorManagement/lib/models/routingRule.js @@ -21,34 +21,35 @@ const models = require('./index'); class RoutingRule extends models['SubResource'] { /** * Create a RoutingRule. - * @member {array} [frontendEndpoints] Frontend endpoints associated with + * @property {array} [frontendEndpoints] Frontend endpoints associated with * this rule - * @member {array} [acceptedProtocols] Protocol schemes to match for this + * @property {array} [acceptedProtocols] Protocol schemes to match for this * rule - * @member {array} [patternsToMatch] The route patterns of the rule. - * @member {string} [customForwardingPath] A custom path used to rewrite + * @property {array} [patternsToMatch] The route patterns of the rule. + * @property {string} [customForwardingPath] A custom path used to rewrite * resource paths matched by this rule. Leave empty to use incoming path. - * @member {string} [forwardingProtocol] Protocol this rule will use when + * @property {string} [forwardingProtocol] Protocol this rule will use when * forwarding traffic to backends. Possible values include: 'HttpOnly', * 'HttpsOnly', 'MatchRequest' - * @member {object} [cacheConfiguration] The caching configuration associated - * with this rule. - * @member {string} [cacheConfiguration.queryParameterStripDirective] + * @property {object} [cacheConfiguration] The caching configuration + * associated with this rule. + * @property {string} [cacheConfiguration.queryParameterStripDirective] * Treatment of URL query terms when forming the cache key. Possible values * include: 'StripNone', 'StripAll' - * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * @property {string} [cacheConfiguration.dynamicCompression] Whether to use * dynamic compression for cached content. Possible values include: * 'Enabled', 'Disabled' - * @member {object} [backendPool] A reference to the BackendPool which this + * @property {object} [backendPool] A reference to the BackendPool which this * rule routes to. - * @member {string} [backendPool.id] Resource ID. - * @member {string} [enabledState] Whether to enable use of this rule. + * @property {string} [backendPool.id] Resource ID. + * @property {string} [enabledState] Whether to enable use of this rule. * Permitted values are 'Enabled' or 'Disabled'. Possible values include: * 'Enabled', 'Disabled' - * @member {string} [resourceState] Resource status. Possible values include: - * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting' - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {string} [resourceState] Resource status. Possible values + * include: 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', + * 'Deleting' + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js b/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js index 004f60a9f5..793fadc39d 100644 --- a/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js +++ b/lib/services/frontdoorManagement/lib/models/routingRuleListResult.js @@ -12,13 +12,13 @@ /** * Result of the request to list Routing Rules. It contains a list of Routing - * Rule objects and a URL link to get the the next set of results. + * Rule objects and a URL link to get the next set of results. */ class RoutingRuleListResult extends Array { /** * Create a RoutingRuleListResult. - * @member {string} [nextLink] URL to get the next set of RoutingRule objects - * if there are any. + * @property {string} [nextLink] URL to get the next set of RoutingRule + * objects if there are any. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js b/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js index 7f02de2afd..39cb6672eb 100644 --- a/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js +++ b/lib/services/frontdoorManagement/lib/models/routingRuleUpdateParameters.js @@ -17,28 +17,28 @@ class RoutingRuleUpdateParameters { /** * Create a RoutingRuleUpdateParameters. - * @member {array} [frontendEndpoints] Frontend endpoints associated with + * @property {array} [frontendEndpoints] Frontend endpoints associated with * this rule - * @member {array} [acceptedProtocols] Protocol schemes to match for this + * @property {array} [acceptedProtocols] Protocol schemes to match for this * rule - * @member {array} [patternsToMatch] The route patterns of the rule. - * @member {string} [customForwardingPath] A custom path used to rewrite + * @property {array} [patternsToMatch] The route patterns of the rule. + * @property {string} [customForwardingPath] A custom path used to rewrite * resource paths matched by this rule. Leave empty to use incoming path. - * @member {string} [forwardingProtocol] Protocol this rule will use when + * @property {string} [forwardingProtocol] Protocol this rule will use when * forwarding traffic to backends. Possible values include: 'HttpOnly', * 'HttpsOnly', 'MatchRequest' - * @member {object} [cacheConfiguration] The caching configuration associated - * with this rule. - * @member {string} [cacheConfiguration.queryParameterStripDirective] + * @property {object} [cacheConfiguration] The caching configuration + * associated with this rule. + * @property {string} [cacheConfiguration.queryParameterStripDirective] * Treatment of URL query terms when forming the cache key. Possible values * include: 'StripNone', 'StripAll' - * @member {string} [cacheConfiguration.dynamicCompression] Whether to use + * @property {string} [cacheConfiguration.dynamicCompression] Whether to use * dynamic compression for cached content. Possible values include: * 'Enabled', 'Disabled' - * @member {object} [backendPool] A reference to the BackendPool which this + * @property {object} [backendPool] A reference to the BackendPool which this * rule routes to. - * @member {string} [backendPool.id] Resource ID. - * @member {string} [enabledState] Whether to enable use of this rule. + * @property {string} [backendPool.id] Resource ID. + * @property {string} [enabledState] Whether to enable use of this rule. * Permitted values are 'Enabled' or 'Disabled'. Possible values include: * 'Enabled', 'Disabled' */ diff --git a/lib/services/frontdoorManagement/lib/models/subResource.js b/lib/services/frontdoorManagement/lib/models/subResource.js index 51215f1707..f59dea3bbf 100644 --- a/lib/services/frontdoorManagement/lib/models/subResource.js +++ b/lib/services/frontdoorManagement/lib/models/subResource.js @@ -20,7 +20,7 @@ const models = require('./index'); class SubResource extends models['BaseResource'] { /** * Create a SubResource. - * @member {string} [id] Resource ID. + * @property {string} [id] Resource ID. */ constructor() { super(); diff --git a/lib/services/frontdoorManagement/lib/models/tagsObject.js b/lib/services/frontdoorManagement/lib/models/tagsObject.js index 755b116391..a22fc07dfd 100644 --- a/lib/services/frontdoorManagement/lib/models/tagsObject.js +++ b/lib/services/frontdoorManagement/lib/models/tagsObject.js @@ -17,7 +17,7 @@ class TagsObject { /** * Create a TagsObject. - * @member {object} [tags] Resource tags. + * @property {object} [tags] Resource tags. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js b/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js index 71bf5ec871..eba1b99c5d 100644 --- a/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js +++ b/lib/services/frontdoorManagement/lib/models/validateCustomDomainInput.js @@ -17,7 +17,7 @@ class ValidateCustomDomainInput { /** * Create a ValidateCustomDomainInput. - * @member {string} hostName The host name of the custom domain. Must be a + * @property {string} hostName The host name of the custom domain. Must be a * domain name. */ constructor() { diff --git a/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js b/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js index cf285a32b7..52edf6e2a6 100644 --- a/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js +++ b/lib/services/frontdoorManagement/lib/models/validateCustomDomainOutput.js @@ -17,11 +17,11 @@ class ValidateCustomDomainOutput { /** * Create a ValidateCustomDomainOutput. - * @member {boolean} [customDomainValidated] Indicates whether the custom + * @property {boolean} [customDomainValidated] Indicates whether the custom * domain is valid or not. - * @member {string} [reason] The reason why the custom domain is not valid. - * @member {string} [message] Error message describing why the custom domain - * is not valid. + * @property {string} [reason] The reason why the custom domain is not valid. + * @property {string} [message] Error message describing why the custom + * domain is not valid. */ constructor() { } diff --git a/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js index f9385e9118..8798c1315f 100644 --- a/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js +++ b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicy1.js @@ -20,23 +20,32 @@ const models = require('./index'); class WebApplicationFirewallPolicy1 extends models['Resource'] { /** * Create a WebApplicationFirewallPolicy1. - * @member {object} [policySettings] Describes policySettings for policy - * @member {string} [policySettings.enabledState] describes if the policy is - * in enabled state or disabled state. Possible values include: 'Disabled', - * 'Enabled' - * @member {string} [policySettings.mode] Describes if it is in detection - * mode or prevention mode at policy level. Possible values include: + * @property {object} [policySettings] Describes settings for the policy. + * @property {string} [policySettings.enabledState] Describes if the policy + * is in enabled or disabled state. Defaults to Enabled if not specified. + * Possible values include: 'Disabled', 'Enabled' + * @property {string} [policySettings.mode] Describes if it is in detection + * mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' - * @member {object} [customRules] Describes custom rules inside the policy - * @member {array} [customRules.rules] List of rules - * @member {object} [managedRules] Describes managed rules inside the policy - * @member {array} [managedRules.ruleSets] List of rules - * @member {string} [provisioningState] Provisioning state of the - * WebApplicationFirewallPolicy. - * @member {string} [resourceState] Resource status of the policy. Possible + * @property {string} [policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * @property {number} [policySettings.customBlockResponseStatusCode] If the + * action type is block, customer can override the response status code. + * @property {string} [policySettings.customBlockResponseBody] If the action + * type is block, customer can override the response body. The body must be + * specified in base64 encoding. + * @property {object} [customRules] Describes custom rules inside the policy. + * @property {array} [customRules.rules] List of rules + * @property {object} [managedRules] Describes managed rules inside the + * policy. + * @property {array} [managedRules.managedRuleSets] List of rule sets. + * @property {array} [frontendEndpointLinks] Describes Frontend Endpoints + * associated with this Web Application Firewall policy. + * @property {string} [provisioningState] Provisioning state of the policy. + * @property {string} [resourceState] Resource status of the policy. Possible * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling', * 'Disabled', 'Deleting' - * @member {string} [etag] Gets a unique read-only string that changes + * @property {string} [etag] Gets a unique read-only string that changes * whenever the resource is updated. */ constructor() { @@ -115,7 +124,7 @@ class WebApplicationFirewallPolicy1 extends models['Resource'] { serializedName: 'properties.customRules', type: { name: 'Composite', - className: 'CustomRules' + className: 'CustomRuleList' } }, managedRules: { @@ -123,7 +132,23 @@ class WebApplicationFirewallPolicy1 extends models['Resource'] { serializedName: 'properties.managedRules', type: { name: 'Composite', - className: 'ManagedRuleSets' + className: 'ManagedRuleSetList' + } + }, + frontendEndpointLinks: { + required: false, + readOnly: true, + serializedName: 'properties.frontendEndpointLinks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FrontendEndpointLinkElementType', + type: { + name: 'Composite', + className: 'FrontendEndpointLink' + } + } } }, provisioningState: { diff --git a/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyList.js b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyList.js new file mode 100644 index 0000000000..58b25ed0c3 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/models/webApplicationFirewallPolicyList.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines a list of WebApplicationFirewallPolicies. It contains a list of + * WebApplicationFirewallPolicy objects and a URL link to get the the next set + * of results. + */ +class WebApplicationFirewallPolicyList extends Array { + /** + * Create a WebApplicationFirewallPolicyList. + * @property {string} [nextLink] URL to get the next set of + * WebApplicationFirewallPolicy objects if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebApplicationFirewallPolicyList + * + * @returns {object} metadata of WebApplicationFirewallPolicyList + * + */ + mapper() { + return { + required: false, + serializedName: 'WebApplicationFirewallPolicyList', + type: { + name: 'Composite', + className: 'WebApplicationFirewallPolicyList', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WebApplicationFirewallPolicy1ElementType', + type: { + name: 'Composite', + className: 'WebApplicationFirewallPolicy1' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebApplicationFirewallPolicyList; diff --git a/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js b/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js index 07437ac96f..e445e2fec1 100644 --- a/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js +++ b/lib/services/frontdoorManagement/lib/operations/frontendEndpoints.js @@ -296,7 +296,7 @@ function _get(resourceGroupName, frontDoorName, frontendEndpointName, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); @@ -869,7 +869,7 @@ function _beginCreateOrUpdate(resourceGroupName, frontDoorName, frontendEndpoint // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); @@ -1111,7 +1111,7 @@ function _beginDeleteMethod(resourceGroupName, frontDoorName, frontendEndpointNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); @@ -1317,7 +1317,7 @@ function _beginEnableHttps(resourceGroupName, frontDoorName, frontendEndpointNam // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); @@ -1508,7 +1508,7 @@ function _beginDisableHttps(resourceGroupName, frontDoorName, frontendEndpointNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provider/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{frontDoorName}', encodeURIComponent(frontDoorName)); diff --git a/lib/services/frontdoorManagement/lib/operations/index.d.ts b/lib/services/frontdoorManagement/lib/operations/index.d.ts index 4ae89abdd6..7f8e191712 100644 --- a/lib/services/frontdoorManagement/lib/operations/index.d.ts +++ b/lib/services/frontdoorManagement/lib/operations/index.d.ts @@ -4301,7 +4301,8 @@ export interface Policies { /** * Lists all of the protection policies within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4310,16 +4311,17 @@ export interface Policies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists all of the protection policies within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4333,7 +4335,7 @@ export interface Policies { * * {Promise} A promise is returned. * - * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * @resolve {WebApplicationFirewallPolicyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4341,25 +4343,26 @@ export interface Policies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {WebApplicationFirewallPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * {WebApplicationFirewallPolicyList} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve protection policy with specified name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4372,14 +4375,15 @@ export interface Policies { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve protection policy with specified name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4409,41 +4413,51 @@ export interface Policies { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(policyName: string, resourceGroupName: string, callback: ServiceCallback): void; + get(policyName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or update policy with specified ruleset name within a resource - * group. + * Create or update policy with specified ruleset name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} parameters Policy to be created. * - * @param {object} [parameters.policySettings] Describes policySettings for - * policy + * @param {object} [parameters.policySettings] Describes settings for the + * policy. * - * @param {string} [parameters.policySettings.enabledState] describes if the - * policy is in enabled state or disabled state. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' * * @param {string} [parameters.policySettings.mode] Describes if it is in - * detection mode or prevention mode at policy level. Possible values include: + * detection mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * * @param {object} [parameters.customRules] Describes custom rules inside the - * policy + * policy. * * @param {array} [parameters.customRules.rules] List of rules * * @param {object} [parameters.managedRules] Describes managed rules inside the - * policy + * policy. * - * @param {array} [parameters.managedRules.ruleSets] List of rules + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. * * @param {string} [parameters.etag] Gets a unique read-only string that * changes whenever the resource is updated. @@ -4463,38 +4477,48 @@ export interface Policies { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or update policy with specified ruleset name within a resource - * group. + * Create or update policy with specified ruleset name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} parameters Policy to be created. * - * @param {object} [parameters.policySettings] Describes policySettings for - * policy + * @param {object} [parameters.policySettings] Describes settings for the + * policy. * - * @param {string} [parameters.policySettings.enabledState] describes if the - * policy is in enabled state or disabled state. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' * * @param {string} [parameters.policySettings.mode] Describes if it is in - * detection mode or prevention mode at policy level. Possible values include: + * detection mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * * @param {object} [parameters.customRules] Describes custom rules inside the - * policy + * policy. * * @param {array} [parameters.customRules.rules] List of rules * * @param {object} [parameters.managedRules] Describes managed rules inside the - * policy + * policy. * - * @param {array} [parameters.managedRules.ruleSets] List of rules + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. * * @param {string} [parameters.etag] Gets a unique read-only string that * changes whenever the resource is updated. @@ -4531,17 +4555,18 @@ export interface Policies { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, policyName: string, parameters: models.WebApplicationFirewallPolicy1, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, callback: ServiceCallback): void; + createOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4554,14 +4579,15 @@ export interface Policies { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4589,17 +4615,160 @@ export interface Policies { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(policyName: string, resourceGroupName: string, callback: ServiceCallback): void; + deleteMethod(policyName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update policy with specified ruleset name within a resource group. + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes settings for the + * policy. + * + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy. + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy. + * + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update policy with specified ruleset name within a resource group. + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes settings for the + * policy. + * + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy. + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy. + * + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebApplicationFirewallPolicy1} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, callback: ServiceCallback): void; + beginCreateOrUpdate(policyName: string, resourceGroupName: string, parameters: models.WebApplicationFirewallPolicy1, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4612,14 +4781,15 @@ export interface Policies { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -4647,9 +4817,9 @@ export interface Policies { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, policyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, policyName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, policyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(policyName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(policyName: string, resourceGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(policyName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4665,11 +4835,11 @@ export interface Policies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists all of the protection policies within a resource group. @@ -4689,7 +4859,7 @@ export interface Policies { * * {Promise} A promise is returned. * - * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * @resolve {WebApplicationFirewallPolicyList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4697,15 +4867,134 @@ export interface Policies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {WebApplicationFirewallPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * {WebApplicationFirewallPolicyList} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicyList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ManagedRuleSets + * __NOTE__: An instance of this class is automatically created for an + * instance of the FrontDoorManagementClient. + */ +export interface ManagedRuleSets { + + + /** + * Lists all available managed rule sets. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available managed rule sets. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ManagedRuleSetDefinitionList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ManagedRuleSetDefinitionList} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all available managed rule sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all available managed rule sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ManagedRuleSetDefinitionList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ManagedRuleSetDefinitionList} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/frontdoorManagement/lib/operations/index.js b/lib/services/frontdoorManagement/lib/operations/index.js index 598f43eee3..0b42f6b4a1 100644 --- a/lib/services/frontdoorManagement/lib/operations/index.js +++ b/lib/services/frontdoorManagement/lib/operations/index.js @@ -22,3 +22,4 @@ exports.BackendPools = require('./backendPools'); exports.FrontendEndpoints = require('./frontendEndpoints'); exports.Endpoints = require('./endpoints'); exports.Policies = require('./policies'); +exports.ManagedRuleSets = require('./managedRuleSets'); diff --git a/lib/services/frontdoorManagement/lib/operations/managedRuleSets.js b/lib/services/frontdoorManagement/lib/operations/managedRuleSets.js new file mode 100644 index 0000000000..4b780fed68 --- /dev/null +++ b/lib/services/frontdoorManagement/lib/operations/managedRuleSets.js @@ -0,0 +1,457 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all available managed rule sets. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2019-03-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallManagedRuleSets'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedRuleSetDefinitionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all available managed rule sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedRuleSetDefinitionList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ManagedRuleSets. */ +class ManagedRuleSets { + /** + * Create a ManagedRuleSets. + * @param {FrontDoorManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all available managed rule sets. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available managed rule sets. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedRuleSetDefinitionList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Lists all available managed rule sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all available managed rule sets. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedRuleSetDefinitionList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedRuleSetDefinitionList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ManagedRuleSets; diff --git a/lib/services/frontdoorManagement/lib/operations/policies.js b/lib/services/frontdoorManagement/lib/operations/policies.js index 9f6c54f933..b4cec91c40 100644 --- a/lib/services/frontdoorManagement/lib/operations/policies.js +++ b/lib/services/frontdoorManagement/lib/operations/policies.js @@ -17,7 +17,8 @@ const WebResource = msRest.WebResource; /** * Lists all of the protection policies within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -31,8 +32,8 @@ const WebResource = msRest.WebResource; * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * See {@link WebApplicationFirewallPolicyList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -48,12 +49,26 @@ function _list(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01'; + let apiVersion = '2019-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -138,7 +153,7 @@ function _list(resourceGroupName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebApplicationFirewallPolicyListResult']().mapper(); + let resultMapper = new client.models['WebApplicationFirewallPolicyList']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -156,9 +171,10 @@ function _list(resourceGroupName, options, callback) { /** * Retrieve protection policy with specified name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -179,7 +195,7 @@ function _list(resourceGroupName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, policyName, options, callback) { +function _get(policyName, resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -189,12 +205,9 @@ function _get(resourceGroupName, policyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01'; + let apiVersion = '2019-03-01'; // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { throw new Error('policyName cannot be null or undefined and it must be of type string.'); } @@ -204,6 +217,23 @@ function _get(resourceGroupName, policyName, options, callback) { throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); } } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -217,8 +247,8 @@ function _get(resourceGroupName, policyName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -304,36 +334,47 @@ function _get(resourceGroupName, policyName, options, callback) { }); } + /** - * Creates or update policy with specified ruleset name within a resource - * group. + * Create or update policy with specified ruleset name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} parameters Policy to be created. * - * @param {object} [parameters.policySettings] Describes policySettings for - * policy + * @param {object} [parameters.policySettings] Describes settings for the + * policy. * - * @param {string} [parameters.policySettings.enabledState] describes if the - * policy is in enabled state or disabled state. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' * * @param {string} [parameters.policySettings.mode] Describes if it is in - * detection mode or prevention mode at policy level. Possible values include: + * detection mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * * @param {object} [parameters.customRules] Describes custom rules inside the - * policy + * policy. * * @param {array} [parameters.customRules.rules] List of rules * * @param {object} [parameters.managedRules] Describes managed rules inside the - * policy + * policy. * - * @param {array} [parameters.managedRules.ruleSets] List of rules + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. * * @param {string} [parameters.etag] Gets a unique read-only string that * changes whenever the resource is updated. @@ -361,22 +402,202 @@ function _get(resourceGroupName, policyName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, policyName, parameters, options, callback) { +function _createOrUpdate(policyName, resourceGroupName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01'; + + // Send request + this.beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicy1']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes Policy + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(policyName, resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(policyName, resourceGroupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Create or update policy with specified ruleset name within a resource group. + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes settings for the + * policy. + * + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy. + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy. + * + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2019-03-01'; // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { throw new Error('policyName cannot be null or undefined and it must be of type string.'); } @@ -386,6 +607,23 @@ function _createOrUpdate(resourceGroupName, policyName, parameters, options, cal throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); } } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -402,8 +640,8 @@ function _createOrUpdate(resourceGroupName, policyName, parameters, options, cal // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -452,7 +690,7 @@ function _createOrUpdate(resourceGroupName, policyName, parameters, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -515,80 +753,35 @@ function _createOrUpdate(resourceGroupName, policyName, parameters, options, cal return callback(deserializationError1); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebApplicationFirewallPolicy1']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } return callback(null, result, httpRequest, response); }); } - -/** - * Deletes Policy - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} policyName The name of the resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteMethod(resourceGroupName, policyName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, policyName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -607,7 +800,7 @@ function _deleteMethod(resourceGroupName, policyName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginDeleteMethod(resourceGroupName, policyName, options, callback) { +function _beginDeleteMethod(policyName, resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -617,12 +810,9 @@ function _beginDeleteMethod(resourceGroupName, policyName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01'; + let apiVersion = '2019-03-01'; // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } if (policyName === null || policyName === undefined || typeof policyName.valueOf() !== 'string') { throw new Error('policyName cannot be null or undefined and it must be of type string.'); } @@ -632,6 +822,23 @@ function _beginDeleteMethod(resourceGroupName, policyName, options, callback) { throw new Error('"policyName" should satisfy the constraint - "MaxLength": 128'); } } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 80) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 80'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9_\-\(\)\.]*[^\.]$/'); + } + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -645,8 +852,8 @@ function _beginDeleteMethod(resourceGroupName, policyName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -732,8 +939,8 @@ function _beginDeleteMethod(resourceGroupName, policyName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * See {@link WebApplicationFirewallPolicyList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -828,7 +1035,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebApplicationFirewallPolicyListResult']().mapper(); + let resultMapper = new client.models['WebApplicationFirewallPolicyList']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -855,6 +1062,7 @@ class Policies { this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; this._listNext = _listNext; } @@ -862,7 +1070,8 @@ class Policies { /** * Lists all of the protection policies within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -871,7 +1080,7 @@ class Policies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -892,7 +1101,8 @@ class Policies { /** * Lists all of the protection policies within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -906,7 +1116,7 @@ class Policies { * * {Promise} A promise is returned * - * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * @resolve {WebApplicationFirewallPolicyList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -915,8 +1125,8 @@ class Policies { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * See {@link WebApplicationFirewallPolicyList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -945,9 +1155,10 @@ class Policies { /** * Retrieve protection policy with specified name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -960,11 +1171,11 @@ class Policies { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, policyName, options) { + getWithHttpOperationResponse(policyName, resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, policyName, options, (err, result, request, response) => { + self._get(policyName, resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -977,9 +1188,10 @@ class Policies { /** * Retrieve protection policy with specified name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -1009,7 +1221,7 @@ class Policies { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, policyName, options, optionalCallback) { + get(policyName, resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1018,47 +1230,57 @@ class Policies { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, policyName, options, (err, result, request, response) => { + self._get(policyName, resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, policyName, options, optionalCallback); + return self._get(policyName, resourceGroupName, options, optionalCallback); } } /** - * Creates or update policy with specified ruleset name within a resource - * group. + * Create or update policy with specified ruleset name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} parameters Policy to be created. * - * @param {object} [parameters.policySettings] Describes policySettings for - * policy + * @param {object} [parameters.policySettings] Describes settings for the + * policy. * - * @param {string} [parameters.policySettings.enabledState] describes if the - * policy is in enabled state or disabled state. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' * * @param {string} [parameters.policySettings.mode] Describes if it is in - * detection mode or prevention mode at policy level. Possible values include: + * detection mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * * @param {object} [parameters.customRules] Describes custom rules inside the - * policy + * policy. * * @param {array} [parameters.customRules.rules] List of rules * * @param {object} [parameters.managedRules] Describes managed rules inside the - * policy + * policy. * - * @param {array} [parameters.managedRules.ruleSets] List of rules + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. * * @param {string} [parameters.etag] Gets a unique read-only string that * changes whenever the resource is updated. @@ -1078,11 +1300,11 @@ class Policies { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, policyName, parameters, options) { + createOrUpdateWithHttpOperationResponse(policyName, resourceGroupName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, policyName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(policyName, resourceGroupName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1093,35 +1315,45 @@ class Policies { } /** - * Creates or update policy with specified ruleset name within a resource - * group. + * Create or update policy with specified ruleset name within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} parameters Policy to be created. * - * @param {object} [parameters.policySettings] Describes policySettings for - * policy + * @param {object} [parameters.policySettings] Describes settings for the + * policy. * - * @param {string} [parameters.policySettings.enabledState] describes if the - * policy is in enabled state or disabled state. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' * * @param {string} [parameters.policySettings.mode] Describes if it is in - * detection mode or prevention mode at policy level. Possible values include: + * detection mode or prevention mode at policy level. Possible values include: * 'Prevention', 'Detection' * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * * @param {object} [parameters.customRules] Describes custom rules inside the - * policy + * policy. * * @param {array} [parameters.customRules.rules] List of rules * * @param {object} [parameters.managedRules] Describes managed rules inside the - * policy + * policy. * - * @param {array} [parameters.managedRules.ruleSets] List of rules + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. * * @param {string} [parameters.etag] Gets a unique read-only string that * changes whenever the resource is updated. @@ -1158,7 +1390,7 @@ class Policies { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, policyName, parameters, options, optionalCallback) { + createOrUpdate(policyName, resourceGroupName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1167,23 +1399,24 @@ class Policies { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, policyName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(policyName, resourceGroupName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, policyName, parameters, options, optionalCallback); + return self._createOrUpdate(policyName, resourceGroupName, parameters, options, optionalCallback); } } /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -1196,11 +1429,11 @@ class Policies { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, policyName, options) { + deleteMethodWithHttpOperationResponse(policyName, resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + self._deleteMethod(policyName, resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1213,9 +1446,10 @@ class Policies { /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -1243,7 +1477,176 @@ class Policies { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, policyName, options, optionalCallback) { + deleteMethod(policyName, resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(policyName, resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(policyName, resourceGroupName, options, optionalCallback); + } + } + + /** + * Create or update policy with specified ruleset name within a resource group. + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes settings for the + * policy. + * + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy. + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy. + * + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(policyName, resourceGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update policy with specified ruleset name within a resource group. + * + * @param {string} policyName The name of the Web Application Firewall Policy. + * + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. + * + * @param {object} parameters Policy to be created. + * + * @param {object} [parameters.policySettings] Describes settings for the + * policy. + * + * @param {string} [parameters.policySettings.enabledState] Describes if the + * policy is in enabled or disabled state. Defaults to Enabled if not + * specified. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.policySettings.mode] Describes if it is in + * detection mode or prevention mode at policy level. Possible values include: + * 'Prevention', 'Detection' + * + * @param {string} [parameters.policySettings.redirectUrl] If action type is + * redirect, this field represents redirect URL for the client. + * + * @param {number} [parameters.policySettings.customBlockResponseStatusCode] If + * the action type is block, customer can override the response status code. + * + * @param {string} [parameters.policySettings.customBlockResponseBody] If the + * action type is block, customer can override the response body. The body must + * be specified in base64 encoding. + * + * @param {object} [parameters.customRules] Describes custom rules inside the + * policy. + * + * @param {array} [parameters.customRules.rules] List of rules + * + * @param {object} [parameters.managedRules] Describes managed rules inside the + * policy. + * + * @param {array} [parameters.managedRules.managedRuleSets] List of rule sets. + * + * @param {string} [parameters.etag] Gets a unique read-only string that + * changes whenever the resource is updated. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebApplicationFirewallPolicy1} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebApplicationFirewallPolicy1} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1252,23 +1655,24 @@ class Policies { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, policyName, options, optionalCallback); + return self._beginCreateOrUpdate(policyName, resourceGroupName, parameters, options, optionalCallback); } } /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -1281,11 +1685,11 @@ class Policies { * * @reject {Error} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, policyName, options) { + beginDeleteMethodWithHttpOperationResponse(policyName, resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + self._beginDeleteMethod(policyName, resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1298,9 +1702,10 @@ class Policies { /** * Deletes Policy * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} policyName The name of the Web Application Firewall Policy. * - * @param {string} policyName The name of the resource group. + * @param {string} resourceGroupName Name of the Resource group within the + * Azure subscription. * * @param {object} [options] Optional Parameters. * @@ -1328,7 +1733,7 @@ class Policies { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName, policyName, options, optionalCallback) { + beginDeleteMethod(policyName, resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1337,14 +1742,14 @@ class Policies { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, policyName, options, (err, result, request, response) => { + self._beginDeleteMethod(policyName, resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginDeleteMethod(resourceGroupName, policyName, options, optionalCallback); + return self._beginDeleteMethod(policyName, resourceGroupName, options, optionalCallback); } } @@ -1361,7 +1766,7 @@ class Policies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1397,7 +1802,7 @@ class Policies { * * {Promise} A promise is returned * - * @resolve {WebApplicationFirewallPolicyListResult} - The deserialized result object. + * @resolve {WebApplicationFirewallPolicyList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1406,8 +1811,8 @@ class Policies { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebApplicationFirewallPolicyListResult} for - * more information. + * See {@link WebApplicationFirewallPolicyList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/frontdoorManagement/package.json b/lib/services/frontdoorManagement/package.json index ed915d4c03..604287fa5a 100644 --- a/lib/services/frontdoorManagement/package.json +++ b/lib/services/frontdoorManagement/package.json @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}