class Bandwidth::TwoFactorVerifyRequestSchema

TwoFactorVerifyRequestSchema Model.

Attributes

application_id[RW]

The application unique ID, obtained from Bandwidth. @return [String]

code[RW]

The generated 2fa code to check if valid @return [String]

expiration_time_in_minutes[RW]

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. @return [Float]

scope[RW]

An optional field to denote what scope or action the 2fa code is addressing. If not supplied, defaults to “2FA”. @return [String]

to[RW]

The phone number to send the 2fa code to. @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb, line 57
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  to = hash['to']
  application_id = hash['applicationId']
  expiration_time_in_minutes = hash['expirationTimeInMinutes']
  code = hash['code']
  scope = hash['scope']

  # Create object from extracted values.
  TwoFactorVerifyRequestSchema.new(to,
                                   application_id,
                                   expiration_time_in_minutes,
                                   code,
                                   scope)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb, line 34
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['to'] = 'to'
  @_hash['application_id'] = 'applicationId'
  @_hash['scope'] = 'scope'
  @_hash['expiration_time_in_minutes'] = 'expirationTimeInMinutes'
  @_hash['code'] = 'code'
  @_hash
end
new(to = nil, application_id = nil, expiration_time_in_minutes = nil, code = nil, scope = nil) click to toggle source
# File lib/bandwidth/multi_factor_auth_lib/multi_factor_auth/models/two_factor_verify_request_schema.rb, line 44
def initialize(to = nil,
               application_id = nil,
               expiration_time_in_minutes = nil,
               code = nil,
               scope = nil)
  @to = to
  @application_id = application_id
  @scope = scope
  @expiration_time_in_minutes = expiration_time_in_minutes
  @code = code
end