Class: Twilio::REST::Preview::TrustedComms::BrandedCallList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/branded_call.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) ⇒ BrandedCallList

Initialize the BrandedCallList

Parameters:

  • version (Version)

    Version that contains the resource



20
21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb', line 20

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Business/BrandedCalls"
end

Instance Method Details

#create(from: nil, to: nil, reason: nil, call_sid: :unset) ⇒ BrandedCallInstance

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

Parameters:

  • from (String) (defaults to: nil)

    The phone number to use as the caller id, given in E.164 format (en.wikipedia.org/wiki/E.164). It must be a Twilio number that has been set up as a Branded Number in the Business Profile section for your account.

  • to (String) (defaults to: nil)

    The terminating Phone Number, given in E.164 format (en.wikipedia.org/wiki/E.164).

  • reason (String) (defaults to: nil)

    The business reason for this phone call that will appear in the terminating device’s screen.

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

    The call_sid

Returns:



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb', line 41

def create(from: nil, to: nil, reason: nil, call_sid: :unset)
  data = Twilio::Values.of({'From' => from, 'To' => to, 'Reason' => reason, 'CallSid' => call_sid, })

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

  BrandedCallInstance.new(@version, payload, )
end

#to_sObject

Provide a user friendly representation



55
56
57
# File 'lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb', line 55

def to_s
  '#<Twilio.Preview.TrustedComms.BrandedCallList>'
end