# 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 # # Class containing stamp capacity information # class StampCapacity include MsRestAzure # @return [String] Name of the stamp attr_accessor :name # @return [Integer] Available capacity (# of machines, bytes of storage # etc...) attr_accessor :available_capacity # @return [Integer] Total capacity (# of machines, bytes of storage # etc...) attr_accessor :total_capacity # @return [String] Name of the unit attr_accessor :unit # @return [ComputeModeOptions] Shared/Dedicated workers. Possible values # include: 'Shared', 'Dedicated' attr_accessor :compute_mode # @return [WorkerSizeOptions] Size of the machines. Possible values # include: 'Default', 'Small', 'Medium', 'Large' attr_accessor :worker_size # @return [Integer] Size Id of machines: # 0 - Small # 1 - Medium # 2 - Large attr_accessor :worker_size_id # @return [Boolean] If true it includes basic sites # Basic sites are not used for capacity allocation. attr_accessor :exclude_from_capacity_allocation # @return [Boolean] Is capacity applicable for all sites? attr_accessor :is_applicable_for_all_compute_modes # @return [String] Shared or Dedicated attr_accessor :site_mode # # Validate the object. Throws ValidationError if validation fails. # def validate 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.available_capacity output_object['availableCapacity'] = serialized_property unless serialized_property.nil? serialized_property = object.total_capacity output_object['totalCapacity'] = serialized_property unless serialized_property.nil? serialized_property = object.unit output_object['unit'] = 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_size_id output_object['workerSizeId'] = serialized_property unless serialized_property.nil? serialized_property = object.exclude_from_capacity_allocation output_object['excludeFromCapacityAllocation'] = serialized_property unless serialized_property.nil? serialized_property = object.is_applicable_for_all_compute_modes output_object['isApplicableForAllComputeModes'] = serialized_property unless serialized_property.nil? serialized_property = object.site_mode output_object['siteMode'] = 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 [StampCapacity] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = StampCapacity.new deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['availableCapacity'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.available_capacity = deserialized_property deserialized_property = object['totalCapacity'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.total_capacity = deserialized_property deserialized_property = object['unit'] output_object.unit = 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'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = WorkerSizeOptions.constants.any? { |e| WorkerSizeOptions.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum WorkerSizeOptions does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.worker_size = deserialized_property 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['excludeFromCapacityAllocation'] output_object.exclude_from_capacity_allocation = deserialized_property deserialized_property = object['isApplicableForAllComputeModes'] output_object.is_applicable_for_all_compute_modes = deserialized_property deserialized_property = object['siteMode'] output_object.site_mode = deserialized_property output_object end end end end