Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::ParticipantContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::ParticipantContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb
Instance Method Summary collapse
-
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the ParticipantInstance.
-
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance.
-
#initialize(version, chat_service_sid, 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, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, last_read_message_index: :unset, last_read_timestamp: :unset, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
Constructor Details
#initialize(version, chat_service_sid, conversation_sid, sid) ⇒ ParticipantContext
Initialize the ParticipantContext
191 192 193 194 195 196 197 198 199 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 191 def initialize(version, chat_service_sid, conversation_sid, sid) super(version) # Path Solution @solution = { chat_service_sid: chat_service_sid, conversation_sid: conversation_sid, sid: sid, } @uri = "/Services/#{@solution[:chat_service_sid]}/Conversations/#{@solution[:conversation_sid]}/Participants/#{@solution[:sid]}" end |
Instance Method Details
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the ParticipantInstance
204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 204 def delete( x_twilio_webhook_enabled: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 218 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ParticipantInstance.new( @version, payload, chat_service_sid: @solution[:chat_service_sid], conversation_sid: @solution[:conversation_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
300 301 302 303 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 300 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ParticipantContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
293 294 295 296 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 293 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ParticipantContext #{context}>" end |
#update(date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, last_read_message_index: :unset, last_read_timestamp: :unset, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 249 def update( date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, last_read_message_index: :unset, last_read_timestamp: :unset, x_twilio_webhook_enabled: :unset ) data = Twilio::Values.of({ 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), 'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated), 'Identity' => identity, 'Attributes' => attributes, 'RoleSid' => role_sid, 'MessagingBinding.ProxyAddress' => messaging_binding_proxy_address, 'MessagingBinding.ProjectedAddress' => messaging_binding_projected_address, 'LastReadMessageIndex' => , 'LastReadTimestamp' => , }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, }) payload = @version.update('POST', @uri, data: data, headers: headers) ParticipantInstance.new( @version, payload, chat_service_sid: @solution[:chat_service_sid], conversation_sid: @solution[:conversation_sid], sid: @solution[:sid], ) end |