/*
 * 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 of availability state.
 *
 */
class AvailabilityStatusProperties {
  /**
   * Create a AvailabilityStatusProperties.
   * @member {string} [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} [summary] Summary description of the availability status.
   * @member {string} [detailedStatus] Details of the availability status.
   * @member {string} [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} [rootCauseAttributionTime] When the resource's
   * availabilityState is Unavailable, it provides the Timestamp for when the
   * health impacting event was received.
   * @member {string} [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} [healthEventCause] In case of an availability impacting
   * event, it describes where the health impacting event was originated.
   * Examples are PlatformInitiated, UserInitiated etc.
   * @member {string} [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} [healthEventId] It is a unique Id that identifies the
   * event
   * @member {date} [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} [occuredTime] Timestamp for when last change in health
   * status occurred.
   * @member {string} [reasonChronicity] Chronicity of the availability
   * transition. Possible values include: 'Transient', 'Persistent'
   * @member {date} [reportedTime] Timestamp for when the health was last
   * checked.
   * @member {object} [recentlyResolvedState] An annotation describing a change
   * in the availabilityState to Available from Unavailable with a reasonType
   * of type Unplanned
   * @member {date} [recentlyResolvedState.unavailableOccurredTime] Timestamp
   * for when the availabilityState changed to Unavailable
   * @member {date} [recentlyResolvedState.resolvedTime] Timestamp when the
   * availabilityState changes to Available.
   * @member {string} [recentlyResolvedState.unavailabilitySummary] Brief
   * description of cause of the resource becoming unavailable.
   * @member {array} [recommendedActions] Lists actions the user can take based
   * on the current availabilityState of the resource.
   * @member {array} [serviceImpactingEvents] Lists the service impacting
   * events that may be affecting the health of the resource.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AvailabilityStatusProperties
   *
   * @returns {object} metadata of AvailabilityStatusProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'availabilityStatus_properties',
      type: {
        name: 'Composite',
        className: 'AvailabilityStatusProperties',
        modelProperties: {
          availabilityState: {
            required: false,
            serializedName: 'availabilityState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Available', 'Unavailable', 'Unknown' ]
            }
          },
          summary: {
            required: false,
            serializedName: 'summary',
            type: {
              name: 'String'
            }
          },
          detailedStatus: {
            required: false,
            serializedName: 'detailedStatus',
            type: {
              name: 'String'
            }
          },
          reasonType: {
            required: false,
            serializedName: 'reasonType',
            type: {
              name: 'String'
            }
          },
          rootCauseAttributionTime: {
            required: false,
            serializedName: 'rootCauseAttributionTime',
            type: {
              name: 'DateTime'
            }
          },
          healthEventType: {
            required: false,
            serializedName: 'healthEventType',
            type: {
              name: 'String'
            }
          },
          healthEventCause: {
            required: false,
            serializedName: 'healthEventCause',
            type: {
              name: 'String'
            }
          },
          healthEventCategory: {
            required: false,
            serializedName: 'healthEventCategory',
            type: {
              name: 'String'
            }
          },
          healthEventId: {
            required: false,
            serializedName: 'healthEventId',
            type: {
              name: 'String'
            }
          },
          resolutionETA: {
            required: false,
            serializedName: 'resolutionETA',
            type: {
              name: 'DateTime'
            }
          },
          occuredTime: {
            required: false,
            serializedName: 'occuredTime',
            type: {
              name: 'DateTime'
            }
          },
          reasonChronicity: {
            required: false,
            serializedName: 'reasonChronicity',
            type: {
              name: 'Enum',
              allowedValues: [ 'Transient', 'Persistent' ]
            }
          },
          reportedTime: {
            required: false,
            serializedName: 'reportedTime',
            type: {
              name: 'DateTime'
            }
          },
          recentlyResolvedState: {
            required: false,
            serializedName: 'recentlyResolvedState',
            type: {
              name: 'Composite',
              className: 'AvailabilityStatusPropertiesRecentlyResolvedState'
            }
          },
          recommendedActions: {
            required: false,
            serializedName: 'recommendedActions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'RecommendedActionElementType',
                  type: {
                    name: 'Composite',
                    className: 'RecommendedAction'
                  }
              }
            }
          },
          serviceImpactingEvents: {
            required: false,
            serializedName: 'serviceImpactingEvents',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ServiceImpactingEventElementType',
                  type: {
                    name: 'Composite',
                    className: 'ServiceImpactingEvent'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = AvailabilityStatusProperties;
