Class: Twilio::REST::Conversations::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account responsible for this service.
-
#bindings ⇒ bindings
Access the bindings.
-
#configuration ⇒ configuration
Access the configuration.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversations ⇒ conversations
Access the conversations.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#friendly_name ⇒ String
The human-readable name of this service.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Absolute URLs to access the conversations, users, roles, bindings and configuration of this service.
-
#participant_conversations ⇒ participant_conversations
Access the participant_conversations.
-
#roles ⇒ roles
Access the roles.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
An absolute URL for this service.
-
#users ⇒ users
Access the users.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 312 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_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 service.
344 345 346 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 344 def account_sid @properties['account_sid'] end |
#bindings ⇒ bindings
Access the bindings
408 409 410 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 408 def bindings context.bindings end |
#configuration ⇒ configuration
Access the configuration
429 430 431 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 429 def configuration context.configuration end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
335 336 337 338 339 340 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 335 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#conversations ⇒ conversations
Access the conversations
401 402 403 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 401 def conversations context.conversations end |
#date_created ⇒ Time
Returns The date that this resource was created.
362 363 364 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 362 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
368 369 370 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 368 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
387 388 389 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 387 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
394 395 396 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 394 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this service.
356 357 358 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 356 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
449 450 451 452 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 449 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns Absolute URLs to access the conversations, users, roles, bindings and configuration of this service.
380 381 382 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 380 def links @properties['links'] end |
#participant_conversations ⇒ participant_conversations
Access the participant_conversations
436 437 438 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 436 def participant_conversations context.participant_conversations end |
#roles ⇒ roles
Access the roles
422 423 424 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 422 def roles context.roles end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
350 351 352 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 350 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
442 443 444 445 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 442 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ServiceInstance #{values}>" end |
#url ⇒ String
Returns An absolute URL for this service.
374 375 376 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 374 def url @properties['url'] end |
#users ⇒ users
Access the users
415 416 417 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 415 def users context.users end |