Class: Twilio::REST::Preview::AccSecurity::ServiceContext::VerificationList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/acc_security/service/verification.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) ⇒ VerificationList

Initialize the VerificationList

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Service.



22
23
24
25
26
27
28
# File 'lib/twilio-ruby/rest/preview/acc_security/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_message: :unset) ⇒ VerificationInstance

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

Parameters:

  • to (String) (defaults to: nil)

    The To phonenumber of the phone being verified

  • channel (String) (defaults to: nil)

    The method in which the phone will be verified. Either sms or call

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

    A character string containing a custom message for this verification

Returns:



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/twilio-ruby/rest/preview/acc_security/service/verification.rb', line 39

def create(to: nil, channel: nil, custom_message: :unset)
  data = Twilio::Values.of({'To' => to, 'Channel' => channel, 'CustomMessage' => custom_message, })

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

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

#to_sObject

Provide a user friendly representation



53
54
55
# File 'lib/twilio-ruby/rest/preview/acc_security/service/verification.rb', line 53

def to_s
  '#<Twilio.Preview.AccSecurity.VerificationList>'
end