Class: Twilio::REST::Messaging::V1::SessionContext::ParticipantInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::SessionContext::ParticipantInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/session/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
-
#account_sid ⇒ String
The unique id of the Account responsible for this session.
-
#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.
-
#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 session participant as Chat User.
-
#initialize(version, payload, session_sid: nil, sid: nil) ⇒ ParticipantInstance
constructor
Initialize the ParticipantInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_service_sid ⇒ String
The unique id of the SMS Service this session belongs to.
-
#service_sid ⇒ String
The unique id of the Chat Service this session belongs to.
-
#session_sid ⇒ String
The unique id of the Session for this participant.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#twilio_address ⇒ String
The address of the Twilio phone number that the participant is in contact with.
-
#type ⇒ participant.ParticipantType
The type of twilio product, participant is a user of.
-
#update(attributes: :unset, date_created: :unset, date_updated: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance.
-
#url ⇒ String
An absolute URL for this participant.
-
#user_address ⇒ String
The address of the participant’s device.
Constructor Details
#initialize(version, payload, session_sid: nil, sid: nil) ⇒ ParticipantInstance
Initialize the ParticipantInstance
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 304 def initialize(version, payload, session_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'session_sid' => payload['session_sid'], 'sid' => payload['sid'], 'identity' => payload['identity'], 'twilio_address' => payload['twilio_address'], 'user_address' => payload['user_address'], 'attributes' => payload['attributes'], 'type' => payload['type'], '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 = {'session_sid' => session_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for this session.
342 343 344 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 342 def account_sid @properties['account_sid'] end |
#attributes ⇒ String
Returns An optional string metadata field you can use to store any data you wish.
390 391 392 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 390 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
333 334 335 336 337 338 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 333 def context unless @instance_context @instance_context = ParticipantContext.new(@version, @params['session_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created.
402 403 404 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 402 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
408 409 410 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 408 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ParticipantInstance
443 444 445 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 443 def delete context.delete end |
#fetch ⇒ ParticipantInstance
Fetch a ParticipantInstance
436 437 438 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 436 def fetch context.fetch end |
#identity ⇒ String
Returns A unique string identifier for the session participant as Chat User.
372 373 374 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 372 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
456 457 458 459 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 456 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ParticipantInstance #{values}>" end |
#messaging_service_sid ⇒ String
Returns The unique id of the SMS Service this session belongs to.
354 355 356 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 354 def messaging_service_sid @properties['messaging_service_sid'] end |
#service_sid ⇒ String
Returns The unique id of the Chat Service this session belongs to.
348 349 350 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 348 def service_sid @properties['service_sid'] end |
#session_sid ⇒ String
Returns The unique id of the Session for this participant.
360 361 362 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 360 def session_sid @properties['session_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
366 367 368 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 366 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
449 450 451 452 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 449 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ParticipantInstance #{values}>" end |
#twilio_address ⇒ String
Returns The address of the Twilio phone number that the participant is in contact with.
378 379 380 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 378 def twilio_address @properties['twilio_address'] end |
#type ⇒ participant.ParticipantType
Returns The type of twilio product, participant is a user of.
396 397 398 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 396 def type @properties['type'] end |
#update(attributes: :unset, date_created: :unset, date_updated: :unset) ⇒ ParticipantInstance
Update the ParticipantInstance
429 430 431 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 429 def update(attributes: :unset, date_created: :unset, date_updated: :unset) context.update(attributes: attributes, date_created: date_created, date_updated: date_updated, ) end |
#url ⇒ String
Returns An absolute URL for this participant.
414 415 416 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 414 def url @properties['url'] end |
#user_address ⇒ String
Returns The address of the participant’s device.
384 385 386 |
# File 'lib/twilio-ruby/rest/messaging/v1/session/participant.rb', line 384 def user_address @properties['user_address'] end |