Class: Twilio::REST::Verify::V2::ServiceContext::VerificationCheckList

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

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ VerificationCheckList

Initialize the VerificationCheckList

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String) (defaults to: nil)

    The SID of the Service the resource is associated with.


22
23
24
25
26
27
28
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 22

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

  # Path Solution
  @solution = {service_sid: service_sid}
  @uri = "/Services/#{@solution[:service_sid]}/VerificationCheck"
end

Instance Method Details

#create(code: nil, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset) ⇒ VerificationCheckInstance

Create the VerificationCheckInstance

Parameters:

  • code (String) (defaults to: nil)

    The 4-10 character string being verified.

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

    The phone number or email to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in E.164 format.

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

    A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/email must be specified.

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

    The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

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

    The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

Returns:


45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 45

def create(code: nil, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset)
  data = Twilio::Values.of({
      'Code' => code,
      'To' => to,
      'VerificationSid' => verification_sid,
      'Amount' => amount,
      'Payee' => payee,
  })

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

  VerificationCheckInstance.new(@version, payload, service_sid: @solution[:service_sid], )
end

#to_sObject

Provide a user friendly representation


61
62
63
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 61

def to_s
  '#<Twilio.Verify.V2.VerificationCheckList>'
end