Class: Twilio::REST::Preview::TrustedComms::CurrentCallInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::TrustedComms::CurrentCallInstance
- 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
-
#bg_color ⇒ String
Background color of the current phone call.
-
#caller ⇒ String
Caller name of the current phone call.
-
#context ⇒ CurrentCallContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_at ⇒ Time
The date this current phone call was created.
-
#fetch ⇒ CurrentCallInstance
Fetch a CurrentCallInstance.
-
#font_color ⇒ String
Font color of the current phone call.
-
#from ⇒ String
The originating phone number.
-
#initialize(version, payload) ⇒ CurrentCallInstance
constructor
Initialize the CurrentCallInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#logo ⇒ String
Logo URL of the caller.
-
#manager ⇒ String
The name of the CPS organization.
-
#reason ⇒ String
The business reason for this current phone call.
-
#shield_img ⇒ String
Shield image URL that serves as authenticity proof of the current phone call.
-
#sid ⇒ String
A string that uniquely identifies this current phone call.
-
#status ⇒ String
The status of the current phone call.
-
#to ⇒ String
The terminating phone number.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
-
#use_case ⇒ String
The use case for the current phone call.
Constructor Details
#initialize(version, payload) ⇒ CurrentCallInstance
Initialize the CurrentCallInstance
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 118 def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'from' => payload['from'], 'to' => payload['to'], 'status' => payload['status'], 'reason' => payload['reason'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'caller' => payload['caller'], 'logo' => payload['logo'], 'bg_color' => payload['bg_color'], 'font_color' => payload['font_color'], 'use_case' => payload['use_case'], 'manager' => payload['manager'], 'shield_img' => payload['shield_img'], 'url' => payload['url'], } # Context @instance_context = nil @params = {} end |
Instance Method Details
#bg_color ⇒ String
Returns Background color of the current phone call.
205 206 207 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 205 def bg_color @properties['bg_color'] end |
#caller ⇒ String
Returns Caller name of the current phone call.
193 194 195 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 193 def caller @properties['caller'] end |
#context ⇒ CurrentCallContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
148 149 150 151 152 153 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 148 def context unless @instance_context @instance_context = CurrentCallContext.new(@version, ) end @instance_context end |
#created_at ⇒ Time
Returns The date this current phone call was created.
187 188 189 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 187 def created_at @properties['created_at'] end |
#fetch ⇒ CurrentCallInstance
Fetch a CurrentCallInstance
242 243 244 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 242 def fetch context.fetch end |
#font_color ⇒ String
Returns Font color of the current phone call.
211 212 213 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 211 def font_color @properties['font_color'] end |
#from ⇒ String
Returns The originating phone number.
163 164 165 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 163 def from @properties['from'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
255 256 257 258 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 255 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>" end |
#logo ⇒ String
Returns Logo URL of the caller.
199 200 201 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 199 def logo @properties['logo'] end |
#manager ⇒ String
Returns The name of the CPS organization.
223 224 225 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 223 def manager @properties['manager'] end |
#reason ⇒ String
Returns The business reason for this current phone call.
181 182 183 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 181 def reason @properties['reason'] end |
#shield_img ⇒ String
Returns Shield image URL that serves as authenticity proof of the current phone call.
229 230 231 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 229 def shield_img @properties['shield_img'] end |
#sid ⇒ String
Returns A string that uniquely identifies this current phone call.
157 158 159 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 157 def sid @properties['sid'] end |
#status ⇒ String
Returns The status of the current phone call.
175 176 177 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 175 def status @properties['status'] end |
#to ⇒ String
Returns The terminating phone number.
169 170 171 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 169 def to @properties['to'] end |
#to_s ⇒ Object
Provide a user friendly representation
248 249 250 251 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 248 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
235 236 237 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 235 def url @properties['url'] end |
#use_case ⇒ String
Returns The use case for the current phone call.
217 218 219 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 217 def use_case @properties['use_case'] end |