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

/**
 * This is the base type that represents an advanced filter. To configure an
 * advanced filter, do not directly instantiate an object of this class.
 * Instead, instantiate an object of a derived class such as
 * BoolEqualsAdvancedFilter, NumberInAdvancedFilter, StringEqualsAdvancedFilter
 * etc. depending on the type of the key based on which you want to filter.
 *
 */
class AdvancedFilter {
  /**
   * Create a AdvancedFilter.
   * @property {string} [key] The field/property in the event based on which
   * you want to filter.
   * @property {string} operatorType Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of AdvancedFilter
   *
   * @returns {object} metadata of AdvancedFilter
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AdvancedFilter',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'operatorType',
          clientName: 'operatorType'
        },
        uberParent: 'AdvancedFilter',
        className: 'AdvancedFilter',
        modelProperties: {
          key: {
            required: false,
            serializedName: 'key',
            type: {
              name: 'String'
            }
          },
          operatorType: {
            required: true,
            serializedName: 'operatorType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = AdvancedFilter;
