Class: WhatsAppCloudApi::GetPhoneNumberByIDResponse

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

Overview

GetPhoneNumberByIDResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(verified_name = nil, display_phone_number = nil, id = nil, quality_rating = nil) ⇒ GetPhoneNumberByIDResponse

Returns a new instance of GetPhoneNumberByIDResponse.



49
50
51
52
53
54
55
56
57
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 49

def initialize(verified_name = nil,
               display_phone_number = nil,
               id = nil,
               quality_rating = nil)
  @verified_name = verified_name unless verified_name == SKIP
  @display_phone_number = display_phone_number unless display_phone_number == SKIP
  @id = id unless id == SKIP
  @quality_rating = quality_rating unless quality_rating == SKIP
end

Instance Attribute Details

#display_phone_numberString

The string representation of the phone number.

Returns:

  • (String)


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

def display_phone_number
  @display_phone_number
end

#idString

The ID associated with the phone number.

Returns:

  • (String)


22
23
24
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 22

def id
  @id
end

#quality_ratingQualityRatingEnum

The quality rating of the phone number based on how messages have been received by recipients in recent days.

Returns:



27
28
29
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 27

def quality_rating
  @quality_rating
end

#verified_nameString

The verified name associated with the phone number.

Returns:

  • (String)


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

def verified_name
  @verified_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 60

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  verified_name = hash.key?('verified_name') ? hash['verified_name'] : SKIP
  display_phone_number =
    hash.key?('display_phone_number') ? hash['display_phone_number'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  quality_rating =
    hash.key?('quality_rating') ? hash['quality_rating'] : SKIP

  # Create object from extracted values.
  GetPhoneNumberByIDResponse.new(verified_name,
                                 display_phone_number,
                                 id,
                                 quality_rating)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['verified_name'] = 'verified_name'
  @_hash['display_phone_number'] = 'display_phone_number'
  @_hash['id'] = 'id'
  @_hash['quality_rating'] = 'quality_rating'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



45
46
47
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 45

def nullables
  []
end

#optionalsObject

An array for optional fields



40
41
42
# File 'lib/whats_app_cloud_api/models/get_phone_number_by_id_response.rb', line 40

def optionals
  []
end