Class: Azure::ARM::Scheduler::Models::ServiceBusMessage

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_scheduler/models/service_bus_message.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authenticationServiceBusAuthentication

Returns Gets or sets the authentication.

Returns:



16
17
18
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 16

def authentication
  @authentication
end

#brokered_message_propertiesServiceBusBrokeredMessageProperties

brokered message properties.

Returns:



20
21
22
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 20

def brokered_message_properties
  @brokered_message_properties
end

#custom_message_propertiesHash{String => String}

properties.

Returns:

  • (Hash{String => String})

    Gets or sets the custom message



24
25
26
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 24

def custom_message_properties
  @custom_message_properties
end

#messageString

Returns Gets or sets the message.

Returns:

  • (String)

    Gets or sets the message.



27
28
29
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 27

def message
  @message
end

#namespaceString

Returns Gets or sets the namespace.

Returns:

  • (String)

    Gets or sets the namespace.



30
31
32
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 30

def namespace
  @namespace
end

#transport_typeServiceBusTransportType

Possible values include: ‘NotSpecified’, ‘NetMessaging’, ‘AMQP’

Returns:



34
35
36
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 34

def transport_type
  @transport_type
end

Class Method Details

.deserialize_object(object) ⇒ ServiceBusMessage

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 86

def self.deserialize_object(object)
  return if object.nil?
  output_object = ServiceBusMessage.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

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 50

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?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



39
40
41
42
43
# File 'lib/azure_mgmt_scheduler/models/service_bus_message.rb', line 39

def validate
  @authentication.validate unless @authentication.nil?
  @brokered_message_properties.validate unless @brokered_message_properties.nil?
  @custom_message_properties.each{ |e| e.validate if e.respond_to?(:validate) } unless @custom_message_properties.nil?
end