class Twilio::REST::Verify::V2::ServiceContext::EntityContext::ChallengeInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the ChallengeInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The unique SID identifier of the Service. @param [String] identity Customer unique identity for the Entity owner of the
Challenge. 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 [ChallengeInstance] ChallengeInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 342 def initialize(version, payload, service_sid: nil, identity: nil, sid: nil) 343 super(version) 344 345 # Marshaled Properties 346 @properties = { 347 'sid' => payload['sid'], 348 'account_sid' => payload['account_sid'], 349 'service_sid' => payload['service_sid'], 350 'entity_sid' => payload['entity_sid'], 351 'identity' => payload['identity'], 352 'factor_sid' => payload['factor_sid'], 353 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 354 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 355 'date_responded' => Twilio.deserialize_iso8601_datetime(payload['date_responded']), 356 'expiration_date' => Twilio.deserialize_iso8601_datetime(payload['expiration_date']), 357 'status' => payload['status'], 358 'responded_reason' => payload['responded_reason'], 359 'details' => payload['details'], 360 'hidden_details' => payload['hidden_details'], 361 'factor_type' => payload['factor_type'], 362 'url' => payload['url'], 363 'links' => payload['links'], 364 } 365 366 # Context 367 @instance_context = nil 368 @params = {'service_sid' => service_sid, 'identity' => identity, 'sid' => sid || @properties['sid'], } 369 end
Public Instance Methods
@return [String] Account Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 395 def account_sid 396 @properties['account_sid'] 397 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ChallengeContext] ChallengeContext
for this ChallengeInstance
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 375 def context 376 unless @instance_context 377 @instance_context = ChallengeContext.new( 378 @version, 379 @params['service_sid'], 380 @params['identity'], 381 @params['sid'], 382 ) 383 end 384 @instance_context 385 end
@return [Time] The date this Challenge was created
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 425 def date_created 426 @properties['date_created'] 427 end
@return [Time] The date this Challenge was responded
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 437 def date_responded 438 @properties['date_responded'] 439 end
@return [Time] The date this Challenge was updated
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 431 def date_updated 432 @properties['date_updated'] 433 end
@return [Hash] Details about the Challenge.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 461 def details 462 @properties['details'] 463 end
@return [String] Entity Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 407 def entity_sid 408 @properties['entity_sid'] 409 end
@return [Time] The date-time when this Challenge expires
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 443 def expiration_date 444 @properties['expiration_date'] 445 end
@return [String] Factor Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 419 def factor_sid 420 @properties['factor_sid'] 421 end
@return [challenge.FactorTypes] The Factor Type of this Challenge
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 473 def factor_type 474 @properties['factor_type'] 475 end
Fetch the ChallengeInstance
@return [ChallengeInstance] Fetched ChallengeInstance
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 492 def fetch 493 context.fetch 494 end
@return [String] Unique external identifier of the Entity
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 413 def identity 414 @properties['identity'] 415 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 523 def inspect 524 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 525 "<Twilio.Verify.V2.ChallengeInstance #{values}>" 526 end
@return [String] Nested resource URLs.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 485 def links 486 @properties['links'] 487 end
Access the notifications @return [notifications] notifications
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 510 def notifications 511 context.notifications 512 end
@return [challenge.ChallengeReasons] The Reason of this Challenge `status`
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 455 def responded_reason 456 @properties['responded_reason'] 457 end
@return [String] Service Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 401 def service_sid 402 @properties['service_sid'] 403 end
@return [String] A string that uniquely identifies this Challenge.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 389 def sid 390 @properties['sid'] 391 end
@return [challenge.ChallengeStatuses] The Status of this Challenge
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 449 def status 450 @properties['status'] 451 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 516 def to_s 517 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 518 "<Twilio.Verify.V2.ChallengeInstance #{values}>" 519 end
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 503 def update(auth_payload: :unset) 504 context.update(auth_payload: auth_payload, ) 505 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb 479 def url 480 @properties['url'] 481 end