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
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
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.
-
#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
The url.
-
#webhook_url ⇒ String
The webhook_url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 318 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
Returns The account_sid.
359 360 361 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 359 def account_sid @properties['account_sid'] end |
#acl_enabled ⇒ Boolean
Returns The acl_enabled.
401 402 403 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 401 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
344 345 346 347 348 349 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 344 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
371 372 373 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 371 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
377 378 379 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 377 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
421 422 423 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 421 def delete context.delete end |
#documents ⇒ documents
Access the documents
444 445 446 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 444 def documents context.documents end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
414 415 416 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 414 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
365 366 367 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 365 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
471 472 473 474 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 471 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
407 408 409 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 407 def links @properties['links'] end |
#reachability_webhooks_enabled ⇒ Boolean
Returns The reachability_webhooks_enabled.
395 396 397 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 395 def reachability_webhooks_enabled @properties['reachability_webhooks_enabled'] end |
#sid ⇒ String
Returns The sid.
353 354 355 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 353 def sid @properties['sid'] end |
#sync_lists ⇒ sync_lists
Access the sync_lists
451 452 453 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 451 def sync_lists context.sync_lists end |
#sync_maps ⇒ sync_maps
Access the sync_maps
458 459 460 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 458 def sync_maps context.sync_maps end |
#to_s ⇒ Object
Provide a user friendly representation
464 465 466 467 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 464 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
432 433 434 435 436 437 438 439 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 432 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.
383 384 385 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 383 def url @properties['url'] end |
#webhook_url ⇒ String
Returns The webhook_url.
389 390 391 |
# File 'lib/twilio-ruby/rest/preview/sync/service.rb', line 389 def webhook_url @properties['webhook_url'] end |