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

/**
 * Define match conditions
 *
 */
class MatchCondition {
  /**
   * Create a MatchCondition.
   * @property {array} matchVariables List of match variables
   * @property {string} operator Describes operator to be matched. Possible
   * values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan',
   * 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'Regex'
   * @property {boolean} [negationConditon] Describes if this is negate
   * condition or not
   * @property {array} matchValues Match value
   * @property {array} [transforms] List of transforms
   */
  constructor() {
  }

  /**
   * Defines the metadata of MatchCondition
   *
   * @returns {object} metadata of MatchCondition
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MatchCondition',
      type: {
        name: 'Composite',
        className: 'MatchCondition',
        modelProperties: {
          matchVariables: {
            required: true,
            serializedName: 'matchVariables',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MatchVariableElementType',
                  type: {
                    name: 'Composite',
                    className: 'MatchVariable'
                  }
              }
            }
          },
          operator: {
            required: true,
            serializedName: 'operator',
            type: {
              name: 'String'
            }
          },
          negationConditon: {
            required: false,
            serializedName: 'negationConditon',
            type: {
              name: 'Boolean'
            }
          },
          matchValues: {
            required: true,
            serializedName: 'matchValues',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          transforms: {
            required: false,
            serializedName: 'transforms',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'WebApplicationFirewallTransformElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = MatchCondition;
