Class: Bandwidth::TwoFactorVerifyRequestSchema
- Defined in:
- lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb
Overview
TwoFactorVerifyRequestSchema Model.
Instance Attribute Summary collapse
-
#application_id ⇒ String
The application unique ID, obtained from Bandwidth.
-
#code ⇒ String
The generated 2fa code to check if valid.
-
#digits ⇒ Float
The number of digits for your 2fa code.
-
#expiration_time_in_minutes ⇒ Float
The time period, in minutes, to validate the 2fa code.
-
#from ⇒ String
The application phone number, the sender of the 2fa code.
-
#scope ⇒ String
An optional field to denote what scope or action the 2fa code is addressing.
-
#to ⇒ String
The phone number to send the 2fa code to.
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(to = nil, from = nil, application_id = nil, digits = nil, expiration_time_in_minutes = nil, code = nil, scope = nil) ⇒ TwoFactorVerifyRequestSchema
constructor
A new instance of TwoFactorVerifyRequestSchema.
Methods inherited from BaseModel
Constructor Details
#initialize(to = nil, from = nil, application_id = nil, digits = nil, expiration_time_in_minutes = nil, code = nil, scope = nil) ⇒ TwoFactorVerifyRequestSchema
Returns a new instance of TwoFactorVerifyRequestSchema.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 55 def initialize(to = nil, from = nil, application_id = nil, digits = nil, expiration_time_in_minutes = nil, code = nil, scope = nil) @to = to @from = from @application_id = application_id @scope = scope @digits = digits @expiration_time_in_minutes = expiration_time_in_minutes @code = code end |
Instance Attribute Details
#application_id ⇒ String
The application unique ID, obtained from Bandwidth.
19 20 21 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 19 def application_id @application_id end |
#code ⇒ String
The generated 2fa code to check if valid
40 41 42 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 40 def code @code end |
#digits ⇒ Float
The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively.
29 30 31 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 29 def digits @digits end |
#expiration_time_in_minutes ⇒ Float
The time period, in minutes, to validate the 2fa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively.
36 37 38 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 36 def expiration_time_in_minutes @expiration_time_in_minutes end |
#from ⇒ String
The application phone number, the sender of the 2fa code.
15 16 17 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 15 def from @from end |
#scope ⇒ String
An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to “2FA”.
24 25 26 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 24 def scope @scope end |
#to ⇒ String
The phone number to send the 2fa code to.
11 12 13 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 11 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. to = hash['to'] from = hash['from'] application_id = hash['applicationId'] digits = hash['digits'] expiration_time_in_minutes = hash['expirationTimeInMinutes'] code = hash['code'] scope = hash['scope'] # Create object from extracted values. TwoFactorVerifyRequestSchema.new(to, from, application_id, digits, expiration_time_in_minutes, code, scope) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['application_id'] = 'applicationId' @_hash['scope'] = 'scope' @_hash['digits'] = 'digits' @_hash['expiration_time_in_minutes'] = 'expirationTimeInMinutes' @_hash['code'] = 'code' @_hash end |