class Twilio::REST::Api::V2010::AccountContext::ValidationRequestList

Public Class Methods

new(version, account_sid: nil) click to toggle source

Initialize the ValidationRequestList @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] responsible for the
Caller ID.

@return [ValidationRequestList] ValidationRequestList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/api/v2010/account/validation_request.rb
22 def initialize(version, account_sid: nil)
23   super(version)
24 
25   # Path Solution
26   @solution = {account_sid: account_sid}
27   @uri = "/Accounts/#{@solution[:account_sid]}/OutgoingCallerIds.json"
28 end

Public Instance Methods

create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset) click to toggle source

Create the ValidationRequestInstance @param [String] phone_number The phone number to verify in

{E.164}[https://www.twilio.com/docs/glossary/what-e164] format, which consists
of a + followed by the country code and subscriber number.

@param [String] friendly_name A descriptive string that you create to describe

the new caller ID resource. It can be up to 64 characters long. The default
value is a formatted version of the phone number.

@param [String] call_delay The number of seconds to delay before initiating the

verification call. Can be an integer between `0` and `60`, inclusive. The
default is `0`.

@param [String] extension The digits to dial after connecting the verification

call.

@param [String] status_callback The URL we should call using the

`status_callback_method` to send status information about the verification
process to your application.

@param [String] status_callback_method The HTTP method we should use to call

`status_callback`. Can be: `GET` or `POST`, and the default is `POST`.

@return [ValidationRequestInstance] Created ValidationRequestInstance

   # File lib/twilio-ruby/rest/api/v2010/account/validation_request.rb
49 def create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset)
50   data = Twilio::Values.of({
51       'PhoneNumber' => phone_number,
52       'FriendlyName' => friendly_name,
53       'CallDelay' => call_delay,
54       'Extension' => extension,
55       'StatusCallback' => status_callback,
56       'StatusCallbackMethod' => status_callback_method,
57   })
58 
59   payload = @version.create('POST', @uri, data: data)
60 
61   ValidationRequestInstance.new(@version, payload, account_sid: @solution[:account_sid], )
62 end
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/api/v2010/account/validation_request.rb
66 def to_s
67   '#<Twilio.Api.V2010.ValidationRequestList>'
68 end