## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Api < Domain class V2010 < Version class AccountContext < InstanceContext class ValidationRequestList < ListResource ## # Initialize the ValidationRequestList # @param [Version] version Version that contains the resource # @param [String] account_sid The unique ID of the # [Account](https://www.twilio.com/docs/api/rest/account) responsible for this # Caller Id. # @return [ValidationRequestList] ValidationRequestList def initialize(version, account_sid: nil) super(version) # Path Solution @solution = {account_sid: account_sid} @uri = "/Accounts/#{@solution[:account_sid]}/OutgoingCallerIds.json" end ## # Retrieve a single page of ValidationRequestInstance records from the API. # Request is executed immediately. # @param [String] phone_number The phone number to verify. Should be formatted # with a '+' and country code e.g., +16175551212 # ([E.164](http://en.wikipedia.org/wiki/E.164) format). Twilio will also accept # unformatted US numbers e.g., (415) 555-1212, 415-555-1212. # @param [String] friendly_name A human readable description for the new caller ID # with maximum length 64 characters. Defaults to a nicely formatted version of the # number. # @param [String] call_delay The number of seconds, between 0 and 60, to delay # before initiating the verification call. Defaults to 0. # @param [String] extension Digits to dial after connecting the verification call. # @param [String] status_callback A URL that Twilio will request when the # verification call ends to notify your app if the verification process was # successful or not. See [StatusCallback # parameter](https://www.twilio.com/docs/api/voice/outgoing-caller-ids#statuscallback-parameter) below. # @param [String] status_callback_method The HTTP method Twilio should use when # requesting the above URL. Defaults to POST. # @return [ValidationRequestInstance] Newly created ValidationRequestInstance 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 ## # Provide a user friendly representation def to_s '#' end end class ValidationRequestPage < Page ## # Initialize the ValidationRequestPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [ValidationRequestPage] ValidationRequestPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of ValidationRequestInstance # @param [Hash] payload Payload response from the API # @return [ValidationRequestInstance] ValidationRequestInstance def get_instance(payload) ValidationRequestInstance.new(@version, payload, account_sid: @solution[:account_sid], ) end ## # Provide a user friendly representation def to_s '' end end class ValidationRequestInstance < InstanceResource ## # Initialize the ValidationRequestInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The unique ID of the # [Account](https://www.twilio.com/docs/api/rest/account) responsible for this # Caller Id. # @return [ValidationRequestInstance] ValidationRequestInstance def initialize(version, payload, account_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'phone_number' => payload['phone_number'], 'friendly_name' => payload['friendly_name'], 'validation_code' => payload['validation_code'].to_i, 'call_sid' => payload['call_sid'], } end ## # @return [String] The unique ID of the Account responsible for this Caller Id. def account_sid @properties['account_sid'] end ## # @return [String] The incoming phone number. def phone_number @properties['phone_number'] end ## # @return [String] A human readable descriptive text for this resource, up to 64 characters long. def friendly_name @properties['friendly_name'] end ## # @return [String] The 6 digit validation code that must be entered via the phone to validate this phone number for Caller ID. def validation_code @properties['validation_code'] end ## # @return [String] The unique id of the Call created for this validation attempt. def call_sid @properties['call_sid'] end ## # Provide a user friendly representation def to_s "" end ## # Provide a detailed, user friendly representation def inspect "" end end end end end end end