class Twilio::REST::Verify::V2::ServiceContext::EntityContext::ChallengeContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, service_sid, identity, sid) click to toggle source

Initialize the ChallengeContext @param [Version] version Version that contains the resource @param [String] service_sid The unique SID identifier of the Service. @param [String] identity Customer unique identity for the Entity owner of the

Challenges. This identifier should be immutable, not PII, length between 8 and
64 characters, and generated by your external system, such as your user's UUID,
GUID, or SID. It can only contain dash (-) separated alphanumeric characters.

@param [String] sid A 34 character string that uniquely identifies this

Challenge.

@return [ChallengeContext] ChallengeContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
248 def initialize(version, service_sid, identity, sid)
249   super(version)
250 
251   # Path Solution
252   @solution = {service_sid: service_sid, identity: identity, sid: sid, }
253   @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:sid]}"
254 
255   # Dependents
256   @notifications = nil
257 end

Public Instance Methods

fetch() click to toggle source

Fetch the ChallengeInstance @return [ChallengeInstance] Fetched ChallengeInstance

    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
262 def fetch
263   payload = @version.fetch('GET', @uri)
264 
265   ChallengeInstance.new(
266       @version,
267       payload,
268       service_sid: @solution[:service_sid],
269       identity: @solution[:identity],
270       sid: @solution[:sid],
271   )
272 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
321 def inspect
322   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
323   "#<Twilio.Verify.V2.ChallengeContext #{context}>"
324 end
notifications() click to toggle source

Access the notifications @return [NotificationList] @return [NotificationContext]

    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
299 def notifications
300   unless @notifications
301     @notifications = NotificationList.new(
302         @version,
303         service_sid: @solution[:service_sid],
304         identity: @solution[:identity],
305         challenge_sid: @solution[:sid],
306     )
307   end
308 
309   @notifications
310 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
314 def to_s
315   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
316   "#<Twilio.Verify.V2.ChallengeContext #{context}>"
317 end
update(auth_payload: :unset) click to toggle source

Update the ChallengeInstance @param [String] auth_payload The optional payload needed to verify the

Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must
be between 3 and 8 characters long. For `Push` this value can be up to 5456
characters in length

@return [ChallengeInstance] Updated ChallengeInstance

    # File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
281 def update(auth_payload: :unset)
282   data = Twilio::Values.of({'AuthPayload' => auth_payload, })
283 
284   payload = @version.update('POST', @uri, data: data)
285 
286   ChallengeInstance.new(
287       @version,
288       payload,
289       service_sid: @solution[:service_sid],
290       identity: @solution[:identity],
291       sid: @solution[:sid],
292   )
293 end