/*
 * 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 rule for http route matching.
 *
 */
class HttpRouteMatchRule {
  /**
   * Create a HttpRouteMatchRule.
   * @member {object} path Path to match for routing.
   * @member {string} [path.value] Uri path to match for request.
   * @member {string} [path.rewrite] replacement string for matched part of the
   * Uri.
   * @member {array} [headers] headers and their values to match in request.
   */
  constructor() {
  }

  /**
   * Defines the metadata of HttpRouteMatchRule
   *
   * @returns {object} metadata of HttpRouteMatchRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'HttpRouteMatchRule',
      type: {
        name: 'Composite',
        className: 'HttpRouteMatchRule',
        modelProperties: {
          path: {
            required: true,
            serializedName: 'path',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'HttpRouteMatchPath'
            }
          },
          headers: {
            required: false,
            serializedName: 'headers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'HttpRouteMatchHeaderElementType',
                  type: {
                    name: 'Composite',
                    className: 'HttpRouteMatchHeader'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = HttpRouteMatchRule;
