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

/**
 * Describes a Chaos event that gets generated when Chaos is waiting for the
 * cluster to become ready for faulting, for example, Chaos may be waiting for
 * the on-going upgrade to finish.
 *
 * @extends models['ChaosEvent']
 */
class WaitingChaosEvent extends models['ChaosEvent'] {
  /**
   * Create a WaitingChaosEvent.
   * @property {string} [reason] Describes why the WaitingChaosEvent was
   * generated, for example, due to a cluster upgrade.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of WaitingChaosEvent
   *
   * @returns {object} metadata of WaitingChaosEvent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Waiting',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'ChaosEvent',
        className: 'WaitingChaosEvent',
        modelProperties: {
          timeStampUtc: {
            required: true,
            serializedName: 'TimeStampUtc',
            type: {
              name: 'DateTime'
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          reason: {
            required: false,
            serializedName: 'Reason',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = WaitingChaosEvent;
