Class: Twilio::REST::Conversations::V1::ConversationContext::ParticipantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConversationContext::ParticipantInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account responsible for this participant.
-
#attributes ⇒ String
An optional string metadata field you can use to store any data you wish.
-
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_sid ⇒ String
The unique id of the Conversation for this participant.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the ParticipantInstance.
-
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance.
-
#identity ⇒ String
A unique string identifier for the conversation participant as Chat User.
-
#initialize(version, payload, conversation_sid: nil, sid: nil) ⇒ ParticipantInstance
constructor
Initialize the ParticipantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_binding ⇒ Hash
Information about how this participant exchanges messages with the conversation.
-
#role_sid ⇒ String
The SID of the Role to assign to the participant.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, identity: :unset, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
-
#url ⇒ String
An absolute URL for this participant.
Constructor Details
#initialize(version, payload, conversation_sid: nil, sid: nil) ⇒ ParticipantInstance
Initialize the ParticipantInstance
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 312 def initialize(version, payload, conversation_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'conversation_sid' => payload['conversation_sid'], 'sid' => payload['sid'], 'identity' => payload['identity'], 'attributes' => payload['attributes'], 'messaging_binding' => payload['messaging_binding'], 'role_sid' => payload['role_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'conversation_sid' => conversation_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for this participant.
347 348 349 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 347 def account_sid @properties['account_sid'] end |
#attributes ⇒ String
Returns An optional string metadata field you can use to store any data you wish.
371 372 373 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 371 def attributes @properties['attributes'] end |
#context ⇒ ParticipantContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
338 339 340 341 342 343 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 338 def context unless @instance_context @instance_context = ParticipantContext.new(@version, @params['conversation_sid'], @params['sid'], ) end @instance_context end |
#conversation_sid ⇒ String
Returns The unique id of the Conversation for this participant.
353 354 355 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 353 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
389 390 391 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 389 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
395 396 397 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 395 def date_updated @properties['date_updated'] end |
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the ParticipantInstance
445 446 447 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 445 def delete(x_twilio_webhook_enabled: :unset) context.delete(x_twilio_webhook_enabled: x_twilio_webhook_enabled, ) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
452 453 454 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 452 def fetch context.fetch end |
#identity ⇒ String
Returns A unique string identifier for the conversation participant as Chat User.
365 366 367 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 365 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
465 466 467 468 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 465 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ParticipantInstance #{values}>" end |
#messaging_binding ⇒ Hash
Returns Information about how this participant exchanges messages with the conversation.
377 378 379 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 377 def messaging_binding @properties['messaging_binding'] end |
#role_sid ⇒ String
Returns The SID of the Role to assign to the participant.
383 384 385 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 383 def role_sid @properties['role_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
359 360 361 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 359 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
458 459 460 461 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 458 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ParticipantInstance #{values}>" end |
#update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, identity: :unset, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 427 def update(date_created: :unset, date_updated: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, identity: :unset, x_twilio_webhook_enabled: :unset) context.update( date_created: date_created, date_updated: date_updated, attributes: attributes, role_sid: role_sid, messaging_binding_proxy_address: messaging_binding_proxy_address, messaging_binding_projected_address: messaging_binding_projected_address, identity: identity, x_twilio_webhook_enabled: x_twilio_webhook_enabled, ) end |
#url ⇒ String
Returns An absolute URL for this participant.
401 402 403 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 401 def url @properties['url'] end |