# 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::V7_0_0_42
  module Models
    #
    # Information about a partition of a stateless Service Fabric service.
    #
    class StatelessServicePartitionInfo < ServicePartitionInfo

      include MsRestAzure


      def initialize
        @ServiceKind = "Stateless"
      end

      attr_accessor :ServiceKind

      # @return [Integer] Number of instances of this partition.
      attr_accessor :instance_count

      # @return [Integer] MinInstanceCount is the minimum number of instances
      # that must be up to meet the EnsureAvailability safety check during
      # operations like upgrade or deactivate node.
      # The actual number that is used is max( MinInstanceCount, ceil(
      # MinInstancePercentage/100.0 * InstanceCount) ).
      # Note, if InstanceCount is set to -1, during MinInstanceCount
      # computation -1 is first converted into the number of nodes on which the
      # instances are allowed to be placed according to the placement
      # constraints on the service.
      attr_accessor :min_instance_count

      # @return [Integer] MinInstancePercentage is the minimum percentage of
      # InstanceCount that must be up to meet the EnsureAvailability safety
      # check during operations like upgrade or deactivate node.
      # The actual number that is used is max( MinInstanceCount, ceil(
      # MinInstancePercentage/100.0 * InstanceCount) ).
      # Note, if InstanceCount is set to -1, during MinInstancePercentage
      # computation, -1 is first converted into the number of nodes on which
      # the instances are allowed to be placed according to the placement
      # constraints on the service.
      attr_accessor :min_instance_percentage


      #
      # Mapper for StatelessServicePartitionInfo class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Stateless',
          type: {
            name: 'Composite',
            class_name: 'StatelessServicePartitionInfo',
            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'
                }
              },
              instance_count: {
                client_side_validation: true,
                required: false,
                serialized_name: 'InstanceCount',
                type: {
                  name: 'Number'
                }
              },
              min_instance_count: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MinInstanceCount',
                type: {
                  name: 'Number'
                }
              },
              min_instance_percentage: {
                client_side_validation: true,
                required: false,
                serialized_name: 'MinInstancePercentage',
                type: {
                  name: 'Number'
                }
              }
            }
          }
        }
      end
    end
  end
end
