class Bandwidth::BandwidthMessageItem
BandwidthMessageItem
Model.
Attributes
The account id of the message @return [String]
The number of attachments the message has @return [Integer]
The campaign class of the message, if it has one @return [String]
The name of the carrier. Not currently supported for MMS, coming soon @return [String]
The recipient phone number of the message @return [String]
The numeric error code of the message @return [Integer]
The direction of the message relative to Bandwidth
. INBOUND or OUTBOUND @return [String]
The message id @return [String]
The length of the message content @return [Integer]
The size of the message including message content and headers @return [Integer]
The status of the message @return [String]
The type of message. sms or mms @return [String]
The ISO 8601 datetime of the message @return [String]
The number of recipients the message has @return [Integer]
The number of segments the message was sent as @return [Integer]
The source phone number of the message @return [String]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb, line 130 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. message_id = hash['messageId'] account_id = hash['accountId'] source_tn = hash['sourceTn'] destination_tn = hash['destinationTn'] message_status = hash['messageStatus'] message_direction = hash['messageDirection'] message_type = hash['messageType'] segment_count = hash['segmentCount'] error_code = hash['errorCode'] receive_time = hash['receiveTime'] carrier_name = hash['carrierName'] message_size = hash['messageSize'] message_length = hash['messageLength'] attachment_count = hash['attachmentCount'] recipient_count = hash['recipientCount'] campaign_class = hash['campaignClass'] # Create object from extracted values. BandwidthMessageItem.new(message_id, account_id, source_tn, destination_tn, message_status, message_direction, message_type, segment_count, error_code, receive_time, carrier_name, message_size, message_length, attachment_count, recipient_count, campaign_class) end
A mapping from model property names to API property names.
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb, line 74 def self.names @_hash = {} if @_hash.nil? @_hash['message_id'] = 'messageId' @_hash['account_id'] = 'accountId' @_hash['source_tn'] = 'sourceTn' @_hash['destination_tn'] = 'destinationTn' @_hash['message_status'] = 'messageStatus' @_hash['message_direction'] = 'messageDirection' @_hash['message_type'] = 'messageType' @_hash['segment_count'] = 'segmentCount' @_hash['error_code'] = 'errorCode' @_hash['receive_time'] = 'receiveTime' @_hash['carrier_name'] = 'carrierName' @_hash['message_size'] = 'messageSize' @_hash['message_length'] = 'messageLength' @_hash['attachment_count'] = 'attachmentCount' @_hash['recipient_count'] = 'recipientCount' @_hash['campaign_class'] = 'campaignClass' @_hash end
# File lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb, line 95 def initialize(message_id = nil, account_id = nil, source_tn = nil, destination_tn = nil, message_status = nil, message_direction = nil, message_type = nil, segment_count = nil, error_code = nil, receive_time = nil, carrier_name = nil, message_size = nil, message_length = nil, attachment_count = nil, recipient_count = nil, campaign_class = nil) @message_id = message_id @account_id = account_id @source_tn = source_tn @destination_tn = destination_tn @message_status = message_status @message_direction = message_direction @message_type = message_type @segment_count = segment_count @error_code = error_code @receive_time = receive_time @carrier_name = carrier_name @message_size = message_size @message_length = message_length @attachment_count = attachment_count @recipient_count = recipient_count @campaign_class = campaign_class end