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
True or false - determines whether token identities must be granted access to Sync objects via the Permissions API in this Service.
-
#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
Human-readable name for this service instance.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#reachability_debouncing_enabled ⇒ Boolean
True or false - Determines whether transient disconnections (i.e. an immediate reconnect succeeds) cause reachability webhooks.
-
#reachability_debouncing_window ⇒ String
Determines how long an identity must be offline before reachability webhooks fire.
-
#reachability_webhooks_enabled ⇒ Boolean
True or false - controls whether this instance fires webhooks when client endpoints connect to Sync.
-
#sid ⇒ String
A unique identifier for this service instance.
-
#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, reachability_debouncing_enabled: :unset, reachability_debouncing_window: :unset, webhooks_from_rest_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The url.
-
#webhook_url ⇒ String
A URL that will receive event updates when objects are manipulated.
-
#webhooks_from_rest_enabled ⇒ Boolean
True or false - controls whether this instance fires webhooks when Sync objects are updated through REST.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 385 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'], 'webhooks_from_rest_enabled' => payload['webhooks_from_rest_enabled'], 'reachability_webhooks_enabled' => payload['reachability_webhooks_enabled'], 'acl_enabled' => payload['acl_enabled'], 'reachability_debouncing_enabled' => payload['reachability_debouncing_enabled'], 'reachability_debouncing_window' => payload['reachability_debouncing_window'].to_i, 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
436 437 438 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 436 def account_sid @properties['account_sid'] end |
#acl_enabled ⇒ Boolean
Returns true or false - determines whether token identities must be granted access to Sync objects via the Permissions API in this Service.
484 485 486 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 484 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
415 416 417 418 419 420 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 415 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
448 449 450 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 448 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
454 455 456 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 454 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
516 517 518 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 516 def delete context.delete end |
#documents ⇒ documents
Access the documents
563 564 565 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 563 def documents context.documents end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
509 510 511 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 509 def fetch context.fetch end |
#friendly_name ⇒ String
Returns Human-readable name for this service instance.
442 443 444 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 442 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
597 598 599 600 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 597 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
502 503 504 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 502 def links @properties['links'] end |
#reachability_debouncing_enabled ⇒ Boolean
Returns true or false - Determines whether transient disconnections (i.e. an immediate reconnect succeeds) cause reachability webhooks.
490 491 492 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 490 def reachability_debouncing_enabled @properties['reachability_debouncing_enabled'] end |
#reachability_debouncing_window ⇒ String
Returns Determines how long an identity must be offline before reachability webhooks fire.
496 497 498 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 496 def reachability_debouncing_window @properties['reachability_debouncing_window'] end |
#reachability_webhooks_enabled ⇒ Boolean
Returns true or false - controls whether this instance fires webhooks when client endpoints connect to Sync.
478 479 480 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 478 def reachability_webhooks_enabled @properties['reachability_webhooks_enabled'] end |
#sid ⇒ String
Returns A unique identifier for this service instance.
424 425 426 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 424 def sid @properties['sid'] end |
#sync_lists ⇒ sync_lists
Access the sync_lists
570 571 572 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 570 def sync_lists context.sync_lists end |
#sync_maps ⇒ sync_maps
Access the sync_maps
577 578 579 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 577 def sync_maps context.sync_maps end |
#sync_streams ⇒ sync_streams
Access the sync_streams
584 585 586 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 584 def sync_streams context.sync_streams end |
#to_s ⇒ Object
Provide a user friendly representation
590 591 592 593 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 590 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique_name.
430 431 432 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 430 def unique_name @properties['unique_name'] end |
#update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset, reachability_debouncing_enabled: :unset, reachability_debouncing_window: :unset, webhooks_from_rest_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 548 def update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset, reachability_debouncing_enabled: :unset, reachability_debouncing_window: :unset, webhooks_from_rest_enabled: :unset) context.update( webhook_url: webhook_url, friendly_name: friendly_name, reachability_webhooks_enabled: reachability_webhooks_enabled, acl_enabled: acl_enabled, reachability_debouncing_enabled: reachability_debouncing_enabled, reachability_debouncing_window: reachability_debouncing_window, webhooks_from_rest_enabled: webhooks_from_rest_enabled, ) end |
#url ⇒ String
Returns The url.
460 461 462 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 460 def url @properties['url'] end |
#webhook_url ⇒ String
Returns A URL that will receive event updates when objects are manipulated.
466 467 468 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 466 def webhook_url @properties['webhook_url'] end |
#webhooks_from_rest_enabled ⇒ Boolean
Returns true or false - controls whether this instance fires webhooks when Sync objects are updated through REST.
472 473 474 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 472 def webhooks_from_rest_enabled @properties['webhooks_from_rest_enabled'] end |