class Twilio::REST::Proxy::V1::ServiceContext::SessionContext::InteractionInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the InteractionInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the parent
{Service}[https://www.twilio.com/docs/proxy/api/service] resource.
@param [String] session_sid
The SID of the parent
{Session}[https://www.twilio.com/docs/proxy/api/session] resource.
@param [String] sid The Twilio-provided string that uniquely identifies the
Interaction resource to fetch.
@return [InteractionInstance] InteractionInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 231 def initialize(version, payload, service_sid: nil, session_sid: nil, sid: nil) 232 super(version) 233 234 # Marshaled Properties 235 @properties = { 236 'sid' => payload['sid'], 237 'session_sid' => payload['session_sid'], 238 'service_sid' => payload['service_sid'], 239 'account_sid' => payload['account_sid'], 240 'data' => payload['data'], 241 'type' => payload['type'], 242 'inbound_participant_sid' => payload['inbound_participant_sid'], 243 'inbound_resource_sid' => payload['inbound_resource_sid'], 244 'inbound_resource_status' => payload['inbound_resource_status'], 245 'inbound_resource_type' => payload['inbound_resource_type'], 246 'inbound_resource_url' => payload['inbound_resource_url'], 247 'outbound_participant_sid' => payload['outbound_participant_sid'], 248 'outbound_resource_sid' => payload['outbound_resource_sid'], 249 'outbound_resource_status' => payload['outbound_resource_status'], 250 'outbound_resource_type' => payload['outbound_resource_type'], 251 'outbound_resource_url' => payload['outbound_resource_url'], 252 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 253 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 254 'url' => payload['url'], 255 } 256 257 # Context 258 @instance_context = nil 259 @params = { 260 'service_sid' => service_sid, 261 'session_sid' => session_sid, 262 'sid' => sid || @properties['sid'], 263 } 264 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 302 def account_sid 303 @properties['account_sid'] 304 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 [InteractionContext] InteractionContext
for this InteractionInstance
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 270 def context 271 unless @instance_context 272 @instance_context = InteractionContext.new( 273 @version, 274 @params['service_sid'], 275 @params['session_sid'], 276 @params['sid'], 277 ) 278 end 279 @instance_context 280 end
@return [String] A JSON string that includes the message body of message interactions
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 308 def data 309 @properties['data'] 310 end
@return [Time] The ISO 8601 date and time in GMT when the Interaction was created
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 380 def date_created 381 @properties['date_created'] 382 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 386 def date_updated 387 @properties['date_updated'] 388 end
Delete the InteractionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 406 def delete 407 context.delete 408 end
Fetch the InteractionInstance
@return [InteractionInstance] Fetched InteractionInstance
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 399 def fetch 400 context.fetch 401 end
@return [String] The SID of the inbound Participant resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 320 def inbound_participant_sid 321 @properties['inbound_participant_sid'] 322 end
@return [String] The SID of the inbound resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 326 def inbound_resource_sid 327 @properties['inbound_resource_sid'] 328 end
@return [interaction.ResourceStatus] The inbound resource status of the Interaction
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 332 def inbound_resource_status 333 @properties['inbound_resource_status'] 334 end
@return [String] The inbound resource type
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 338 def inbound_resource_type 339 @properties['inbound_resource_type'] 340 end
@return [String] The URL of the Twilio
inbound resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 344 def inbound_resource_url 345 @properties['inbound_resource_url'] 346 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 419 def inspect 420 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 421 "<Twilio.Proxy.V1.InteractionInstance #{values}>" 422 end
@return [String] The SID of the outbound Participant
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 350 def outbound_participant_sid 351 @properties['outbound_participant_sid'] 352 end
@return [String] The SID of the outbound resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 356 def outbound_resource_sid 357 @properties['outbound_resource_sid'] 358 end
@return [interaction.ResourceStatus] The outbound resource status of the Interaction
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 362 def outbound_resource_status 363 @properties['outbound_resource_status'] 364 end
@return [String] The outbound resource type
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 368 def outbound_resource_type 369 @properties['outbound_resource_type'] 370 end
@return [String] The URL of the Twilio
outbound resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 374 def outbound_resource_url 375 @properties['outbound_resource_url'] 376 end
@return [String] The SID of the resource's parent Service
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 296 def service_sid 297 @properties['service_sid'] 298 end
@return [String] The SID of the resource's parent Session
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 290 def session_sid 291 @properties['session_sid'] 292 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 284 def sid 285 @properties['sid'] 286 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 412 def to_s 413 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 414 "<Twilio.Proxy.V1.InteractionInstance #{values}>" 415 end
@return [interaction.Type] The Type of the Interaction
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 314 def type 315 @properties['type'] 316 end
@return [String] The absolute URL of the Interaction resource
# File lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb 392 def url 393 @properties['url'] 394 end