Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::ParticipantContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Proxy::V1::ServiceContext::SessionContext::ParticipantContext
- Defined in:
- lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb,
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.
Defined Under Namespace
Classes: MessageInteractionContext, MessageInteractionInstance, MessageInteractionList, MessageInteractionPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ParticipantInstance.
-
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance.
-
#initialize(version, service_sid, session_sid, sid) ⇒ ParticipantContext
constructor
Initialize the ParticipantContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#message_interactions(sid = :unset) ⇒ MessageInteractionList, MessageInteractionContext
Access the message_interactions.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, session_sid, sid) ⇒ ParticipantContext
Initialize the ParticipantContext
169 170 171 172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 169 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]}/Participants/#{@solution[:sid]}" # Dependents @message_interactions = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the ParticipantInstance
182 183 184 185 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 182 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 190 def fetch payload = @version.fetch('GET', @uri) ParticipantInstance.new( @version, payload, service_sid: @solution[:service_sid], session_sid: @solution[:session_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
231 232 233 234 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 231 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Proxy.V1.ParticipantContext #{context}>" end |
#message_interactions(sid = :unset) ⇒ MessageInteractionList, MessageInteractionContext
Access the message_interactions
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 206 def (sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return MessageInteractionContext.new(@version, @solution[:service_sid], @solution[:session_sid], @solution[:sid],sid ) end unless @message_interactions @message_interactions = MessageInteractionList.new( @version, service_sid: @solution[:service_sid], session_sid: @solution[:session_sid], participant_sid: @solution[:sid], ) end @message_interactions end |
#to_s ⇒ Object
Provide a user friendly representation
224 225 226 227 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb', line 224 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Proxy.V1.ParticipantContext #{context}>" end |