class Bandwidth::BandwidthMessage
BandwidthMessage
Model.
Attributes
The application ID associated with the message @return [String]
The direction of the message relative to Bandwidth
. Can be in or out @return [String]
The phone number the message was sent from @return [String]
The id of the message @return [String]
The list of media URLs sent in the message @return [List of String]
The Bandwidth
phone number associated with the message @return [String]
The priority specified by the user @return [String]
The number of segments the original message from the user is broken into before sending over to carrier networks @return [Integer]
The custom string set by the user @return [String]
The contents of the message @return [String]
The datetime stamp of the message in ISO 8601 @return [String]
The phone number recipients of the message @return [List of String]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb, line 103 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash['id'] owner = hash['owner'] application_id = hash['applicationId'] time = hash['time'] segment_count = hash['segmentCount'] direction = hash['direction'] to = hash['to'] from = hash['from'] media = hash['media'] text = hash['text'] tag = hash['tag'] priority = hash['priority'] # Create object from extracted values. BandwidthMessage.new(id, owner, application_id, time, segment_count, direction, to, from, media, text, tag, priority) end
A mapping from model property names to API property names.
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb, line 59 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['owner'] = 'owner' @_hash['application_id'] = 'applicationId' @_hash['time'] = 'time' @_hash['segment_count'] = 'segmentCount' @_hash['direction'] = 'direction' @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['media'] = 'media' @_hash['text'] = 'text' @_hash['tag'] = 'tag' @_hash['priority'] = 'priority' @_hash end
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb, line 76 def initialize(id = nil, owner = nil, application_id = nil, time = nil, segment_count = nil, direction = nil, to = nil, from = nil, media = nil, text = nil, tag = nil, priority = nil) @id = id @owner = owner @application_id = application_id @time = time @segment_count = segment_count @direction = direction @to = to @from = from @media = media @text = text @tag = tag @priority = priority end