Class: Twilio::REST::Conversations::V1::ConversationContext::ParticipantContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::ConversationContext::ParticipantContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the ParticipantInstance.
-
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance.
-
#initialize(version, conversation_sid, sid) ⇒ ParticipantContext
constructor
Initialize the ParticipantContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(date_created: :unset, date_updated: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
Constructor Details
#initialize(version, conversation_sid, sid) ⇒ ParticipantContext
Initialize the ParticipantContext
200 201 202 203 204 205 206 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 200 def initialize(version, conversation_sid, sid) super(version) # Path Solution @solution = {conversation_sid: conversation_sid, sid: sid, } @uri = "/Conversations/#{@solution[:conversation_sid]}/Participants/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the ParticipantInstance
236 237 238 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 236 def delete @version.delete('delete', @uri) end |
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 243 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) ParticipantInstance.new( @version, payload, conversation_sid: @solution[:conversation_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
269 270 271 272 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 269 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ParticipantContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
262 263 264 265 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 262 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ParticipantContext #{context}>" end |
#update(date_created: :unset, date_updated: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 213 def update(date_created: :unset, date_updated: :unset) data = Twilio::Values.of({ 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), 'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated), }) payload = @version.update( 'POST', @uri, data: data, ) ParticipantInstance.new( @version, payload, conversation_sid: @solution[:conversation_sid], sid: @solution[:sid], ) end |