# 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::Mgmt::V2017_07_01_preview
  module Models
    #
    # The application resource.
    #
    class ApplicationResource < ProxyResource

      include MsRestAzure

      # @return [String]
      attr_accessor :type_version

      # @return [Array<ApplicationParameter>]
      attr_accessor :parameters

      # @return [ApplicationUpgradePolicy]
      attr_accessor :upgrade_policy

      # @return [Integer] The minimum number of nodes where Service Fabric will
      # reserve capacity for this application. Note that this does not mean
      # that the services of this application will be placed on all of those
      # nodes. If this property is set to zero, no capacity will be reserved.
      # The value of this property cannot be more than the value of the
      # MaximumNodes property.
      attr_accessor :minimum_nodes

      # @return [Integer] The maximum number of nodes where Service Fabric will
      # reserve capacity for this application. Note that this does not mean
      # that the services of this application will be placed on all of those
      # nodes. By default, the value of this property is zero and it means that
      # the services can be placed on any node. Default value: 0 .
      attr_accessor :maximum_nodes

      # @return [Boolean] The version of the application type
      attr_accessor :remove_application_capacity

      # @return [Array<ApplicationMetricDescription>]
      attr_accessor :metrics

      # @return [String] The current deployment or provisioning state, which
      # only appears in the response
      attr_accessor :provisioning_state

      # @return [String]
      attr_accessor :type_name


      #
      # Mapper for ApplicationResource class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ApplicationResource',
          type: {
            name: 'Composite',
            class_name: 'ApplicationResource',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              location: {
                client_side_validation: true,
                required: true,
                serialized_name: 'location',
                type: {
                  name: 'String'
                }
              },
              type_version: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.typeVersion',
                type: {
                  name: 'String'
                }
              },
              parameters: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.parameters',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ApplicationParameterElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ApplicationParameter'
                      }
                  }
                }
              },
              upgrade_policy: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.upgradePolicy',
                type: {
                  name: 'Composite',
                  class_name: 'ApplicationUpgradePolicy'
                }
              },
              minimum_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.minimumNodes',
                constraints: {
                  InclusiveMinimum: 0
                },
                type: {
                  name: 'Number'
                }
              },
              maximum_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.maximumNodes',
                default_value: 0,
                constraints: {
                  InclusiveMinimum: 0
                },
                type: {
                  name: 'Number'
                }
              },
              remove_application_capacity: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.removeApplicationCapacity',
                type: {
                  name: 'Boolean'
                }
              },
              metrics: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.metrics',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ApplicationMetricDescriptionElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ApplicationMetricDescription'
                      }
                  }
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.provisioningState',
                type: {
                  name: 'String'
                }
              },
              type_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.typeName',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
