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 ⇒ Boolean
Deletes the ParticipantInstance.
-
#fetch ⇒ ParticipantInstance
Fetch a 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.
-
#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) ⇒ 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
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 300 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'], '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
334 335 336 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 334 def account_sid @properties['account_sid'] end |
#attributes ⇒ String
358 359 360 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 358 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
325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 325 def context unless @instance_context @instance_context = ParticipantContext.new(@version, @params['conversation_sid'], @params['sid'], ) end @instance_context end |
#conversation_sid ⇒ String
340 341 342 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 340 def conversation_sid @properties['conversation_sid'] end |
#date_created ⇒ Time
370 371 372 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 370 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
376 377 378 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 376 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ParticipantInstance
402 403 404 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 402 def delete context.delete end |
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance
409 410 411 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 409 def fetch context.fetch end |
#identity ⇒ String
352 353 354 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 352 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
422 423 424 425 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 422 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ParticipantInstance #{values}>" end |
#messaging_binding ⇒ Hash
364 365 366 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 364 def messaging_binding @properties['messaging_binding'] end |
#sid ⇒ String
346 347 348 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 346 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
415 416 417 418 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 415 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) ⇒ ParticipantInstance
Update the ParticipantInstance
395 396 397 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 395 def update(date_created: :unset, date_updated: :unset, attributes: :unset) context.update(date_created: date_created, date_updated: date_updated, attributes: attributes, ) end |
#url ⇒ String
382 383 384 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb', line 382 def url @properties['url'] end |