Class: WhatsAppCloudApi::ResponseContact

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/whats_app_cloud_api/models/response_contact.rb

Overview

ResponseContact Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(input = nil, wa_id = nil) ⇒ ResponseContact

Returns a new instance of ResponseContact.



38
39
40
41
42
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 38

def initialize(input = nil,
               wa_id = nil)
  @input = input unless input == SKIP
  @wa_id = wa_id unless wa_id == SKIP
end

Instance Attribute Details

#inputString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 14

def input
  @input
end

#wa_idString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 18

def wa_id
  @wa_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 45

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  input = hash.key?('input') ? hash['input'] : SKIP
  wa_id = hash.key?('wa_id') ? hash['wa_id'] : SKIP

  # Create object from extracted values.
  ResponseContact.new(input,
                      wa_id)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['input'] = 'input'
  @_hash['wa_id'] = 'wa_id'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



34
35
36
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 34

def nullables
  []
end

#optionalsObject

An array for optional fields



29
30
31
# File 'lib/whats_app_cloud_api/models/response_contact.rb', line 29

def optionals
  []
end