class Twilio::REST::Proxy::V1::ServiceContext::SessionContext::ParticipantContext

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

Public Class Methods

new(version, service_sid, session_sid, sid) click to toggle source

Initialize the ParticipantContext @param [Version] version Version that contains the resource @param [String] service_sid The SID of the parent

{Service}[https://www.twilio.com/docs/proxy/api/service] of the resource to
fetch.

@param [String] session_sid The SID of the parent

{Session}[https://www.twilio.com/docs/proxy/api/session] of the resource to
fetch.

@param [String] sid The Twilio-provided string that uniquely identifies the

Participant resource to fetch.

@return [ParticipantContext] ParticipantContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
214 def initialize(version, service_sid, session_sid, sid)
215   super(version)
216 
217   # Path Solution
218   @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid, }
219   @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Participants/#{@solution[:sid]}"
220 
221   # Dependents
222   @message_interactions = nil
223 end

Public Instance Methods

delete() click to toggle source

Delete the ParticipantInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
243 def delete
244    @version.delete('DELETE', @uri)
245 end
fetch() click to toggle source

Fetch the ParticipantInstance @return [ParticipantInstance] Fetched ParticipantInstance

    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
228 def fetch
229   payload = @version.fetch('GET', @uri)
230 
231   ParticipantInstance.new(
232       @version,
233       payload,
234       service_sid: @solution[:service_sid],
235       session_sid: @solution[:session_sid],
236       sid: @solution[:sid],
237   )
238 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
285 def inspect
286   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
287   "#<Twilio.Proxy.V1.ParticipantContext #{context}>"
288 end
message_interactions(sid=:unset) click to toggle source

Access the message_interactions @return [MessageInteractionList] @return [MessageInteractionContext] if sid was passed.

    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
251 def message_interactions(sid=:unset)
252   raise ArgumentError, 'sid cannot be nil' if sid.nil?
253 
254   if sid != :unset
255     return MessageInteractionContext.new(
256         @version,
257         @solution[:service_sid],
258         @solution[:session_sid],
259         @solution[:sid],
260         sid,
261     )
262   end
263 
264   unless @message_interactions
265     @message_interactions = MessageInteractionList.new(
266         @version,
267         service_sid: @solution[:service_sid],
268         session_sid: @solution[:session_sid],
269         participant_sid: @solution[:sid],
270     )
271   end
272 
273   @message_interactions
274 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb
278 def to_s
279   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
280   "#<Twilio.Proxy.V1.ParticipantContext #{context}>"
281 end