Class: Twilio::REST::Verify::V2::NewChallengeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::NewChallengeContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/new_challenge.rb
Instance Method Summary collapse
-
#create(create_passkeys_challenge_request: nil) ⇒ NewChallengeInstance
Create the NewChallengeInstance.
-
#initialize(version, service_sid) ⇒ NewChallengeContext
constructor
Initialize the NewChallengeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid) ⇒ NewChallengeContext
Initialize the NewChallengeContext
66 67 68 69 70 71 72 73 74 |
# File 'lib/twilio-ruby/rest/verify/v2/new_challenge.rb', line 66 def initialize(version, service_sid) super(version) # Path Solution @solution = { service_sid: service_sid, } @uri = "/Services/#{@solution[:service_sid]}/Passkeys/Challenges" end |
Instance Method Details
#create(create_passkeys_challenge_request: nil) ⇒ NewChallengeInstance
Create the NewChallengeInstance
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/twilio-ruby/rest/verify/v2/new_challenge.rb', line 79 def create(create_passkeys_challenge_request: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.create('POST', @uri, headers: headers, data: create_passkeys_challenge_request.to_json) NewChallengeInstance.new( @version, payload, service_sid: @solution[:service_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
106 107 108 109 |
# File 'lib/twilio-ruby/rest/verify/v2/new_challenge.rb', line 106 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.NewChallengeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
99 100 101 102 |
# File 'lib/twilio-ruby/rest/verify/v2/new_challenge.rb', line 99 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.NewChallengeContext #{context}>" end |