lib/artikcloud/models/message_out.rb in artikcloud-2.1.1 vs lib/artikcloud/models/message_out.rb in artikcloud-2.2.2
- old
+ new
@@ -12,10 +12,28 @@
require 'date'
module ArtikCloud
# Message received by a WebSocket.
class MessageOut
+ # Message Payload.
+ attr_accessor :data
+
+ # Confirmation ID.
+ attr_accessor :cid
+
+ # Destination Device ID.
+ attr_accessor :ddid
+
+ # Source Device ID.
+ attr_accessor :sdid
+
+ # Timestamp (past, present or future). Defaults to current time if not provided.
+ attr_accessor :ts
+
+ # Type.
+ attr_accessor :type
+
# Message ID.
attr_accessor :mid
# User ID.
attr_accessor :uid
@@ -31,10 +49,16 @@
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
+ :'data' => :'data',
+ :'cid' => :'cid',
+ :'ddid' => :'ddid',
+ :'sdid' => :'sdid',
+ :'ts' => :'ts',
+ :'type' => :'type',
:'mid' => :'mid',
:'uid' => :'uid',
:'sdtid' => :'sdtid',
:'cts' => :'cts',
:'mv' => :'mv'
@@ -42,10 +66,16 @@
end
# Attribute type mapping.
def self.swagger_types
{
+ :'data' => :'Hash<String, Object>',
+ :'cid' => :'String',
+ :'ddid' => :'String',
+ :'sdid' => :'String',
+ :'ts' => :'Integer',
+ :'type' => :'String',
:'mid' => :'String',
:'uid' => :'String',
:'sdtid' => :'String',
:'cts' => :'Integer',
:'mv' => :'Integer'
@@ -58,10 +88,38 @@
return unless attributes.is_a?(Hash)
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
+ if attributes.has_key?(:'data')
+ if (value = attributes[:'data']).is_a?(Array)
+ self.data = value
+ end
+ end
+
+ if attributes.has_key?(:'cid')
+ self.cid = attributes[:'cid']
+ end
+
+ if attributes.has_key?(:'ddid')
+ self.ddid = attributes[:'ddid']
+ end
+
+ if attributes.has_key?(:'sdid')
+ self.sdid = attributes[:'sdid']
+ end
+
+ if attributes.has_key?(:'ts')
+ self.ts = attributes[:'ts']
+ end
+
+ if attributes.has_key?(:'type')
+ self.type = attributes[:'type']
+ else
+ self.type = "message"
+ end
+
if attributes.has_key?(:'mid')
self.mid = attributes[:'mid']
end
if attributes.has_key?(:'uid')
@@ -98,10 +156,16 @@
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
+ data == o.data &&
+ cid == o.cid &&
+ ddid == o.ddid &&
+ sdid == o.sdid &&
+ ts == o.ts &&
+ type == o.type &&
mid == o.mid &&
uid == o.uid &&
sdtid == o.sdtid &&
cts == o.cts &&
mv == o.mv
@@ -114,10 +178,10 @@
end
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
- [mid, uid, sdtid, cts, mv].hash
+ [data, cid, ddid, sdid, ts, type, mid, uid, sdtid, cts, mv].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself