Class: Bandwidth::TwoFactorCodeRequestSchema
- Defined in:
- lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb
Overview
TwoFactorCodeRequestSchema Model.
Instance Attribute Summary collapse
-
#application_id ⇒ String
The application unique ID, obtained from Bandwidth.
-
#digits ⇒ Float
The number of digits for your 2fa code.
-
#from ⇒ String
The application phone number, the sender of the 2fa code.
-
#message ⇒ String
The message format 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, message = nil, digits = nil, scope = nil) ⇒ TwoFactorCodeRequestSchema
constructor
A new instance of TwoFactorCodeRequestSchema.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(to = nil, from = nil, application_id = nil, message = nil, digits = nil, scope = nil) ⇒ TwoFactorCodeRequestSchema
Returns a new instance of TwoFactorCodeRequestSchema.
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 68 def initialize(to = nil, from = nil, application_id = nil, = nil, digits = nil, scope = nil) @to = to unless to == SKIP @from = from unless from == SKIP @application_id = application_id unless application_id == SKIP @scope = scope unless scope == SKIP @message = unless == SKIP @digits = digits unless digits == SKIP end |
Instance Attribute Details
#application_id ⇒ String
The application unique ID, obtained from Bandwidth.
22 23 24 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 22 def application_id @application_id end |
#digits ⇒ Float
The number of digits for your 2fa code. The valid number ranges from 2 to 8, inclusively.
42 43 44 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 42 def digits @digits end |
#from ⇒ String
The application phone number, the sender of the 2fa code.
18 19 20 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 18 def from @from end |
#message ⇒ String
The message format of the 2fa code. There are three values that the system will replace “CODE”, “NAME”, “SCOPE”. The “SCOPE” and “NAME value template are optional, while ”CODE“ must be supplied. As the name would suggest, code will be replace with the actual 2fa code. Name is replaced with the application name, configured during provisioning of 2fa. The scope value is the same value sent during the call and partitioned by the server.
37 38 39 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 37 def @message end |
#scope ⇒ String
An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to “2FA”.
27 28 29 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 27 def scope @scope end |
#to ⇒ String
The phone number to send the 2fa code to.
14 15 16 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 14 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. to = hash.key?('to') ? hash['to'] : SKIP from = hash.key?('from') ? hash['from'] : SKIP application_id = hash.key?('applicationId') ? hash['applicationId'] : SKIP = hash.key?('message') ? hash['message'] : SKIP digits = hash.key?('digits') ? hash['digits'] : SKIP scope = hash.key?('scope') ? hash['scope'] : SKIP # Create object from extracted values. TwoFactorCodeRequestSchema.new(to, from, application_id, , digits, scope) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['application_id'] = 'applicationId' @_hash['scope'] = 'scope' @_hash['message'] = 'message' @_hash['digits'] = 'digits' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 64 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
57 58 59 60 61 |
# File 'lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_code_request_schema.rb', line 57 def optionals %w[ scope ] end |