/*
 * 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 Service Fabric service replica deployed on a node.
 *
 */
class DeployedServiceReplicaInfo {
  /**
   * Create a DeployedServiceReplicaInfo.
   * @property {string} [serviceName] The full name of the service with
   * 'fabric:' URI scheme.
   * @property {string} [serviceTypeName] Name of the service type as specified
   * in the service manifest.
   * @property {string} [serviceManifestName] The name of the service manifest
   * in which this service type is defined.
   * @property {string} [codePackageName] The name of the code package that
   * hosts this replica.
   * @property {uuid} [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.
   * @property {string} [replicaStatus] The status of a replica of a service.
   * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down',
   * 'Dropped'
   * @property {string} [address] The last address returned by the replica in
   * Open or ChangeRole.
   * @property {string} [servicePackageActivationId] The ActivationId of a
   * deployed service package. If ServicePackageActivationMode specified at the
   * time of creating the service
   * is 'SharedProcess' (or if it is not specified, in which case it defaults
   * to 'SharedProcess'), then value of ServicePackageActivationId
   * is always an empty string.
   * @property {string} [hostProcessId] Host process ID of the process that is
   * hosting the replica. This will be zero if the replica is down. In hyper-v
   * containers this host process ID will be from different kernel.
   * @property {string} serviceKind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of DeployedServiceReplicaInfo
   *
   * @returns {object} metadata of DeployedServiceReplicaInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DeployedServiceReplicaInfo',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'DeployedServiceReplicaInfo',
        className: 'DeployedServiceReplicaInfo',
        modelProperties: {
          serviceName: {
            required: false,
            serializedName: 'ServiceName',
            type: {
              name: 'String'
            }
          },
          serviceTypeName: {
            required: false,
            serializedName: 'ServiceTypeName',
            type: {
              name: 'String'
            }
          },
          serviceManifestName: {
            required: false,
            serializedName: 'ServiceManifestName',
            type: {
              name: 'String'
            }
          },
          codePackageName: {
            required: false,
            serializedName: 'CodePackageName',
            type: {
              name: 'String'
            }
          },
          partitionId: {
            required: false,
            serializedName: 'PartitionId',
            type: {
              name: 'String'
            }
          },
          replicaStatus: {
            required: false,
            serializedName: 'ReplicaStatus',
            type: {
              name: 'String'
            }
          },
          address: {
            required: false,
            serializedName: 'Address',
            type: {
              name: 'String'
            }
          },
          servicePackageActivationId: {
            required: false,
            serializedName: 'ServicePackageActivationId',
            type: {
              name: 'String'
            }
          },
          hostProcessId: {
            required: false,
            serializedName: 'HostProcessId',
            type: {
              name: 'String'
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = DeployedServiceReplicaInfo;
