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
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 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 and Bindings of this Service.
-
#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
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 304 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.
336 337 338 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 336 def account_sid @properties['account_sid'] end |
#bindings ⇒ bindings
Access the bindings
400 401 402 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 400 def bindings context.bindings end |
#configuration ⇒ configuration
Access the configuration
421 422 423 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 421 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
327 328 329 330 331 332 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 327 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#conversations ⇒ conversations
Access the conversations
393 394 395 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 393 def conversations context.conversations end |
#date_created ⇒ Time
Returns The date that this resource was created.
354 355 356 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 354 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
360 361 362 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 360 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
379 380 381 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 379 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
386 387 388 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 386 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this service.
348 349 350 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 348 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
434 435 436 437 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 434 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 and Bindings of this Service.
372 373 374 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 372 def links @properties['links'] end |
#roles ⇒ roles
Access the roles
414 415 416 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 414 def roles context.roles end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
342 343 344 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 342 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
427 428 429 430 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 427 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.
366 367 368 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 366 def url @properties['url'] end |
#users ⇒ users
Access the users
407 408 409 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 407 def users context.users end |