Class: WhatsAppCloudApi::SendMessageResponse
- Defined in:
- lib/whats_app_cloud_api/models/send_message_response.rb
Overview
SendMessageResponse Model.
Instance Attribute Summary collapse
-
#contacts ⇒ List of ResponseContact
TODO: Write general description for this method.
-
#messages ⇒ List of ResponseMessage
TODO: Write general description for this method.
-
#messaging_product ⇒ 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(messaging_product = nil, contacts = nil, messages = nil) ⇒ SendMessageResponse
constructor
A new instance of SendMessageResponse.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(messaging_product = nil, contacts = nil, messages = nil) ⇒ SendMessageResponse
Returns a new instance of SendMessageResponse.
43 44 45 46 47 48 49 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 43 def initialize(messaging_product = nil, contacts = nil, = nil) @messaging_product = messaging_product unless messaging_product == SKIP @contacts = contacts unless contacts == SKIP @messages = unless == SKIP end |
Instance Attribute Details
#contacts ⇒ List of ResponseContact
TODO: Write general description for this method
18 19 20 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 18 def contacts @contacts end |
#messages ⇒ List of ResponseMessage
TODO: Write general description for this method
22 23 24 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 22 def @messages end |
#messaging_product ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 14 def messaging_product @messaging_product end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 80 81 82 83 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. messaging_product = hash.key?('messaging_product') ? hash['messaging_product'] : SKIP # Parameter is an array, so we need to iterate through it contacts = nil unless hash['contacts'].nil? contacts = [] hash['contacts'].each do |structure| contacts << (ResponseContact.from_hash(structure) if structure) end end contacts = SKIP unless hash.key?('contacts') # Parameter is an array, so we need to iterate through it = nil unless hash['messages'].nil? = [] hash['messages'].each do |structure| << (ResponseMessage.from_hash(structure) if structure) end end = SKIP unless hash.key?('messages') # Create object from extracted values. SendMessageResponse.new(messaging_product, contacts, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['messaging_product'] = 'messaging_product' @_hash['contacts'] = 'contacts' @_hash['messages'] = 'messages' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 39 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/whats_app_cloud_api/models/send_message_response.rb', line 34 def optionals [] end |