Class: Twilio::REST::Conversations::V1::ConversationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConversationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/conversation.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 conversation.
-
#chat_service_sid ⇒ String
The unique id of the Chat Service this conversation belongs to.
-
#context ⇒ ConversationContext
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 ConversationInstance.
-
#fetch ⇒ ConversationInstance
Fetch a ConversationInstance.
-
#friendly_name ⇒ String
The human-readable name of this conversation.
-
#initialize(version, payload, sid: nil) ⇒ ConversationInstance
constructor
Initialize the ConversationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Absolute URLs to access the Participants of this Conversation.
-
#messages ⇒ messages
Access the messages.
-
#messaging_service_sid ⇒ String
The unique id of the SMS Service this conversation belongs to.
-
#participants ⇒ participants
Access the participants.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, date_created: :unset, date_updated: :unset) ⇒ ConversationInstance
Update the ConversationInstance.
-
#url ⇒ String
An absolute URL for this conversation.
-
#webhooks ⇒ webhooks
Access the webhooks.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ConversationInstance
Initialize the ConversationInstance
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 322 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'chat_service_sid' => payload['chat_service_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for this conversation.
356 357 358 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 356 def account_sid @properties['account_sid'] end |
#chat_service_sid ⇒ String
Returns The unique id of the Chat Service this conversation belongs to.
362 363 364 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 362 def chat_service_sid @properties['chat_service_sid'] end |
#context ⇒ ConversationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
347 348 349 350 351 352 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 347 def context unless @instance_context @instance_context = ConversationContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created.
386 387 388 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 386 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
392 393 394 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 392 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ConversationInstance
422 423 424 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 422 def delete context.delete end |
#fetch ⇒ ConversationInstance
Fetch a ConversationInstance
429 430 431 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 429 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this conversation.
380 381 382 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 380 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
463 464 465 466 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 463 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConversationInstance #{values}>" end |
#links ⇒ String
Returns Absolute URLs to access the Participants of this Conversation.
404 405 406 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 404 def links @properties['links'] end |
#messages ⇒ messages
Access the messages
443 444 445 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 443 def context. end |
#messaging_service_sid ⇒ String
Returns The unique id of the SMS Service this conversation belongs to.
368 369 370 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 368 def messaging_service_sid @properties['messaging_service_sid'] end |
#participants ⇒ participants
Access the participants
436 437 438 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 436 def participants context.participants end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
374 375 376 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 374 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
456 457 458 459 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 456 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConversationInstance #{values}>" end |
#update(friendly_name: :unset, date_created: :unset, date_updated: :unset) ⇒ ConversationInstance
Update the ConversationInstance
415 416 417 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 415 def update(friendly_name: :unset, date_created: :unset, date_updated: :unset) context.update(friendly_name: friendly_name, date_created: date_created, date_updated: date_updated, ) end |
#url ⇒ String
Returns An absolute URL for this conversation.
398 399 400 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 398 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
450 451 452 |
# File 'lib/twilio-ruby/rest/conversations/v1/conversation.rb', line 450 def webhooks context.webhooks end |