Class: Twilio::REST::Messaging::V1::SessionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::SessionInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/session.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 SID of the Account that created the resource.
-
#attributes ⇒ String
The JSON string that stores application-specific data.
-
#context ⇒ SessionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_by ⇒ String
The Identity of the session’s creator.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the SessionInstance.
-
#fetch ⇒ SessionInstance
Fetch a SessionInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, sid: nil) ⇒ SessionInstance
constructor
Initialize the SessionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The absolute URLs of the Participants, Interactions, and Messages for the Session.
-
#messages ⇒ messages
Access the messages.
-
#messaging_service_sid ⇒ String
The SID of the SMS Service the session belongs to.
-
#participants ⇒ participants
Access the participants.
-
#service_sid ⇒ String
The SID of the Service that the resource is associated with.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset) ⇒ SessionInstance
Update the SessionInstance.
-
#url ⇒ String
The absolute URL of the session.
-
#webhooks ⇒ webhooks
Access the webhooks.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SessionInstance
Initialize the SessionInstance
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 337 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'friendly_name' => payload['friendly_name'], 'attributes' => payload['attributes'], 'created_by' => payload['created_by'], '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 SID of the Account that created the resource.
379 380 381 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 379 def account_sid @properties['account_sid'] end |
#attributes ⇒ String
Returns The JSON string that stores application-specific data.
403 404 405 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 403 def attributes @properties['attributes'] end |
#context ⇒ SessionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
364 365 366 367 368 369 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 364 def context unless @instance_context @instance_context = SessionContext.new(@version, @params['sid'], ) end @instance_context end |
#created_by ⇒ String
Returns The Identity of the session’s creator.
409 410 411 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 409 def created_by @properties['created_by'] end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
415 416 417 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 415 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
421 422 423 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 421 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the SessionInstance
447 448 449 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 447 def delete context.delete end |
#fetch ⇒ SessionInstance
Fetch a SessionInstance
440 441 442 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 440 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
397 398 399 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 397 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
505 506 507 508 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 505 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.SessionInstance #{values}>" end |
#links ⇒ String
Returns The absolute URLs of the Participants, Interactions, and Messages for the Session.
433 434 435 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 433 def links @properties['links'] end |
#messages ⇒ messages
Access the messages
485 486 487 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 485 def context. end |
#messaging_service_sid ⇒ String
Returns The SID of the SMS Service the session belongs to.
391 392 393 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 391 def messaging_service_sid @properties['messaging_service_sid'] end |
#participants ⇒ participants
Access the participants
478 479 480 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 478 def participants context.participants end |
#service_sid ⇒ String
Returns The SID of the Service that the resource is associated with.
385 386 387 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 385 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
373 374 375 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 373 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
498 499 500 501 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 498 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.SessionInstance #{values}>" end |
#update(friendly_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset) ⇒ SessionInstance
Update the SessionInstance
465 466 467 468 469 470 471 472 473 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 465 def update(friendly_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset) context.update( friendly_name: friendly_name, attributes: attributes, date_created: date_created, date_updated: date_updated, created_by: created_by, ) end |
#url ⇒ String
Returns The absolute URL of the session.
427 428 429 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 427 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
492 493 494 |
# File 'lib/twilio-ruby/rest/messaging/v1/session.rb', line 492 def webhooks context.webhooks end |