Class: Bandwidth::TwoFactorCodeRequestSchema
- Defined in:
- lib/bandwidth/two_factor_auth_lib/two_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.
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.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb', line 53 def initialize(to = nil, from = nil, application_id = nil, = nil, digits = nil, scope = nil) @to = to @from = from @application_id = application_id @scope = scope @message = @digits = digits 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_code_request_schema.rb', line 19 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.
39 40 41 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb', line 39 def digits @digits 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_code_request_schema.rb', line 15 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.
34 35 36 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb', line 34 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”.
24 25 26 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_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_code_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.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. to = hash['to'] from = hash['from'] application_id = hash['applicationId'] = hash['message'] digits = hash['digits'] scope = hash['scope'] # 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.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb', line 42 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 |