/*
 * 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 of a Service Fabric service.
 *
 */
class ServicePartitionInfo {
  /**
   * Create a ServicePartitionInfo.
   * @property {string} [healthState] The health state of a Service Fabric
   * entity such as Cluster, Node, Application, Service, Partition, Replica
   * etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error',
   * 'Unknown'
   * @property {string} [partitionStatus] The status of the service fabric
   * service partition. Possible values include: 'Invalid', 'Ready',
   * 'NotReady', 'InQuorumLoss', 'Reconfiguring', 'Deleting'
   * @property {object} [partitionInformation] Information about the partition
   * identity, partitioning scheme and keys supported by it.
   * @property {uuid} [partitionInformation.id] 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.
   * @property {string} [partitionInformation.servicePartitionKind] Polymorphic
   * Discriminator
   * @property {string} serviceKind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ServicePartitionInfo
   *
   * @returns {object} metadata of ServicePartitionInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ServicePartitionInfo',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'ServicePartitionInfo',
        className: 'ServicePartitionInfo',
        modelProperties: {
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          partitionStatus: {
            required: false,
            serializedName: 'PartitionStatus',
            type: {
              name: 'String'
            }
          },
          partitionInformation: {
            required: false,
            serializedName: 'PartitionInformation',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'ServicePartitionKind',
                clientName: 'servicePartitionKind'
              },
              uberParent: 'PartitionInformation',
              className: 'PartitionInformation'
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ServicePartitionInfo;
