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

/**
 * UrlPathMaps give a url path to the backend mapping information for
 * PathBasedRouting.
 *
 * @extends models['SubResource']
 */
class ApplicationGatewayUrlPathMap extends models['SubResource'] {
  /**
   * Create a ApplicationGatewayUrlPathMap.
   * @property {object} [defaultBackendAddressPool] Default backend address
   * pool resource of URL path map.
   * @property {string} [defaultBackendAddressPool.id] Resource ID.
   * @property {object} [defaultBackendHttpSettings] Default backend http
   * settings resource of URL path map.
   * @property {string} [defaultBackendHttpSettings.id] Resource ID.
   * @property {object} [defaultRewriteRuleSet] Default Rewrite rule set
   * resource of URL path map.
   * @property {string} [defaultRewriteRuleSet.id] Resource ID.
   * @property {object} [defaultRedirectConfiguration] Default redirect
   * configuration resource of URL path map.
   * @property {string} [defaultRedirectConfiguration.id] Resource ID.
   * @property {array} [pathRules] Path rule of URL path map resource.
   * @property {string} [provisioningState] Provisioning state of the backend
   * http settings resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {string} [name] Name of the URL path map 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 ApplicationGatewayUrlPathMap
   *
   * @returns {object} metadata of ApplicationGatewayUrlPathMap
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayUrlPathMap',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayUrlPathMap',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          defaultBackendAddressPool: {
            required: false,
            serializedName: 'properties.defaultBackendAddressPool',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          defaultBackendHttpSettings: {
            required: false,
            serializedName: 'properties.defaultBackendHttpSettings',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          defaultRewriteRuleSet: {
            required: false,
            serializedName: 'properties.defaultRewriteRuleSet',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          defaultRedirectConfiguration: {
            required: false,
            serializedName: 'properties.defaultRedirectConfiguration',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          pathRules: {
            required: false,
            serializedName: 'properties.pathRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationGatewayPathRuleElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationGatewayPathRule'
                  }
              }
            }
          },
          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 = ApplicationGatewayUrlPathMap;
