/*
 * 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 properties of a monitoring event.
 *
 */
class EventProperties {
  /**
   * Create a EventProperties.
   * @member {string} [eventCode] The Id of the monitoring event.
   * @member {string} [description] The event name.
   * @member {string} [eventType] The type of the event. for example: VM
   * Health, Server Health, Job Failure etc.
   * @member {string} [affectedObjectFriendlyName] The friendly name of the
   * source of the event on which it is raised (for example, VM, VMM etc).
   * @member {string} [severity] The severity of the event.
   * @member {date} [timeOfOccurrence] The time of occurence of the event.
   * @member {string} [fabricId] The ARM ID of the fabric.
   * @member {object} [providerSpecificDetails] The provider specific settings.
   * @member {string} [providerSpecificDetails.instanceType] Polymorphic
   * Discriminator
   * @member {object} [eventSpecificDetails] The event specific settings.
   * @member {string} [eventSpecificDetails.instanceType] Polymorphic
   * Discriminator
   * @member {array} [healthErrors] The list of errors / warnings capturing
   * details associated with the issue(s).
   */
  constructor() {
  }

  /**
   * Defines the metadata of EventProperties
   *
   * @returns {object} metadata of EventProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EventProperties',
      type: {
        name: 'Composite',
        className: 'EventProperties',
        modelProperties: {
          eventCode: {
            required: false,
            serializedName: 'eventCode',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          eventType: {
            required: false,
            serializedName: 'eventType',
            type: {
              name: 'String'
            }
          },
          affectedObjectFriendlyName: {
            required: false,
            serializedName: 'affectedObjectFriendlyName',
            type: {
              name: 'String'
            }
          },
          severity: {
            required: false,
            serializedName: 'severity',
            type: {
              name: 'String'
            }
          },
          timeOfOccurrence: {
            required: false,
            serializedName: 'timeOfOccurrence',
            type: {
              name: 'DateTime'
            }
          },
          fabricId: {
            required: false,
            serializedName: 'fabricId',
            type: {
              name: 'String'
            }
          },
          providerSpecificDetails: {
            required: false,
            serializedName: 'providerSpecificDetails',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'instanceType',
                clientName: 'instanceType'
              },
              uberParent: 'EventProviderSpecificDetails',
              className: 'EventProviderSpecificDetails'
            }
          },
          eventSpecificDetails: {
            required: false,
            serializedName: 'eventSpecificDetails',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'instanceType',
                clientName: 'instanceType'
              },
              uberParent: 'EventSpecificDetails',
              className: 'EventSpecificDetails'
            }
          },
          healthErrors: {
            required: false,
            serializedName: 'healthErrors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'HealthErrorElementType',
                  type: {
                    name: 'Composite',
                    className: 'HealthError'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = EventProperties;
