/*
 * 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 DeployedServiceReplicaDetailInfo {
  /**
   * Create a DeployedServiceReplicaDetailInfo.
   * @property {string} [serviceName] Full hierarchical name of the service in
   * URI format starting with `fabric:`.
   * @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} [currentServiceOperation] Specifies the current active
   * life-cycle operation on a stateful service replica or stateless service
   * instance. Possible values include: 'Unknown', 'None', 'Open',
   * 'ChangeRole', 'Close', 'Abort'
   * @property {date} [currentServiceOperationStartTimeUtc] The start time of
   * the current service operation in UTC format.
   * @property {array} [reportedLoad] List of load reported by replica.
   * @property {string} serviceKind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of DeployedServiceReplicaDetailInfo
   *
   * @returns {object} metadata of DeployedServiceReplicaDetailInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DeployedServiceReplicaDetailInfo',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'DeployedServiceReplicaDetailInfo',
        className: 'DeployedServiceReplicaDetailInfo',
        modelProperties: {
          serviceName: {
            required: false,
            serializedName: 'ServiceName',
            type: {
              name: 'String'
            }
          },
          partitionId: {
            required: false,
            serializedName: 'PartitionId',
            type: {
              name: 'String'
            }
          },
          currentServiceOperation: {
            required: false,
            serializedName: 'CurrentServiceOperation',
            type: {
              name: 'String'
            }
          },
          currentServiceOperationStartTimeUtc: {
            required: false,
            serializedName: 'CurrentServiceOperationStartTimeUtc',
            type: {
              name: 'DateTime'
            }
          },
          reportedLoad: {
            required: false,
            serializedName: 'ReportedLoad',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LoadMetricReportInfoElementType',
                  type: {
                    name: 'Composite',
                    className: 'LoadMetricReportInfo'
                  }
              }
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = DeployedServiceReplicaDetailInfo;
