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

/**
 * Redirect configuration of an application gateway.
 *
 * @extends models['SubResource']
 */
class ApplicationGatewayRedirectConfiguration extends models['SubResource'] {
  /**
   * Create a ApplicationGatewayRedirectConfiguration.
   * @property {string} [redirectType] HTTP redirection type. Possible values
   * include: 'Permanent', 'Found', 'SeeOther', 'Temporary'
   * @property {object} [targetListener] Reference to a listener to redirect
   * the request to.
   * @property {string} [targetListener.id] Resource ID.
   * @property {string} [targetUrl] Url to redirect the request to.
   * @property {boolean} [includePath] Include path in the redirected url.
   * @property {boolean} [includeQueryString] Include query string in the
   * redirected url.
   * @property {array} [requestRoutingRules] Request routing specifying
   * redirect configuration.
   * @property {array} [urlPathMaps] Url path maps specifying default redirect
   * configuration.
   * @property {array} [pathRules] Path rules specifying redirect
   * configuration.
   * @property {string} [name] Name of the redirect configuration 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 ApplicationGatewayRedirectConfiguration
   *
   * @returns {object} metadata of ApplicationGatewayRedirectConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayRedirectConfiguration',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayRedirectConfiguration',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          redirectType: {
            required: false,
            serializedName: 'properties.redirectType',
            type: {
              name: 'String'
            }
          },
          targetListener: {
            required: false,
            serializedName: 'properties.targetListener',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          targetUrl: {
            required: false,
            serializedName: 'properties.targetUrl',
            type: {
              name: 'String'
            }
          },
          includePath: {
            required: false,
            serializedName: 'properties.includePath',
            type: {
              name: 'Boolean'
            }
          },
          includeQueryString: {
            required: false,
            serializedName: 'properties.includeQueryString',
            type: {
              name: 'Boolean'
            }
          },
          requestRoutingRules: {
            required: false,
            serializedName: 'properties.requestRoutingRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubResourceElementType',
                  type: {
                    name: 'Composite',
                    className: 'SubResource'
                  }
              }
            }
          },
          urlPathMaps: {
            required: false,
            serializedName: 'properties.urlPathMaps',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubResourceElementType',
                  type: {
                    name: 'Composite',
                    className: 'SubResource'
                  }
              }
            }
          },
          pathRules: {
            required: false,
            serializedName: 'properties.pathRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubResourceElementType',
                  type: {
                    name: 'Composite',
                    className: 'SubResource'
                  }
              }
            }
          },
          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 = ApplicationGatewayRedirectConfiguration;
