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

/**
 * Path rule of URL path map of an application gateway.
 *
 * @extends models['SubResource']
 */
class ApplicationGatewayPathRule extends models['SubResource'] {
  /**
   * Create a ApplicationGatewayPathRule.
   * @property {array} [paths] Path rules of URL path map.
   * @property {object} [backendAddressPool] Backend address pool resource of
   * URL path map path rule.
   * @property {string} [backendAddressPool.id] Resource ID.
   * @property {object} [backendHttpSettings] Backend http settings resource of
   * URL path map path rule.
   * @property {string} [backendHttpSettings.id] Resource ID.
   * @property {object} [redirectConfiguration] Redirect configuration resource
   * of URL path map path rule.
   * @property {string} [redirectConfiguration.id] Resource ID.
   * @property {object} [rewriteRuleSet] Rewrite rule set resource of URL path
   * map path rule.
   * @property {string} [rewriteRuleSet.id] Resource ID.
   * @property {string} [provisioningState] Path rule of URL path map resource.
   * Possible values are: 'Updating', 'Deleting', and 'Failed'.
   * @property {string} [name] Name of the path 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 ApplicationGatewayPathRule
   *
   * @returns {object} metadata of ApplicationGatewayPathRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayPathRule',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayPathRule',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          paths: {
            required: false,
            serializedName: 'properties.paths',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  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'
            }
          },
          redirectConfiguration: {
            required: false,
            serializedName: 'properties.redirectConfiguration',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          rewriteRuleSet: {
            required: false,
            serializedName: 'properties.rewriteRuleSet',
            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 = ApplicationGatewayPathRule;
