# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Web module Models # # Model object. # class ServerFarmWithRichSkuProperties include MsRestAzure # @return [String] Name for the App Service Plan attr_accessor :name # @return [String] Target worker tier assigned to the App Service Plan attr_accessor :worker_tier_name # @return [StatusOptions] App Service Plan Status. Possible values # include: 'Ready', 'Pending' attr_accessor :status # @return [String] App Service Plan Subscription attr_accessor :subscription # @return [String] App Service Plan administration site attr_accessor :admin_site_name # @return [HostingEnvironmentProfile] Specification for the hosting # environment (App Service Environment) to use for the App Service Plan attr_accessor :hosting_environment_profile # @return [Integer] Maximum number of instances that can be assigned to # this App Service Plan attr_accessor :maximum_number_of_workers # @return [String] Geographical location for the App Service Plan attr_accessor :geo_region # @return [Boolean] If True apps assigned to this App Service Plan can # be scaled independently # If False apps assigned to this App Service Plan will scale # to all instances of the plan attr_accessor :per_site_scaling # @return [Integer] Number of web apps assigned to this App Service Plan attr_accessor :number_of_sites # @return [String] Resource group of the serverfarm attr_accessor :resource_group # # Validate the object. Throws ValidationError if validation fails. # def validate @hosting_environment_profile.validate unless @hosting_environment_profile.nil? end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.worker_tier_name output_object['workerTierName'] = serialized_property unless serialized_property.nil? serialized_property = object.status output_object['status'] = serialized_property unless serialized_property.nil? serialized_property = object.subscription output_object['subscription'] = serialized_property unless serialized_property.nil? serialized_property = object.admin_site_name output_object['adminSiteName'] = serialized_property unless serialized_property.nil? serialized_property = object.hosting_environment_profile unless serialized_property.nil? serialized_property = HostingEnvironmentProfile.serialize_object(serialized_property) end output_object['hostingEnvironmentProfile'] = serialized_property unless serialized_property.nil? serialized_property = object.maximum_number_of_workers output_object['maximumNumberOfWorkers'] = serialized_property unless serialized_property.nil? serialized_property = object.geo_region output_object['geoRegion'] = serialized_property unless serialized_property.nil? serialized_property = object.per_site_scaling output_object['perSiteScaling'] = serialized_property unless serialized_property.nil? serialized_property = object.number_of_sites output_object['numberOfSites'] = serialized_property unless serialized_property.nil? serialized_property = object.resource_group output_object['resourceGroup'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [ServerFarmWithRichSkuProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = ServerFarmWithRichSkuProperties.new deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['workerTierName'] output_object.worker_tier_name = deserialized_property deserialized_property = object['status'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = StatusOptions.constants.any? { |e| StatusOptions.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum StatusOptions does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.status = deserialized_property deserialized_property = object['subscription'] output_object.subscription = deserialized_property deserialized_property = object['adminSiteName'] output_object.admin_site_name = deserialized_property deserialized_property = object['hostingEnvironmentProfile'] unless deserialized_property.nil? deserialized_property = HostingEnvironmentProfile.deserialize_object(deserialized_property) end output_object.hosting_environment_profile = deserialized_property deserialized_property = object['maximumNumberOfWorkers'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.maximum_number_of_workers = deserialized_property deserialized_property = object['geoRegion'] output_object.geo_region = deserialized_property deserialized_property = object['perSiteScaling'] output_object.per_site_scaling = deserialized_property deserialized_property = object['numberOfSites'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.number_of_sites = deserialized_property deserialized_property = object['resourceGroup'] output_object.resource_group = deserialized_property output_object end end end end