Class: Twilio::REST::Sync::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Sync::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/sync/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 account_sid.
-
#acl_enabled ⇒ Boolean
The acl_enabled.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#documents ⇒ documents
Access the documents.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The friendly_name.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#reachability_webhooks_enabled ⇒ Boolean
The reachability_webhooks_enabled.
-
#sid ⇒ String
The sid.
-
#sync_lists ⇒ sync_lists
Access the sync_lists.
-
#sync_maps ⇒ sync_maps
Access the sync_maps.
-
#sync_streams ⇒ sync_streams
Access the sync_streams.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
The unique_name.
-
#update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The url.
-
#webhook_url ⇒ String
The webhook_url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 379 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_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'], 'webhook_url' => payload['webhook_url'], 'reachability_webhooks_enabled' => payload['reachability_webhooks_enabled'], 'acl_enabled' => payload['acl_enabled'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
432 433 434 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 432 def account_sid @properties['account_sid'] end |
#acl_enabled ⇒ Boolean
Returns The acl_enabled.
474 475 476 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 474 def acl_enabled @properties['acl_enabled'] 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
408 409 410 411 412 413 414 415 416 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 408 def context unless @instance_context @instance_context = ServiceContext.new( @version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
444 445 446 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 444 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
450 451 452 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 450 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
494 495 496 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 494 def delete context.delete end |
#documents ⇒ documents
Access the documents
517 518 519 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 517 def documents context.documents end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
487 488 489 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 487 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
438 439 440 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 438 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
551 552 553 554 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 551 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
480 481 482 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 480 def links @properties['links'] end |
#reachability_webhooks_enabled ⇒ Boolean
Returns The reachability_webhooks_enabled.
468 469 470 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 468 def reachability_webhooks_enabled @properties['reachability_webhooks_enabled'] end |
#sid ⇒ String
Returns The sid.
420 421 422 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 420 def sid @properties['sid'] end |
#sync_lists ⇒ sync_lists
Access the sync_lists
524 525 526 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 524 def sync_lists context.sync_lists end |
#sync_maps ⇒ sync_maps
Access the sync_maps
531 532 533 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 531 def sync_maps context.sync_maps end |
#sync_streams ⇒ sync_streams
Access the sync_streams
538 539 540 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 538 def sync_streams context.sync_streams end |
#to_s ⇒ Object
Provide a user friendly representation
544 545 546 547 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 544 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique_name.
426 427 428 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 426 def unique_name @properties['unique_name'] end |
#update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
505 506 507 508 509 510 511 512 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 505 def update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) context.update( webhook_url: webhook_url, friendly_name: friendly_name, reachability_webhooks_enabled: reachability_webhooks_enabled, acl_enabled: acl_enabled, ) end |
#url ⇒ String
Returns The url.
456 457 458 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 456 def url @properties['url'] end |
#webhook_url ⇒ String
Returns The webhook_url.
462 463 464 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 462 def webhook_url @properties['webhook_url'] end |