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

/**
 * Properties that define a ProactiveDetection configuration.
 *
 * @extends models['BaseResource']
 */
class ApplicationInsightsComponentProactiveDetectionConfiguration extends models['BaseResource'] {
  /**
   * Create a ApplicationInsightsComponentProactiveDetectionConfiguration.
   * @member {string} [name] The rule name
   * @member {boolean} [enabled] A flag that indicates whether this rule is
   * enabled by the user
   * @member {boolean} [sendEmailsToSubscriptionOwners] A flag that indicated
   * whether notifications on this rule should be sent to subscription owners
   * @member {array} [customEmails] Custom email addresses for this rule
   * notifications
   * @member {string} [lastUpdatedTime] The last time this rule was updated
   * @member {object} [ruleDefinitions] Static definitions of the
   * ProactiveDetection configuration rule (same values for all components).
   * @member {string} [ruleDefinitions.name] The rule name
   * @member {string} [ruleDefinitions.displayName] The rule name as it is
   * displayed in UI
   * @member {string} [ruleDefinitions.description] The rule description
   * @member {string} [ruleDefinitions.helpUrl] URL which displays aditional
   * info about the proactive detection rule
   * @member {boolean} [ruleDefinitions.isHidden] A flag indicating whether the
   * rule is hidden (from the UI)
   * @member {boolean} [ruleDefinitions.isEnabledByDefault] A flag indicating
   * whether the rule is enabled by default
   * @member {boolean} [ruleDefinitions.isInPreview] A flag indicating whether
   * the rule is in preview
   * @member {boolean} [ruleDefinitions.supportsEmailNotifications] A flag
   * indicating whether email notifications are supported for detections for
   * this rule
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationInsightsComponentProactiveDetectionConfiguration
   *
   * @returns {object} metadata of ApplicationInsightsComponentProactiveDetectionConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationInsightsComponentProactiveDetectionConfiguration',
      type: {
        name: 'Composite',
        className: 'ApplicationInsightsComponentProactiveDetectionConfiguration',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          enabled: {
            required: false,
            serializedName: 'Enabled',
            type: {
              name: 'Boolean'
            }
          },
          sendEmailsToSubscriptionOwners: {
            required: false,
            serializedName: 'SendEmailsToSubscriptionOwners',
            type: {
              name: 'Boolean'
            }
          },
          customEmails: {
            required: false,
            serializedName: 'CustomEmails',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          lastUpdatedTime: {
            required: false,
            serializedName: 'LastUpdatedTime',
            type: {
              name: 'String'
            }
          },
          ruleDefinitions: {
            required: false,
            serializedName: 'RuleDefinitions',
            type: {
              name: 'Composite',
              className: 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationInsightsComponentProactiveDetectionConfiguration;
