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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ VerificationList

Initialize the VerificationList

Parameters:



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

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_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset) ⇒ VerificationInstance

Create the VerificationInstance

Parameters:

  • to (String) (defaults to: nil)

    The phone number or [email](www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](www.twilio.com/docs/glossary/what-e164).

  • channel (String) (defaults to: nil)

    The verification method to use. Can be: [‘email`](www.twilio.com/docs/verify/email), `sms` or `call`.

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

    A custom user defined friendly name that overwrites the existing one in the verification message

  • 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`, `en-GB`, `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 correspond to ‘unique_name` fields defined when [creating your Rate Limit](www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request.

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

    [‘email`](www.twilio.com/docs/verify/email) channel configuration in json format. Must include ’from’ and ‘from_name’.

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

    Your [App Hash](developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: ‘<#> Your AppName verification code is: 1234 He42w354ol9`.

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 66

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

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

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

#to_sObject

Provide a user friendly representation



89
90
91
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 89

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