Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::InteractionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Proxy::V1::ServiceContext::SessionContext::InteractionInstance
- Defined in:
- lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the Interaction resource.
-
#context ⇒ InteractionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data ⇒ String
A JSON string that includes the message body of message interactions (e.g.
{\"body\": \"hello\"}) or the call duration (when available) of a call (e.g.{\"duration\": \"5\"}). -
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the Interaction was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Delete the InteractionInstance.
-
#fetch ⇒ InteractionInstance
Fetch the InteractionInstance.
-
#inbound_participant_sid ⇒ String
The SID of the inbound Participant resource.
-
#inbound_resource_sid ⇒ String
The SID of the inbound resource; either the Call or [Message](https://www.twilio.com/docs/sms/api/message..
- #inbound_resource_status ⇒ ResourceStatus
-
#inbound_resource_type ⇒ String
The inbound resource type.
-
#inbound_resource_url ⇒ String
The URL of the Twilio inbound resource.
-
#initialize(version, payload, service_sid: nil, session_sid: nil, sid: nil) ⇒ InteractionInstance
constructor
Initialize the InteractionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#outbound_participant_sid ⇒ String
The SID of the outbound Participant).
- #outbound_resource_sid ⇒ String
- #outbound_resource_status ⇒ ResourceStatus
-
#outbound_resource_type ⇒ String
The outbound resource type.
-
#outbound_resource_url ⇒ String
The URL of the Twilio outbound resource.
-
#service_sid ⇒ String
The SID of the parent Service resource.
-
#session_sid ⇒ String
The SID of the parent Session resource.
-
#sid ⇒ String
The unique string that we created to identify the Interaction resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #type ⇒ Type
-
#url ⇒ String
The absolute URL of the Interaction resource.
Constructor Details
#initialize(version, payload, service_sid: nil, session_sid: nil, sid: nil) ⇒ InteractionInstance
Initialize the InteractionInstance
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 226 def initialize(version, payload , service_sid: nil, session_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'session_sid' => payload['session_sid'], 'service_sid' => payload['service_sid'], 'account_sid' => payload['account_sid'], 'data' => payload['data'], 'type' => payload['type'], 'inbound_participant_sid' => payload['inbound_participant_sid'], 'inbound_resource_sid' => payload['inbound_resource_sid'], 'inbound_resource_status' => payload['inbound_resource_status'], 'inbound_resource_type' => payload['inbound_resource_type'], 'inbound_resource_url' => payload['inbound_resource_url'], 'outbound_participant_sid' => payload['outbound_participant_sid'], 'outbound_resource_sid' => payload['outbound_resource_sid'], 'outbound_resource_status' => payload['outbound_resource_status'], 'outbound_resource_type' => payload['outbound_resource_type'], 'outbound_resource_url' => payload['outbound_resource_url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'session_sid' => session_sid || @properties['session_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
288 289 290 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 288 def account_sid @properties['account_sid'] end |
#context ⇒ InteractionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 261 def context unless @instance_context @instance_context = InteractionContext.new(@version , @params['service_sid'], @params['session_sid'], @params['sid']) end @instance_context end |
#data ⇒ String
294 295 296 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 294 def data @properties['data'] end |
#date_created ⇒ Time
366 367 368 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 366 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
372 373 374 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 372 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the InteractionInstance
385 386 387 388 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 385 def delete context.delete end |
#fetch ⇒ InteractionInstance
Fetch the InteractionInstance
393 394 395 396 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 393 def fetch context.fetch end |
#inbound_participant_sid ⇒ String
306 307 308 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 306 def inbound_participant_sid @properties['inbound_participant_sid'] end |
#inbound_resource_sid ⇒ String
312 313 314 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 312 def inbound_resource_sid @properties['inbound_resource_sid'] end |
#inbound_resource_status ⇒ ResourceStatus
318 319 320 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 318 def inbound_resource_status @properties['inbound_resource_status'] end |
#inbound_resource_type ⇒ String
324 325 326 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 324 def inbound_resource_type @properties['inbound_resource_type'] end |
#inbound_resource_url ⇒ String
330 331 332 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 330 def inbound_resource_url @properties['inbound_resource_url'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 407 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.InteractionInstance #{values}>" end |
#outbound_participant_sid ⇒ String
336 337 338 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 336 def outbound_participant_sid @properties['outbound_participant_sid'] end |
#outbound_resource_sid ⇒ String
342 343 344 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 342 def outbound_resource_sid @properties['outbound_resource_sid'] end |
#outbound_resource_status ⇒ ResourceStatus
348 349 350 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 348 def outbound_resource_status @properties['outbound_resource_status'] end |
#outbound_resource_type ⇒ String
354 355 356 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 354 def outbound_resource_type @properties['outbound_resource_type'] end |
#outbound_resource_url ⇒ String
360 361 362 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 360 def outbound_resource_url @properties['outbound_resource_url'] end |
#service_sid ⇒ String
282 283 284 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 282 def service_sid @properties['service_sid'] end |
#session_sid ⇒ String
276 277 278 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 276 def session_sid @properties['session_sid'] end |
#sid ⇒ String
270 271 272 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 270 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
400 401 402 403 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 400 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.InteractionInstance #{values}>" end |
#type ⇒ Type
300 301 302 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 300 def type @properties['type'] end |
#url ⇒ String
378 379 380 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 378 def url @properties['url'] end |