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

/**
 * The condition that results in the alert rule being activated.
 *
 */
class RuleCondition {
  /**
   * Create a RuleCondition.
   * @property {object} [dataSource] the resource from which the rule collects
   * its data. For this type dataSource will always be of type
   * RuleMetricDataSource.
   * @property {string} [dataSource.resourceUri] the resource identifier of the
   * resource the rule monitors. **NOTE**: this property cannot be updated for
   * an existing rule.
   * @property {string} [dataSource.odatatype] Polymorphic Discriminator
   * @property {string} odatatype Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of RuleCondition
   *
   * @returns {object} metadata of RuleCondition
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RuleCondition',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'odata.type',
          clientName: 'odatatype'
        },
        uberParent: 'RuleCondition',
        className: 'RuleCondition',
        modelProperties: {
          dataSource: {
            required: false,
            serializedName: 'dataSource',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'odata.type',
                clientName: 'odatatype'
              },
              uberParent: 'RuleDataSource',
              className: 'RuleDataSource'
            }
          },
          odatatype: {
            required: true,
            serializedName: 'odata\\.type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RuleCondition;
