Class: WhatsAppCloudApi::RequestVerificationCodeRequest

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

Overview

RequestVerificationCodeRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(code_method = nil, locale = nil) ⇒ RequestVerificationCodeRequest

Returns a new instance of RequestVerificationCodeRequest.



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

def initialize(code_method = nil,
               locale = nil)
  @code_method = code_method unless code_method == SKIP
  @locale = locale unless locale == SKIP
end

Instance Attribute Details

#code_methodRequestVerificationCodeMethodEnum

Chosen method for verification.



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

def code_method
  @code_method
end

#localeString

Your locale. For example: “en_US”.

Returns:

  • (String)


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

def locale
  @locale
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/request_verification_code_request.rb', line 45

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  code_method = hash.key?('code_method') ? hash['code_method'] : SKIP
  locale = hash.key?('locale') ? hash['locale'] : SKIP

  # Create object from extracted values.

  RequestVerificationCodeRequest.new(code_method,
                                     locale)
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/request_verification_code_request.rb', line 21

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

Instance Method Details

#nullablesObject

An array for nullable fields



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

def nullables
  []
end

#optionalsObject

An array for optional fields



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

def optionals
  []
end