Class: Bandwidth::BandwidthCallbackMessage
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
Overview
BandwidthCallbackMessage Model.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#error_code ⇒ String
TODO: Write general description for this method.
-
#message ⇒ BandwidthMessage
TODO: Write general description for this method.
-
#time ⇒ String
TODO: Write general description for this method.
-
#to ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(time = nil, type = nil, to = nil, error_code = nil, description = nil, message = nil) ⇒ BandwidthCallbackMessage
constructor
A new instance of BandwidthCallbackMessage.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(time = nil, type = nil, to = nil, error_code = nil, description = nil, message = nil) ⇒ BandwidthCallbackMessage
Returns a new instance of BandwidthCallbackMessage.
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 65 def initialize(time = nil, type = nil, to = nil, error_code = nil, description = nil, = nil) @time = time unless time == SKIP @type = type unless type == SKIP @to = to unless to == SKIP @error_code = error_code unless error_code == SKIP @description = description unless description == SKIP @message = unless == SKIP end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 30 def description @description end |
#error_code ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 26 def error_code @error_code end |
#message ⇒ BandwidthMessage
TODO: Write general description for this method
34 35 36 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 34 def @message end |
#time ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 14 def time @time end |
#to ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 22 def to @to end |
#type ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 18 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. time = hash.key?('time') ? hash['time'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP to = hash.key?('to') ? hash['to'] : SKIP error_code = hash.key?('errorCode') ? hash['errorCode'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP = BandwidthMessage.from_hash(hash['message']) if hash['message'] # Create object from extracted values. BandwidthCallbackMessage.new(time, type, to, error_code, description, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['time'] = 'time' @_hash['type'] = 'type' @_hash['to'] = 'to' @_hash['error_code'] = 'errorCode' @_hash['description'] = 'description' @_hash['message'] = 'message' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 61 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 49 def optionals %w[ time type to error_code description message ] end |