Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::ParticipantContext::MessageInteractionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_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, participant_sid, sid) ⇒ MessageInteractionContext

Initialize the MessageInteractionContext

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.

  • participant_sid (String)

    The SID of the Participant resource.

  • sid (String)

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


197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 197

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

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

Instance Method Details

#fetchMessageInteractionInstance

Fetch the MessageInteractionInstance

Returns:


213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 213

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

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

#inspectObject

Provide a detailed, user friendly representation


235
236
237
238
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 235

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

#to_sObject

Provide a user friendly representation


228
229
230
231
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 228

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