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:



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, rate_limits: :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](www.twilio.com/docs/voice/twiml/number#attributes-sendDigits).

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

    The locale 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.

  • rate_limits (Hash) (defaults to: :unset)

    The custom key-value pairs of Programmable Rate Limits. Keys should be the unique_name configured while creating you Rate Limit along with the associated values for each particular request. You may include multiple Rate Limit values in each request.

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 58

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

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

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

#to_sObject

Provide a user friendly representation



82
83
84
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 82

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