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

/**
 * Information about an NodeTransition operation.  This class contains an
 * OperationState and a NodeTransitionResult.  The NodeTransitionResult is not
 * valid until OperationState
 * is Completed or Faulted.
 *
 */
class NodeTransitionProgress {
  /**
   * Create a NodeTransitionProgress.
   * @property {string} [state] The state of the operation. Possible values
   * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted',
   * 'Cancelled', 'ForceCancelled'
   * @property {object} [nodeTransitionResult] Represents information about an
   * operation in a terminal state (Completed or Faulted).
   * @property {number} [nodeTransitionResult.errorCode] If OperationState is
   * Completed, this is 0.  If OperationState is Faulted, this is an error code
   * indicating the reason.
   * @property {object} [nodeTransitionResult.nodeResult] Contains information
   * about a node that was targeted by a user-induced operation.
   * @property {string} [nodeTransitionResult.nodeResult.nodeName] The name of
   * a Service Fabric node.
   * @property {string} [nodeTransitionResult.nodeResult.nodeInstanceId] The
   * node instance id.
   */
  constructor() {
  }

  /**
   * Defines the metadata of NodeTransitionProgress
   *
   * @returns {object} metadata of NodeTransitionProgress
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NodeTransitionProgress',
      type: {
        name: 'Composite',
        className: 'NodeTransitionProgress',
        modelProperties: {
          state: {
            required: false,
            serializedName: 'State',
            type: {
              name: 'String'
            }
          },
          nodeTransitionResult: {
            required: false,
            serializedName: 'NodeTransitionResult',
            type: {
              name: 'Composite',
              className: 'NodeTransitionResult'
            }
          }
        }
      }
    };
  }
}

module.exports = NodeTransitionProgress;
