# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.16.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 WorkerPoolProperties include MsRestAzure # @return [Integer] Worker size id for referencing this worker pool attr_accessor :worker_size_id # @return [ComputeModeOptions] Shared or dedicated web app hosting. # Possible values include: 'Shared', 'Dedicated' attr_accessor :compute_mode # @return [String] VM size of the worker pool instances attr_accessor :worker_size # @return [Integer] Number of instances in the worker pool attr_accessor :worker_count # @return [Array] Names of all instances in the worker pool # (read only) attr_accessor :instance_names # # Validate the object. Throws ValidationError if validation fails. # def validate @instance_names.each{ |e| e.validate if e.respond_to?(:validate) } unless @instance_names.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.worker_size_id output_object['workerSizeId'] = serialized_property unless serialized_property.nil? serialized_property = object.compute_mode output_object['computeMode'] = serialized_property unless serialized_property.nil? serialized_property = object.worker_size output_object['workerSize'] = serialized_property unless serialized_property.nil? serialized_property = object.worker_count output_object['workerCount'] = serialized_property unless serialized_property.nil? serialized_property = object.instance_names output_object['instanceNames'] = 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 [WorkerPoolProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = WorkerPoolProperties.new deserialized_property = object['workerSizeId'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.worker_size_id = deserialized_property deserialized_property = object['computeMode'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ComputeModeOptions.constants.any? { |e| ComputeModeOptions.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ComputeModeOptions does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.compute_mode = deserialized_property deserialized_property = object['workerSize'] output_object.worker_size = deserialized_property deserialized_property = object['workerCount'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.worker_count = deserialized_property deserialized_property = object['instanceNames'] output_object.instance_names = deserialized_property output_object end end end end