Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::InteractionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, session_sid, sid) ⇒ InteractionContext

Initialize the InteractionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The SID of the parent Service of the resource to fetch.

  • session_sid (String)

    The SID of the parent Session of the resource to fetch.

  • sid (String)

    The Twilio-provided string that uniquely identifies the Interaction resource to fetch.


172
173
174
175
176
177
178
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 172

def initialize(version, service_sid, session_sid, sid)
  super(version)

  # Path Solution
  @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid, }
  @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Interactions/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the InteractionInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


198
199
200
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 198

def delete
   @version.delete('DELETE', @uri)
end

#fetchInteractionInstance

Fetch the InteractionInstance

Returns:


183
184
185
186
187
188
189
190
191
192
193
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 183

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

  InteractionInstance.new(
      @version,
      payload,
      service_sid: @solution[:service_sid],
      session_sid: @solution[:session_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


211
212
213
214
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 211

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

#to_sObject

Provide a user friendly representation


204
205
206
207
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb', line 204

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