# 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_3_0_9
  module Models
    #
    # Describes a service type defined in the service manifest of a provisioned
    # application type. The properties the ones defined in the service
    # manifest.
    #
    class ServiceTypeDescription

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["Stateful"] = "StatefulServiceTypeDescription"
      @@discriminatorMap["Stateless"] = "StatelessServiceTypeDescription"

      def initialize
        @Kind = "ServiceTypeDescription"
      end

      attr_accessor :Kind

      # @return [Boolean] Indicates whether the service type is a stateful
      # service type or a stateless service type. This property is true if the
      # service type is a stateful service type, false otherwise.
      attr_accessor :is_stateful

      # @return [String] Name of the service type as specified in the service
      # manifest.
      attr_accessor :service_type_name

      # @return [String] The placement constraint to be used when instantiating
      # this service in a Service Fabric cluster.
      attr_accessor :placement_constraints

      # @return [Array<ServiceLoadMetricDescription>] The service load metrics
      # is given as an array of ServiceLoadMetricDescription objects.
      attr_accessor :load_metrics

      # @return [Array<ServicePlacementPolicyDescription>] List of service
      # placement policy descriptions.
      attr_accessor :service_placement_policies

      # @return [Array<ServiceTypeExtensionDescription>] List of service type
      # extensions.
      attr_accessor :extensions


      #
      # Mapper for ServiceTypeDescription class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ServiceTypeDescription',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'Kind',
            uber_parent: 'ServiceTypeDescription',
            class_name: 'ServiceTypeDescription',
            model_properties: {
              is_stateful: {
                client_side_validation: true,
                required: false,
                serialized_name: 'IsStateful',
                type: {
                  name: 'Boolean'
                }
              },
              service_type_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ServiceTypeName',
                type: {
                  name: 'String'
                }
              },
              placement_constraints: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PlacementConstraints',
                type: {
                  name: 'String'
                }
              },
              load_metrics: {
                client_side_validation: true,
                required: false,
                serialized_name: 'LoadMetrics',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ServiceLoadMetricDescriptionElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ServiceLoadMetricDescription'
                      }
                  }
                }
              },
              service_placement_policies: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ServicePlacementPolicies',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ServicePlacementPolicyDescriptionElementType',
                      type: {
                        name: 'Composite',
                        polymorphic_discriminator: 'Type',
                        uber_parent: 'ServicePlacementPolicyDescription',
                        class_name: 'ServicePlacementPolicyDescription'
                      }
                  }
                }
              },
              extensions: {
                client_side_validation: true,
                required: false,
                serialized_name: 'Extensions',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ServiceTypeExtensionDescriptionElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ServiceTypeExtensionDescription'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
