# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::ServiceFabric::V6_5_0_36
  module Models
    #
    # Information about a partition of a stateful Service Fabric service..
    #
    class StatefulServicePartitionInfo < ServicePartitionInfo

      include MsRestAzure


      def initialize
        @ServiceKind = "Stateful"
      end

      attr_accessor :ServiceKind

      # @return [Integer] The target replica set size as a number.
      attr_accessor :target_replica_set_size

      # @return [Integer] The minimum replica set size as a number.
      attr_accessor :min_replica_set_size

      # @return [Duration] The duration for which this partition was in quorum
      # loss. If the partition is currently in quorum loss, it returns the
      # duration since it has been in that state. This field is using ISO8601
      # format for specifying the duration.
      attr_accessor :last_quorum_loss_duration

      # @return [Epoch] An Epoch is a configuration number for the partition as
      # a whole. When the configuration of the replica set changes, for example
      # when the Primary replica changes, the operations that are replicated
      # from the new Primary replica are said to be a new Epoch from the ones
      # which were sent by the old Primary replica.
      attr_accessor :primary_epoch


      #
      # Mapper for StatefulServicePartitionInfo class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Stateful',
          type: {
            name: 'Composite',
            class_name: 'StatefulServicePartitionInfo',
            model_properties: {
              health_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HealthState',
                type: {
                  name: 'String'
                }
              },
              partition_status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PartitionStatus',
                type: {
                  name: 'String'
                }
              },
              partition_information: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PartitionInformation',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'ServicePartitionKind',
                  uber_parent: 'PartitionInformation',
                  class_name: 'PartitionInformation'
                }
              },
              ServiceKind: {
                client_side_validation: true,
                required: true,
                serialized_name: 'ServiceKind',
                type: {
                  name: 'String'
                }
              },
              target_replica_set_size: {
                client_side_validation: true,
                required: false,
                serialized_name: 'TargetReplicaSetSize',
                type: {
                  name: 'Number'
                }
              },
              min_replica_set_size: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MinReplicaSetSize',
                type: {
                  name: 'Number'
                }
              },
              last_quorum_loss_duration: {
                client_side_validation: true,
                required: false,
                serialized_name: 'LastQuorumLossDuration',
                type: {
                  name: 'TimeSpan'
                }
              },
              primary_epoch: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PrimaryEpoch',
                type: {
                  name: 'Composite',
                  class_name: 'Epoch'
                }
              }
            }
          }
        }
      end
    end
  end
end
