Class: WhatsAppCloudApi::RegisterPhoneRequest
- Defined in:
- lib/whats_app_cloud_api/models/register_phone_request.rb
Overview
RegisterPhoneRequest Model.
Instance Attribute Summary collapse
-
#messaging_product ⇒ String
Messaging service used.
-
#pin ⇒ String
A 6-digit pin you have previously set up - See Set Two-Step Verification.
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, pin = nil) ⇒ RegisterPhoneRequest
constructor
A new instance of RegisterPhoneRequest.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(messaging_product = nil, pin = nil) ⇒ RegisterPhoneRequest
Returns a new instance of RegisterPhoneRequest.
38 39 40 41 42 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 38 def initialize(messaging_product = nil, pin = nil) @messaging_product = messaging_product unless messaging_product == SKIP @pin = pin unless pin == SKIP end |
Instance Attribute Details
#messaging_product ⇒ String
Messaging service used. In this case, use “whatsapp”.
14 15 16 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 14 def messaging_product @messaging_product end |
#pin ⇒ String
A 6-digit pin you have previously set up - See Set Two-Step Verification.
18 19 20 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 18 def pin @pin 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 56 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 45 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. messaging_product = hash.key?('messaging_product') ? hash['messaging_product'] : SKIP pin = hash.key?('pin') ? hash['pin'] : SKIP # Create object from extracted values. RegisterPhoneRequest.new(messaging_product, pin) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['messaging_product'] = 'messaging_product' @_hash['pin'] = 'pin' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
34 35 36 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 34 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
29 30 31 |
# File 'lib/whats_app_cloud_api/models/register_phone_request.rb', line 29 def optionals [] end |