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

/**
 * availabilityStatus of a resource.
 *
 */
class AvailabilityStatus {
  /**
   * Create a AvailabilityStatus.
   * @member {string} [id] Azure Resource Manager Identity for the
   * availabilityStatuses resource.
   * @member {string} [name] current.
   * @member {string} [type] Microsoft.ResourceHealth/AvailabilityStatuses.
   * @member {string} [location] Azure Resource Manager geo location of the
   * resource.
   * @member {object} [properties] Properties of availability state.
   * @member {string} [properties.availabilityState] Availability status of the
   * resource. When it is null, this availabilityStatus object represents an
   * availability impacting event. Possible values include: 'Available',
   * 'Unavailable', 'Unknown'
   * @member {string} [properties.summary] Summary description of the
   * availability status.
   * @member {string} [properties.detailedStatus] Details of the availability
   * status.
   * @member {string} [properties.reasonType] When the resource's
   * availabilityState is Unavailable, it describes where the health impacting
   * event was originated. Examples are planned, unplanned, user initiated or
   * an outage etc.
   * @member {date} [properties.rootCauseAttributionTime] When the resource's
   * availabilityState is Unavailable, it provides the Timestamp for when the
   * health impacting event was received.
   * @member {string} [properties.healthEventType] In case of an availability
   * impacting event, it describes when the health impacting event was
   * originated. Examples are Lifecycle, Downtime, Fault Analysis etc.
   * @member {string} [properties.healthEventCause] In case of an availability
   * impacting event, it describes where the health impacting event was
   * originated. Examples are PlatformInitiated, UserInitiated etc.
   * @member {string} [properties.healthEventCategory] In case of an
   * availability impacting event, it describes the category of a
   * PlatformInitiated health impacting event. Examples are Planned, Unplanned
   * etc.
   * @member {string} [properties.healthEventId] It is a unique Id that
   * identifies the event
   * @member {date} [properties.resolutionETA] When the resource's
   * availabilityState is Unavailable and the reasonType is not User Initiated,
   * it provides the date and time for when the issue is expected to be
   * resolved.
   * @member {date} [properties.occuredTime] Timestamp for when last change in
   * health status occurred.
   * @member {string} [properties.reasonChronicity] Chronicity of the
   * availability transition. Possible values include: 'Transient',
   * 'Persistent'
   * @member {date} [properties.reportedTime] Timestamp for when the health was
   * last checked.
   * @member {object} [properties.recentlyResolvedState] An annotation
   * describing a change in the availabilityState to Available from Unavailable
   * with a reasonType of type Unplanned
   * @member {date} [properties.recentlyResolvedState.unavailableOccurredTime]
   * Timestamp for when the availabilityState changed to Unavailable
   * @member {date} [properties.recentlyResolvedState.resolvedTime] Timestamp
   * when the availabilityState changes to Available.
   * @member {string} [properties.recentlyResolvedState.unavailabilitySummary]
   * Brief description of cause of the resource becoming unavailable.
   * @member {array} [properties.recommendedActions] Lists actions the user can
   * take based on the current availabilityState of the resource.
   * @member {array} [properties.serviceImpactingEvents] Lists the service
   * impacting events that may be affecting the health of the resource.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AvailabilityStatus
   *
   * @returns {object} metadata of AvailabilityStatus
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'availabilityStatus',
      type: {
        name: 'Composite',
        className: 'AvailabilityStatus',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              className: 'AvailabilityStatusProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = AvailabilityStatus;
