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

/**
 * Information about a stateless service instance deployed on a node.
 *
 * @extends models['DeployedServiceReplicaInfo']
 */
class DeployedStatelessServiceInstanceInfo extends models['DeployedServiceReplicaInfo'] {
  /**
   * Create a DeployedStatelessServiceInstanceInfo.
   * @property {string} [instanceId] Id of a stateless service instance.
   * InstanceId is used by Service Fabric to uniquely identify an instance of a
   * partition of a stateless service. It is unique within a partition and does
   * not change for the lifetime of the instance. If the instance has failed
   * over on the same or different node, it will get a different value for the
   * InstanceId.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of DeployedStatelessServiceInstanceInfo
   *
   * @returns {object} metadata of DeployedStatelessServiceInstanceInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Stateless',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'DeployedServiceReplicaInfo',
        className: 'DeployedStatelessServiceInstanceInfo',
        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'
            }
          },
          instanceId: {
            required: false,
            serializedName: 'InstanceId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = DeployedStatelessServiceInstanceInfo;
