/*
 * 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 a partition data loss user-induced operation.
 *
 */
class PartitionDataLossProgress {
  /**
   * Create a PartitionDataLossProgress.
   * @property {string} [state] The state of the operation. Possible values
   * include: 'Invalid', 'Running', 'RollingBack', 'Completed', 'Faulted',
   * 'Cancelled', 'ForceCancelled'
   * @property {object} [invokeDataLossResult] Represents information about an
   * operation in a terminal state (Completed or Faulted).
   * @property {number} [invokeDataLossResult.errorCode] If OperationState is
   * Completed, this is 0.  If OperationState is Faulted, this is an error code
   * indicating the reason.
   * @property {object} [invokeDataLossResult.selectedPartition] This class
   * returns information about the partition that the user-induced operation
   * acted upon.
   * @property {string} [invokeDataLossResult.selectedPartition.serviceName]
   * The name of the service the partition belongs to.
   * @property {uuid} [invokeDataLossResult.selectedPartition.partitionId] An
   * internal ID used by Service Fabric to uniquely identify a partition. This
   * is a randomly generated GUID when the service was created. The partition
   * ID is unique and does not change for the lifetime of the service. If the
   * same service was deleted and recreated the IDs of its partitions would be
   * different.
   */
  constructor() {
  }

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

module.exports = PartitionDataLossProgress;
