/*
 * 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');

/**
 * Request routing rule of an application gateway.
 *
 * @extends models['SubResource']
 */
class ApplicationGatewayRequestRoutingRule extends models['SubResource'] {
  /**
   * Create a ApplicationGatewayRequestRoutingRule.
   * @property {string} [ruleType] Rule type. Possible values include: 'Basic',
   * 'PathBasedRouting'
   * @property {object} [backendAddressPool] Backend address pool resource of
   * the application gateway.
   * @property {string} [backendAddressPool.id] Resource ID.
   * @property {object} [backendHttpSettings] Backend http settings resource of
   * the application gateway.
   * @property {string} [backendHttpSettings.id] Resource ID.
   * @property {object} [httpListener] Http listener resource of the
   * application gateway.
   * @property {string} [httpListener.id] Resource ID.
   * @property {object} [urlPathMap] URL path map resource of the application
   * gateway.
   * @property {string} [urlPathMap.id] Resource ID.
   * @property {object} [rewriteRuleSet] Rewrite Rule Set resource in Basic
   * rule of the application gateway.
   * @property {string} [rewriteRuleSet.id] Resource ID.
   * @property {object} [redirectConfiguration] Redirect configuration resource
   * of the application gateway.
   * @property {string} [redirectConfiguration.id] Resource ID.
   * @property {string} [provisioningState] Provisioning state of the request
   * routing rule resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {string} [name] Name of the request routing rule that is unique
   * within an Application Gateway.
   * @property {string} [etag] A unique read-only string that changes whenever
   * the resource is updated.
   * @property {string} [type] Type of the resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationGatewayRequestRoutingRule
   *
   * @returns {object} metadata of ApplicationGatewayRequestRoutingRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayRequestRoutingRule',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayRequestRoutingRule',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          ruleType: {
            required: false,
            serializedName: 'properties.ruleType',
            type: {
              name: 'String'
            }
          },
          backendAddressPool: {
            required: false,
            serializedName: 'properties.backendAddressPool',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          backendHttpSettings: {
            required: false,
            serializedName: 'properties.backendHttpSettings',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          httpListener: {
            required: false,
            serializedName: 'properties.httpListener',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          urlPathMap: {
            required: false,
            serializedName: 'properties.urlPathMap',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          rewriteRuleSet: {
            required: false,
            serializedName: 'properties.rewriteRuleSet',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          redirectConfiguration: {
            required: false,
            serializedName: 'properties.redirectConfiguration',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationGatewayRequestRoutingRule;
