class Twilio::REST::Preview::TrustedComms::CurrentCallInstance
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 help@twilio.com.
Public Class Methods
Initialize the CurrentCallInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@return [CurrentCallInstance] CurrentCallInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 123 def initialize(version, payload) 124 super(version) 125 126 # Marshaled Properties 127 @properties = { 128 'bg_color' => payload['bg_color'], 129 'caller' => payload['caller'], 130 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 131 'font_color' => payload['font_color'], 132 'from' => payload['from'], 133 'logo' => payload['logo'], 134 'manager' => payload['manager'], 135 'reason' => payload['reason'], 136 'shield_img' => payload['shield_img'], 137 'sid' => payload['sid'], 138 'status' => payload['status'], 139 'to' => payload['to'], 140 'url' => payload['url'], 141 'use_case' => payload['use_case'], 142 } 143 144 # Context 145 @instance_context = nil 146 @params = {} 147 end
Public Instance Methods
@return [String] Background color of the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 162 def bg_color 163 @properties['bg_color'] 164 end
@return [String] Caller name of the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 168 def caller 169 @properties['caller'] 170 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CurrentCallContext] CurrentCallContext
for this CurrentCallInstance
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 153 def context 154 unless @instance_context 155 @instance_context = CurrentCallContext.new(@version, ) 156 end 157 @instance_context 158 end
@return [Time] The date this current phone call was created
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 174 def created_at 175 @properties['created_at'] 176 end
Fetch the CurrentCallInstance
@param [String] x_xcnam_sensitive_phone_number_from The originating Phone
Number, given in {E.164 format}[https://www.twilio.com/docs/glossary/what-e164]. This phone number should be a Twilio number, otherwise it will return an error with HTTP Status Code 400.
@param [String] x_xcnam_sensitive_phone_number_to The terminating Phone Number,
given in {E.164 format}[https://www.twilio.com/docs/glossary/what-e164].
@return [CurrentCallInstance] Fetched CurrentCallInstance
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 253 def fetch(x_xcnam_sensitive_phone_number_from: :unset, x_xcnam_sensitive_phone_number_to: :unset) 254 context.fetch( 255 x_xcnam_sensitive_phone_number_from: x_xcnam_sensitive_phone_number_from, 256 x_xcnam_sensitive_phone_number_to: x_xcnam_sensitive_phone_number_to, 257 ) 258 end
@return [String] Font color of the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 180 def font_color 181 @properties['font_color'] 182 end
@return [String] The originating phone number
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 186 def from 187 @properties['from'] 188 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 269 def inspect 270 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 271 "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>" 272 end
@return [String] Logo URL of the caller
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 192 def logo 193 @properties['logo'] 194 end
@return [String] The name of the CPS organization
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 198 def manager 199 @properties['manager'] 200 end
@return [String] The business reason for this current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 204 def reason 205 @properties['reason'] 206 end
@return [String] Shield image URL that serves as authenticity proof of the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 210 def shield_img 211 @properties['shield_img'] 212 end
@return [String] A string that uniquely identifies this current branded phone call.
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 216 def sid 217 @properties['sid'] 218 end
@return [String] The status of the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 222 def status 223 @properties['status'] 224 end
@return [String] The terminating phone number
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 228 def to 229 @properties['to'] 230 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 262 def to_s 263 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 264 "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>" 265 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 234 def url 235 @properties['url'] 236 end
@return [String] The use case for the current phone call
# File lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb 240 def use_case 241 @properties['use_case'] 242 end