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

/**
 * Cluster Upgrade Domain Completed event.
 *
 * @extends models['ClusterEvent']
 */
class ClusterUpgradeDomainCompletedEvent extends models['ClusterEvent'] {
  /**
   * Create a ClusterUpgradeDomainCompletedEvent.
   * @property {string} targetClusterVersion Target Cluster version.
   * @property {string} upgradeState State of upgrade.
   * @property {string} upgradeDomains Upgrade domains.
   * @property {number} upgradeDomainElapsedTimeInMs Duration of domain upgrade
   * in milli-seconds.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ClusterUpgradeDomainCompletedEvent
   *
   * @returns {object} metadata of ClusterUpgradeDomainCompletedEvent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ClusterUpgradeDomainCompleted',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'FabricEvent',
        className: 'ClusterUpgradeDomainCompletedEvent',
        modelProperties: {
          eventInstanceId: {
            required: true,
            serializedName: 'EventInstanceId',
            type: {
              name: 'String'
            }
          },
          category: {
            required: false,
            serializedName: 'Category',
            type: {
              name: 'String'
            }
          },
          timeStamp: {
            required: true,
            serializedName: 'TimeStamp',
            type: {
              name: 'DateTime'
            }
          },
          hasCorrelatedEvents: {
            required: false,
            serializedName: 'HasCorrelatedEvents',
            type: {
              name: 'Boolean'
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          targetClusterVersion: {
            required: true,
            serializedName: 'TargetClusterVersion',
            type: {
              name: 'String'
            }
          },
          upgradeState: {
            required: true,
            serializedName: 'UpgradeState',
            type: {
              name: 'String'
            }
          },
          upgradeDomains: {
            required: true,
            serializedName: 'UpgradeDomains',
            type: {
              name: 'String'
            }
          },
          upgradeDomainElapsedTimeInMs: {
            required: true,
            serializedName: 'UpgradeDomainElapsedTimeInMs',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = ClusterUpgradeDomainCompletedEvent;
