Class: Twilio::REST::Preview::Sync::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Sync::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service.rb
Instance Method Summary collapse
- #account_sid ⇒ String
- #acl_enabled ⇒ Boolean
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #date_created ⇒ Time
- #date_updated ⇒ Time
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#documents ⇒ documents
Access the documents.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
- #friendly_name ⇒ String
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #links ⇒ Hash
- #reachability_webhooks_enabled ⇒ Boolean
- #sid ⇒ String
-
#sync_lists ⇒ sync_lists
Access the sync_lists.
-
#sync_maps ⇒ sync_maps
Access the sync_maps.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
- #url ⇒ String
- #webhook_url ⇒ String
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 359 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], '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
400 401 402 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 400 def account_sid @properties['account_sid'] end |
#acl_enabled ⇒ Boolean
442 443 444 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 442 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
385 386 387 388 389 390 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 385 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
412 413 414 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 412 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
418 419 420 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 418 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
455 456 457 458 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 455 def delete context.delete end |
#documents ⇒ documents
Access the documents
500 501 502 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 500 def documents context.documents end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
463 464 465 466 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 463 def fetch context.fetch end |
#friendly_name ⇒ String
406 407 408 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 406 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
520 521 522 523 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 520 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.ServiceInstance #{values}>" end |
#links ⇒ Hash
448 449 450 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 448 def links @properties['links'] end |
#reachability_webhooks_enabled ⇒ Boolean
436 437 438 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 436 def reachability_webhooks_enabled @properties['reachability_webhooks_enabled'] end |
#sid ⇒ String
394 395 396 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 394 def sid @properties['sid'] end |
#sync_lists ⇒ sync_lists
Access the sync_lists
507 508 509 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 507 def sync_lists context.sync_lists end |
#sync_maps ⇒ sync_maps
Access the sync_maps
493 494 495 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 493 def sync_maps context.sync_maps end |
#to_s ⇒ Object
Provide a user friendly representation
513 514 515 516 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 513 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.ServiceInstance #{values}>" end |
#update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 475 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
424 425 426 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 424 def url @properties['url'] end |
#webhook_url ⇒ String
430 431 432 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 430 def webhook_url @properties['webhook_url'] end |