Class: Twilio::REST::Verify::V2::ServiceContext::VerificationList

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ VerificationList

Initialize the VerificationList

Parameters:

  • version (Version) —

    Version that contains the resource

  • service_sid (String) (defaults to: nil) —

    The SID of the Service the resource is associated with.



24
25
26
27
28
29
30
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 24

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

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

Instance Method Details

#create(to: nil, channel: nil, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset) ⇒ VerificationInstance

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

Parameters:

  • to (String) (defaults to: nil) —

    The phone number to verify.

  • channel (String) (defaults to: nil) —

    The verification method to use. Can be: sms or call.

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

    The text of a custom message to use for the verification.

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

    The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of sendDigits.

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

    The local to use for the verification SMS or call. Can be: af, ar, ca, cs, da, de, el, en, es, fi, fr, he, hi, hr, hu, id, it, ja, ko, ms, nb, nl, pl, pt, pr-BR, ro, ru, sv, th, tl, tr, vi, zh, zh-CN, or zh-HK.

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

    A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.

  • 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:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 54

def create(to: nil, channel: nil, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset)
  data = Twilio::Values.of({
      'To' => to,
      'Channel' => channel,
      'CustomMessage' => custom_message,
      'SendDigits' => send_digits,
      'Locale' => locale,
      'CustomCode' => custom_code,
      'Amount' => amount,
      'Payee' => payee,
  })

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

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

#to_s ⇒ Object

Provide a user friendly representation



77
78
79
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 77

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