Class: Twilio::REST::Api::V2010::AccountContext::ValidationRequestList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/validation_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil) ⇒ ValidationRequestList

Initialize the ValidationRequestList

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String) (defaults to: nil)

    The SID of the Account responsible for the Caller ID.


22
23
24
25
26
27
28
# File 'lib/twilio-ruby/rest/api/v2010/account/validation_request.rb', line 22

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

  # Path Solution
  @solution = {account_sid: }
  @uri = "/Accounts/#{@solution[:account_sid]}/OutgoingCallerIds.json"
end

Instance Method Details

#create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset) ⇒ ValidationRequestInstance

Create the ValidationRequestInstance

Parameters:

  • phone_number (String) (defaults to: nil)

    The phone number to verify in E.164 format, which consists of a + followed by the country code and subscriber number.

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

    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.

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

    The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`.

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

    The digits to dial after connecting the verification call.

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

    The URL we should call using the `status_callback_method` to send status information about the verification process to your application.

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

    The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`.

Returns:


49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/twilio-ruby/rest/api/v2010/account/validation_request.rb', line 49

def create(phone_number: nil, friendly_name: :unset, call_delay: :unset, extension: :unset, status_callback: :unset, status_callback_method: :unset)
  data = Twilio::Values.of({
      'PhoneNumber' => phone_number,
      'FriendlyName' => friendly_name,
      'CallDelay' => call_delay,
      'Extension' => extension,
      'StatusCallback' => status_callback,
      'StatusCallbackMethod' => status_callback_method,
  })

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

  ValidationRequestInstance.new(@version, payload, account_sid: @solution[:account_sid], )
end

#to_sObject

Provide a user friendly representation


66
67
68
# File 'lib/twilio-ruby/rest/api/v2010/account/validation_request.rb', line 66

def to_s
  '#<Twilio.Api.V2010.ValidationRequestList>'
end