# 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 SiteConfigProperties include MsRestAzure # @return [Integer] Number of workers attr_accessor :number_of_workers # @return [Array] Default documents attr_accessor :default_documents # @return [String] Net Framework Version attr_accessor :net_framework_version # @return [String] Version of PHP attr_accessor :php_version # @return [String] Version of Python attr_accessor :python_version # @return [Boolean] Enable request tracing attr_accessor :request_tracing_enabled # @return [DateTime] Request tracing expiration time attr_accessor :request_tracing_expiration_time # @return [Boolean] Remote Debugging Enabled attr_accessor :remote_debugging_enabled # @return [String] Remote Debugging Version attr_accessor :remote_debugging_version # @return [Boolean] HTTP logging Enabled attr_accessor :http_logging_enabled # @return [Integer] HTTP Logs Directory size limit attr_accessor :logs_directory_size_limit # @return [Boolean] Detailed error logging enabled attr_accessor :detailed_error_logging_enabled # @return [String] Publishing user name attr_accessor :publishing_username # @return [String] Publishing password attr_accessor :publishing_password # @return [Array] Application Settings attr_accessor :app_settings # @return [Array] Site Metadata attr_accessor :metadata # @return [Array] Connection strings attr_accessor :connection_strings # @return [Array] Handler mappings attr_accessor :handler_mappings # @return [String] Document root attr_accessor :document_root # @return [String] SCM type attr_accessor :scm_type # @return [Boolean] Use 32 bit worker process attr_accessor :use32bit_worker_process # @return [Boolean] Web socket enabled. attr_accessor :web_sockets_enabled # @return [Boolean] Always On attr_accessor :always_on # @return [String] Java version attr_accessor :java_version # @return [String] Java container attr_accessor :java_container # @return [String] Java container version attr_accessor :java_container_version # @return [ManagedPipelineMode] Managed pipeline mode. Possible values # include: 'Integrated', 'Classic' attr_accessor :managed_pipeline_mode # @return [Array] Virtual applications attr_accessor :virtual_applications # @return [SiteLoadBalancing] Site load balancing. Possible values # include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', # 'WeightedTotalTraffic', 'RequestHash' attr_accessor :load_balancing # @return [Experiments] This is work around for polymophic types attr_accessor :experiments # @return [SiteLimits] Site limits attr_accessor :limits # @return [Boolean] Auto heal enabled attr_accessor :auto_heal_enabled # @return [AutoHealRules] Auto heal rules attr_accessor :auto_heal_rules # @return [String] Tracing options attr_accessor :tracing_options # @return [String] Vnet name attr_accessor :vnet_name # @return [CorsSettings] Cross-Origin Resource Sharing (CORS) settings. attr_accessor :cors # @return [ApiDefinitionInfo] Information about the formal API # definition for the web app. attr_accessor :api_definition # @return [String] Auto swap slot name attr_accessor :auto_swap_slot_name # @return [Boolean] Local mysql enabled attr_accessor :local_my_sql_enabled # @return [Array] Ip Security restrictions attr_accessor :ip_security_restrictions # # Validate the object. Throws ValidationError if validation fails. # def validate @default_documents.each{ |e| e.validate if e.respond_to?(:validate) } unless @default_documents.nil? @app_settings.each{ |e| e.validate if e.respond_to?(:validate) } unless @app_settings.nil? @metadata.each{ |e| e.validate if e.respond_to?(:validate) } unless @metadata.nil? @connection_strings.each{ |e| e.validate if e.respond_to?(:validate) } unless @connection_strings.nil? @handler_mappings.each{ |e| e.validate if e.respond_to?(:validate) } unless @handler_mappings.nil? @virtual_applications.each{ |e| e.validate if e.respond_to?(:validate) } unless @virtual_applications.nil? @experiments.validate unless @experiments.nil? @limits.validate unless @limits.nil? @auto_heal_rules.validate unless @auto_heal_rules.nil? @cors.validate unless @cors.nil? @api_definition.validate unless @api_definition.nil? @ip_security_restrictions.each{ |e| e.validate if e.respond_to?(:validate) } unless @ip_security_restrictions.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.number_of_workers output_object['numberOfWorkers'] = serialized_property unless serialized_property.nil? serialized_property = object.default_documents output_object['defaultDocuments'] = serialized_property unless serialized_property.nil? serialized_property = object.net_framework_version output_object['netFrameworkVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.php_version output_object['phpVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.python_version output_object['pythonVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.request_tracing_enabled output_object['requestTracingEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.request_tracing_expiration_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['requestTracingExpirationTime'] = serialized_property unless serialized_property.nil? serialized_property = object.remote_debugging_enabled output_object['remoteDebuggingEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.remote_debugging_version output_object['remoteDebuggingVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.http_logging_enabled output_object['httpLoggingEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.logs_directory_size_limit output_object['logsDirectorySizeLimit'] = serialized_property unless serialized_property.nil? serialized_property = object.detailed_error_logging_enabled output_object['detailedErrorLoggingEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.publishing_username output_object['publishingUsername'] = serialized_property unless serialized_property.nil? serialized_property = object.publishing_password output_object['publishingPassword'] = serialized_property unless serialized_property.nil? serialized_property = object.app_settings unless serialized_property.nil? serializedArray = [] serialized_property.each do |element1| unless element1.nil? element1 = NameValuePair.serialize_object(element1) end serializedArray.push(element1) end serialized_property = serializedArray end output_object['appSettings'] = serialized_property unless serialized_property.nil? serialized_property = object.metadata unless serialized_property.nil? serializedArray = [] serialized_property.each do |element2| unless element2.nil? element2 = NameValuePair.serialize_object(element2) end serializedArray.push(element2) end serialized_property = serializedArray end output_object['metadata'] = serialized_property unless serialized_property.nil? serialized_property = object.connection_strings unless serialized_property.nil? serializedArray = [] serialized_property.each do |element3| unless element3.nil? element3 = ConnStringInfo.serialize_object(element3) end serializedArray.push(element3) end serialized_property = serializedArray end output_object['connectionStrings'] = serialized_property unless serialized_property.nil? serialized_property = object.handler_mappings unless serialized_property.nil? serializedArray = [] serialized_property.each do |element4| unless element4.nil? element4 = HandlerMapping.serialize_object(element4) end serializedArray.push(element4) end serialized_property = serializedArray end output_object['handlerMappings'] = serialized_property unless serialized_property.nil? serialized_property = object.document_root output_object['documentRoot'] = serialized_property unless serialized_property.nil? serialized_property = object.scm_type output_object['scmType'] = serialized_property unless serialized_property.nil? serialized_property = object.use32bit_worker_process output_object['use32BitWorkerProcess'] = serialized_property unless serialized_property.nil? serialized_property = object.web_sockets_enabled output_object['webSocketsEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.always_on output_object['alwaysOn'] = serialized_property unless serialized_property.nil? serialized_property = object.java_version output_object['javaVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.java_container output_object['javaContainer'] = serialized_property unless serialized_property.nil? serialized_property = object.java_container_version output_object['javaContainerVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.managed_pipeline_mode output_object['managedPipelineMode'] = serialized_property unless serialized_property.nil? serialized_property = object.virtual_applications unless serialized_property.nil? serializedArray = [] serialized_property.each do |element5| unless element5.nil? element5 = VirtualApplication.serialize_object(element5) end serializedArray.push(element5) end serialized_property = serializedArray end output_object['virtualApplications'] = serialized_property unless serialized_property.nil? serialized_property = object.load_balancing output_object['loadBalancing'] = serialized_property unless serialized_property.nil? serialized_property = object.experiments unless serialized_property.nil? serialized_property = Experiments.serialize_object(serialized_property) end output_object['experiments'] = serialized_property unless serialized_property.nil? serialized_property = object.limits unless serialized_property.nil? serialized_property = SiteLimits.serialize_object(serialized_property) end output_object['limits'] = serialized_property unless serialized_property.nil? serialized_property = object.auto_heal_enabled output_object['autoHealEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.auto_heal_rules unless serialized_property.nil? serialized_property = AutoHealRules.serialize_object(serialized_property) end output_object['autoHealRules'] = serialized_property unless serialized_property.nil? serialized_property = object.tracing_options output_object['tracingOptions'] = serialized_property unless serialized_property.nil? serialized_property = object.vnet_name output_object['vnetName'] = serialized_property unless serialized_property.nil? serialized_property = object.cors unless serialized_property.nil? serialized_property = CorsSettings.serialize_object(serialized_property) end output_object['cors'] = serialized_property unless serialized_property.nil? serialized_property = object.api_definition unless serialized_property.nil? serialized_property = ApiDefinitionInfo.serialize_object(serialized_property) end output_object['apiDefinition'] = serialized_property unless serialized_property.nil? serialized_property = object.auto_swap_slot_name output_object['autoSwapSlotName'] = serialized_property unless serialized_property.nil? serialized_property = object.local_my_sql_enabled output_object['localMySqlEnabled'] = serialized_property unless serialized_property.nil? serialized_property = object.ip_security_restrictions unless serialized_property.nil? serializedArray = [] serialized_property.each do |element6| unless element6.nil? element6 = IpSecurityRestriction.serialize_object(element6) end serializedArray.push(element6) end serialized_property = serializedArray end output_object['ipSecurityRestrictions'] = 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 [SiteConfigProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = SiteConfigProperties.new deserialized_property = object['numberOfWorkers'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.number_of_workers = deserialized_property deserialized_property = object['defaultDocuments'] output_object.default_documents = deserialized_property deserialized_property = object['netFrameworkVersion'] output_object.net_framework_version = deserialized_property deserialized_property = object['phpVersion'] output_object.php_version = deserialized_property deserialized_property = object['pythonVersion'] output_object.python_version = deserialized_property deserialized_property = object['requestTracingEnabled'] output_object.request_tracing_enabled = deserialized_property deserialized_property = object['requestTracingExpirationTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.request_tracing_expiration_time = deserialized_property deserialized_property = object['remoteDebuggingEnabled'] output_object.remote_debugging_enabled = deserialized_property deserialized_property = object['remoteDebuggingVersion'] output_object.remote_debugging_version = deserialized_property deserialized_property = object['httpLoggingEnabled'] output_object.http_logging_enabled = deserialized_property deserialized_property = object['logsDirectorySizeLimit'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.logs_directory_size_limit = deserialized_property deserialized_property = object['detailedErrorLoggingEnabled'] output_object.detailed_error_logging_enabled = deserialized_property deserialized_property = object['publishingUsername'] output_object.publishing_username = deserialized_property deserialized_property = object['publishingPassword'] output_object.publishing_password = deserialized_property deserialized_property = object['appSettings'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element8| unless element8.nil? element8 = NameValuePair.deserialize_object(element8) end deserialized_array.push(element8) end deserialized_property = deserialized_array end output_object.app_settings = deserialized_property deserialized_property = object['metadata'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element9| unless element9.nil? element9 = NameValuePair.deserialize_object(element9) end deserialized_array.push(element9) end deserialized_property = deserialized_array end output_object.metadata = deserialized_property deserialized_property = object['connectionStrings'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element10| unless element10.nil? element10 = ConnStringInfo.deserialize_object(element10) end deserialized_array.push(element10) end deserialized_property = deserialized_array end output_object.connection_strings = deserialized_property deserialized_property = object['handlerMappings'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element11| unless element11.nil? element11 = HandlerMapping.deserialize_object(element11) end deserialized_array.push(element11) end deserialized_property = deserialized_array end output_object.handler_mappings = deserialized_property deserialized_property = object['documentRoot'] output_object.document_root = deserialized_property deserialized_property = object['scmType'] output_object.scm_type = deserialized_property deserialized_property = object['use32BitWorkerProcess'] output_object.use32bit_worker_process = deserialized_property deserialized_property = object['webSocketsEnabled'] output_object.web_sockets_enabled = deserialized_property deserialized_property = object['alwaysOn'] output_object.always_on = deserialized_property deserialized_property = object['javaVersion'] output_object.java_version = deserialized_property deserialized_property = object['javaContainer'] output_object.java_container = deserialized_property deserialized_property = object['javaContainerVersion'] output_object.java_container_version = deserialized_property deserialized_property = object['managedPipelineMode'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ManagedPipelineMode.constants.any? { |e| ManagedPipelineMode.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ManagedPipelineMode does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.managed_pipeline_mode = deserialized_property deserialized_property = object['virtualApplications'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element12| unless element12.nil? element12 = VirtualApplication.deserialize_object(element12) end deserialized_array.push(element12) end deserialized_property = deserialized_array end output_object.virtual_applications = deserialized_property deserialized_property = object['loadBalancing'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = SiteLoadBalancing.constants.any? { |e| SiteLoadBalancing.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum SiteLoadBalancing does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.load_balancing = deserialized_property deserialized_property = object['experiments'] unless deserialized_property.nil? deserialized_property = Experiments.deserialize_object(deserialized_property) end output_object.experiments = deserialized_property deserialized_property = object['limits'] unless deserialized_property.nil? deserialized_property = SiteLimits.deserialize_object(deserialized_property) end output_object.limits = deserialized_property deserialized_property = object['autoHealEnabled'] output_object.auto_heal_enabled = deserialized_property deserialized_property = object['autoHealRules'] unless deserialized_property.nil? deserialized_property = AutoHealRules.deserialize_object(deserialized_property) end output_object.auto_heal_rules = deserialized_property deserialized_property = object['tracingOptions'] output_object.tracing_options = deserialized_property deserialized_property = object['vnetName'] output_object.vnet_name = deserialized_property deserialized_property = object['cors'] unless deserialized_property.nil? deserialized_property = CorsSettings.deserialize_object(deserialized_property) end output_object.cors = deserialized_property deserialized_property = object['apiDefinition'] unless deserialized_property.nil? deserialized_property = ApiDefinitionInfo.deserialize_object(deserialized_property) end output_object.api_definition = deserialized_property deserialized_property = object['autoSwapSlotName'] output_object.auto_swap_slot_name = deserialized_property deserialized_property = object['localMySqlEnabled'] output_object.local_my_sql_enabled = deserialized_property deserialized_property = object['ipSecurityRestrictions'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element13| unless element13.nil? element13 = IpSecurityRestriction.deserialize_object(element13) end deserialized_array.push(element13) end deserialized_property = deserialized_array end output_object.ip_security_restrictions = deserialized_property output_object end end end end