Class: Twilio::REST::Sync::V1::ServiceInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/sync/v1/service.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ServiceInstance

Initialize the ServiceInstance



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 358

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_sidString



409
410
411
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 409

def 
  @properties['account_sid']
end

#acl_enabledBoolean



457
458
459
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 457

def acl_enabled
  @properties['acl_enabled']
end

#contextServiceContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



388
389
390
391
392
393
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 388

def context
  unless @instance_context
    @instance_context = ServiceContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#date_createdTime



421
422
423
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 421

def date_created
  @properties['date_created']
end

#date_updatedTime



427
428
429
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 427

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the ServiceInstance



489
490
491
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 489

def delete
  context.delete
end

#documentsdocuments

Access the documents



535
536
537
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 535

def documents
  context.documents
end

#fetchServiceInstance

Fetch the ServiceInstance



482
483
484
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 482

def fetch
  context.fetch
end

#friendly_nameString



415
416
417
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 415

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



569
570
571
572
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 569

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Sync.V1.ServiceInstance #{values}>"
end


475
476
477
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 475

def links
  @properties['links']
end

#reachability_debouncing_enabledBoolean



463
464
465
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 463

def reachability_debouncing_enabled
  @properties['reachability_debouncing_enabled']
end

#reachability_debouncing_windowString



469
470
471
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 469

def reachability_debouncing_window
  @properties['reachability_debouncing_window']
end

#reachability_webhooks_enabledBoolean



451
452
453
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 451

def reachability_webhooks_enabled
  @properties['reachability_webhooks_enabled']
end

#sidString



397
398
399
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 397

def sid
  @properties['sid']
end

#sync_listssync_lists

Access the sync_lists



542
543
544
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 542

def sync_lists
  context.sync_lists
end

#sync_mapssync_maps

Access the sync_maps



549
550
551
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 549

def sync_maps
  context.sync_maps
end

#sync_streamssync_streams

Access the sync_streams



556
557
558
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 556

def sync_streams
  context.sync_streams
end

#to_sObject

Provide a user friendly representation



562
563
564
565
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 562

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Sync.V1.ServiceInstance #{values}>"
end

#unique_nameString



403
404
405
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 403

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



520
521
522
523
524
525
526
527
528
529
530
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 520

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

#urlString



433
434
435
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 433

def url
  @properties['url']
end

#webhook_urlString



439
440
441
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 439

def webhook_url
  @properties['webhook_url']
end

#webhooks_from_rest_enabledBoolean



445
446
447
# File 'lib/twilio-ruby/rest/sync/v1/service.rb', line 445

def webhooks_from_rest_enabled
  @properties['webhooks_from_rest_enabled']
end