# 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::Scheduler module Models # # Model object. # class ServiceBusQueueMessage < ServiceBusMessage include MsRestAzure # @return [String] Gets or sets the queue name. attr_accessor :queue_name # # Validate the object. Throws ValidationError if validation fails. # def validate # Nothing to 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.authentication unless serialized_property.nil? serialized_property = ServiceBusAuthentication.serialize_object(serialized_property) end output_object['authentication'] = serialized_property unless serialized_property.nil? serialized_property = object.brokered_message_properties unless serialized_property.nil? serialized_property = ServiceBusBrokeredMessageProperties.serialize_object(serialized_property) end output_object['brokeredMessageProperties'] = serialized_property unless serialized_property.nil? serialized_property = object.custom_message_properties output_object['customMessageProperties'] = serialized_property unless serialized_property.nil? serialized_property = object.message output_object['message'] = serialized_property unless serialized_property.nil? serialized_property = object.namespace output_object['namespace'] = serialized_property unless serialized_property.nil? serialized_property = object.transport_type output_object['transportType'] = serialized_property unless serialized_property.nil? serialized_property = object.queue_name output_object['queueName'] = 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 [ServiceBusQueueMessage] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = ServiceBusQueueMessage.new deserialized_property = object['authentication'] unless deserialized_property.nil? deserialized_property = ServiceBusAuthentication.deserialize_object(deserialized_property) end output_object.authentication = deserialized_property deserialized_property = object['brokeredMessageProperties'] unless deserialized_property.nil? deserialized_property = ServiceBusBrokeredMessageProperties.deserialize_object(deserialized_property) end output_object.brokered_message_properties = deserialized_property deserialized_property = object['customMessageProperties'] output_object.custom_message_properties = deserialized_property deserialized_property = object['message'] output_object.message = deserialized_property deserialized_property = object['namespace'] output_object.namespace = deserialized_property deserialized_property = object['transportType'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ServiceBusTransportType.constants.any? { |e| ServiceBusTransportType.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ServiceBusTransportType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.transport_type = deserialized_property deserialized_property = object['queueName'] output_object.queue_name = deserialized_property output_object end end end end