Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::ParticipantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::ParticipantInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb
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.
-
#chat_service_sid ⇒ String
The SID of the Conversation Service that the resource is associated with.
-
#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 Conversation User.
-
#initialize(version, payload, chat_service_sid: nil, 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 a conversation-level 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, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
-
#url ⇒ String
An absolute URL for this participant.
Constructor Details
#initialize(version, payload, chat_service_sid: nil, conversation_sid: nil, sid: nil) ⇒ ParticipantInstance
Initialize the ParticipantInstance
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 331 def initialize(version, payload, chat_service_sid: nil, conversation_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'chat_service_sid' => payload['chat_service_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 = { 'chat_service_sid' => chat_service_sid, '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.
376 377 378 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 376 def account_sid @properties['account_sid'] end |
#attributes ⇒ String
Returns An optional string metadata field you can use to store any data you wish.
406 407 408 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 406 def attributes @properties['attributes'] end |
#chat_service_sid ⇒ String
Returns The SID of the Conversation Service that the resource is associated with.
382 383 384 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 382 def chat_service_sid @properties['chat_service_sid'] 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
362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 362 def context unless @instance_context @instance_context = ParticipantContext.new( @version, @params['chat_service_sid'], @params['conversation_sid'], @params['sid'], ) end @instance_context end |
#conversation_sid ⇒ String
Returns The unique ID of the Conversation for this participant.
388 389 390 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 388 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created.
424 425 426 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 424 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
430 431 432 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 430 def date_updated @properties['date_updated'] end |
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the ParticipantInstance
481 482 483 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 481 def delete(x_twilio_webhook_enabled: :unset) context.delete(x_twilio_webhook_enabled: x_twilio_webhook_enabled, ) end |
#fetch ⇒ ParticipantInstance
Fetch the ParticipantInstance
488 489 490 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 488 def fetch context.fetch end |
#identity ⇒ String
Returns A unique string identifier for the conversation participant as Conversation User.
400 401 402 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 400 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
501 502 503 504 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 501 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.
412 413 414 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 412 def messaging_binding @properties['messaging_binding'] end |
#role_sid ⇒ String
Returns The SID of a conversation-level Role to assign to the participant.
418 419 420 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 418 def role_sid @properties['role_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
394 395 396 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 394 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
494 495 496 497 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 494 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ParticipantInstance #{values}>" 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, x_twilio_webhook_enabled: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 463 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, x_twilio_webhook_enabled: :unset) context.update( date_created: date_created, date_updated: date_updated, identity: identity, attributes: attributes, role_sid: role_sid, messaging_binding_proxy_address: messaging_binding_proxy_address, messaging_binding_projected_address: messaging_binding_projected_address, x_twilio_webhook_enabled: x_twilio_webhook_enabled, ) end |
#url ⇒ String
Returns An absolute URL for this participant.
436 437 438 |
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb', line 436 def url @properties['url'] end |