Class: Twilio::REST::Preview::TrustedComms::CurrentCallContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/current_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) ⇒ CurrentCallContext

Initialize the CurrentCallContext

Parameters:

  • version (Version)

    Version that contains the resource


72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 72

def initialize(version)
  super(version)

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

Instance Method Details

#fetch(x_xcnam_sensitive_phone_number_from: :unset, x_xcnam_sensitive_phone_number_to: :unset) ⇒ CurrentCallInstance

Fetch the CurrentCallInstance

Parameters:

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

    The originating Phone Number, given in E.164 format. This phone number should be a Twilio number, otherwise it will return an error with HTTP Status Code 400.

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

    The terminating Phone Number, given in E.164 format.

Returns:


89
90
91
92
93
94
95
96
97
98
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 89

def fetch(x_xcnam_sensitive_phone_number_from: :unset, x_xcnam_sensitive_phone_number_to: :unset)
  headers = Twilio::Values.of({
      'X-Xcnam-Sensitive-Phone-Number-From' => x_xcnam_sensitive_phone_number_from,
      'X-Xcnam-Sensitive-Phone-Number-To' => x_xcnam_sensitive_phone_number_to,
  })

  payload = @version.fetch('GET', @uri, headers: headers)

  CurrentCallInstance.new(@version, payload, )
end

#inspectObject

Provide a detailed, user friendly representation


109
110
111
112
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 109

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.CurrentCallContext #{context}>"
end

#to_sObject

Provide a user friendly representation


102
103
104
105
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 102

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.CurrentCallContext #{context}>"
end