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

/**
 * An activity log alert resource.
 *
 * @extends models['Resource']
 */
class ActivityLogAlertResource extends models['Resource'] {
  /**
   * Create a ActivityLogAlertResource.
   * @property {array} scopes A list of resourceIds that will be used as
   * prefixes. The alert will only apply to activityLogs with resourceIds that
   * fall under one of these prefixes. This list must include at least one
   * item.
   * @property {boolean} [enabled] Indicates whether this activity log alert is
   * enabled. If an activity log alert is not enabled, then none of its actions
   * will be activated. Default value: true .
   * @property {object} condition The condition that will cause this alert to
   * activate.
   * @property {array} [condition.allOf] The list of activity log alert
   * conditions.
   * @property {object} actions The actions that will activate when the
   * condition is met.
   * @property {array} [actions.actionGroups] The list of activity log alerts.
   * @property {string} [description] A description of this activity log alert.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ActivityLogAlertResource
   *
   * @returns {object} metadata of ActivityLogAlertResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ActivityLogAlertResource',
      type: {
        name: 'Composite',
        className: 'ActivityLogAlertResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          scopes: {
            required: true,
            serializedName: 'properties.scopes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          enabled: {
            required: false,
            serializedName: 'properties.enabled',
            defaultValue: true,
            type: {
              name: 'Boolean'
            }
          },
          condition: {
            required: true,
            serializedName: 'properties.condition',
            type: {
              name: 'Composite',
              className: 'ActivityLogAlertAllOfCondition'
            }
          },
          actions: {
            required: true,
            serializedName: 'properties.actions',
            type: {
              name: 'Composite',
              className: 'ActivityLogAlertActionList'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ActivityLogAlertResource;
