Class: Twilio::REST::Verify::V2::ServiceContext::NewChallengeContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid) ⇒ NewChallengeContext

Initialize the NewChallengeContext



68
69
70
71
72
73
74
75
76
# File 'lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb', line 68

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



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb', line 81

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

#inspectObject

Provide a detailed, user friendly representation



108
109
110
111
# File 'lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb', line 108

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Verify.V2.NewChallengeContext #{context}>"
end

#to_sObject

Provide a user friendly representation



101
102
103
104
# File 'lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb', line 101

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Verify.V2.NewChallengeContext #{context}>"
end