Class: Twilio::REST::Authy::V1::ServiceContext::EntityContext::FactorContext::ChallengeList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil, identity: nil, factor_sid: nil) ⇒ ChallengeList

Initialize the ChallengeList

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Service.

  • identity (String) (defaults to: nil)

    Customer unique identity for the Entity owner of the Challenge

  • factor_sid (String) (defaults to: nil)

    The unique SID identifier of the Factor.



27
28
29
30
31
32
33
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 27

def initialize(version, service_sid: nil, identity: nil, factor_sid: nil)
  super(version)

  # Path Solution
  @solution = {service_sid: service_sid, identity: identity, factor_sid: factor_sid}
  @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Factors/#{@solution[:factor_sid]}/Challenges"
end

Instance Method Details

#create(expiration_date: :unset, details: :unset, hidden_details: :unset) ⇒ ChallengeInstance

Retrieve a single page of ChallengeInstance records from the API. Request is executed immediately.

Parameters:

  • expiration_date (Time) (defaults to: :unset)

    The future date in which this Challenge will expire, given in ISO 8601 format (en.wikipedia.org/wiki/ISO_8601).

  • details (String) (defaults to: :unset)

    Details provided to give context about the Challenge. Shown to the end user.

  • hidden_details (String) (defaults to: :unset)

    Details provided to give context about the Challenge. Not shown to the end user.

Returns:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 45

def create(expiration_date: :unset, details: :unset, hidden_details: :unset)
  data = Twilio::Values.of({
      'ExpirationDate' => Twilio.serialize_iso8601_datetime(expiration_date),
      'Details' => details,
      'HiddenDetails' => hidden_details,
  })

  payload = @version.create(
      'POST',
      @uri,
      data: data
  )

  ChallengeInstance.new(
      @version,
      payload,
      service_sid: @solution[:service_sid],
      identity: @solution[:identity],
      factor_sid: @solution[:factor_sid],
  )
end

#to_sObject

Provide a user friendly representation



69
70
71
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 69

def to_s
  '#<Twilio.Authy.V1.ChallengeList>'
end