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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
-
#acl_enabled ⇒ Boolean
Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](www.twilio.com/docs/sync/api/sync-permissions) resource.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#documents ⇒ documents
Access the documents.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#reachability_debouncing_enabled ⇒ Boolean
Whether every ‘endpoint_disconnected` event should occur after a configurable delay.
-
#reachability_debouncing_window ⇒ String
The reachability event delay in milliseconds if ‘reachability_debouncing_enabled` = `true`.
-
#reachability_webhooks_enabled ⇒ Boolean
Whether the service instance calls ‘webhook_url` when client endpoints connect to Sync.
-
#sid ⇒ String
The unique string that we created to identify the Service resource.
-
#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
An application-defined string that uniquely identifies the resource.
-
#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 absolute URL of the Service resource.
-
#webhook_url ⇒ String
The URL we call when Sync objects are manipulated.
-
#webhooks_from_rest_enabled ⇒ Boolean
Whether the Service instance should call ‘webhook_url` when the REST API is used to update Sync objects.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 371 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'] == nil ? payload['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 SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
422 423 424 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 422 def account_sid @properties['account_sid'] end |
#acl_enabled ⇒ Boolean
Returns Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](www.twilio.com/docs/sync/api/sync-permissions) resource. It is disabled (false) by default.
470 471 472 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 470 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
401 402 403 404 405 406 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 401 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
434 435 436 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 434 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
440 441 442 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 440 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
495 496 497 498 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 495 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 the ServiceInstance
503 504 505 506 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 503 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
428 429 430 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 428 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
576 577 578 579 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 576 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
488 489 490 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 488 def links @properties['links'] end |
#reachability_debouncing_enabled ⇒ Boolean
Returns Whether every ‘endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event.
476 477 478 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 476 def reachability_debouncing_enabled @properties['reachability_debouncing_enabled'] end |
#reachability_debouncing_window ⇒ String
Returns The reachability event delay in milliseconds if ‘reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before `webhook_url` is called, if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the reachability event from occurring.
482 483 484 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 482 def reachability_debouncing_window @properties['reachability_debouncing_window'] end |
#reachability_webhooks_enabled ⇒ Boolean
Returns Whether the service instance calls ‘webhook_url` when client endpoints connect to Sync. The default is `false`.
464 465 466 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 464 def reachability_webhooks_enabled @properties['reachability_webhooks_enabled'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Service resource.
410 411 412 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 410 def sid @properties['sid'] end |
#sync_lists ⇒ sync_lists
Access the sync_lists
549 550 551 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 549 def sync_lists context.sync_lists end |
#sync_maps ⇒ sync_maps
Access the sync_maps
556 557 558 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 556 def sync_maps context.sync_maps end |
#sync_streams ⇒ sync_streams
Access the sync_streams
542 543 544 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 542 def sync_streams context.sync_streams end |
#to_s ⇒ Object
Provide a user friendly representation
569 570 571 572 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 569 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s ‘sid` in the URL to address the resource. It is a read-only property, it cannot be assigned using REST API.
416 417 418 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 416 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
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 518 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 absolute URL of the Service resource.
446 447 448 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 446 def url @properties['url'] end |
#webhook_url ⇒ String
Returns The URL we call when Sync objects are manipulated.
452 453 454 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 452 def webhook_url @properties['webhook_url'] end |
#webhooks_from_rest_enabled ⇒ Boolean
Returns Whether the Service instance should call ‘webhook_url` when the REST API is used to update Sync objects. The default is `false`.
458 459 460 |
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 458 def webhooks_from_rest_enabled @properties['webhooks_from_rest_enabled'] end |