class Twilio::REST::Preview::Sync::ServiceInstance
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 help@twilio.com.
Public Class Methods
Initialize the ServiceInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The sid @return [ServiceInstance] ServiceInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/sync/service.rb 301 def initialize(version, payload, sid: nil) 302 super(version) 303 304 # Marshaled Properties 305 @properties = { 306 'sid' => payload['sid'], 307 'account_sid' => payload['account_sid'], 308 'friendly_name' => payload['friendly_name'], 309 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 310 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 311 'url' => payload['url'], 312 'webhook_url' => payload['webhook_url'], 313 'reachability_webhooks_enabled' => payload['reachability_webhooks_enabled'], 314 'acl_enabled' => payload['acl_enabled'], 315 'links' => payload['links'], 316 } 317 318 # Context 319 @instance_context = nil 320 @params = {'sid' => sid || @properties['sid'], } 321 end
Public Instance Methods
@return [String] The account_sid
# File lib/twilio-ruby/rest/preview/sync/service.rb 342 def account_sid 343 @properties['account_sid'] 344 end
@return [Boolean] The acl_enabled
# File lib/twilio-ruby/rest/preview/sync/service.rb 384 def acl_enabled 385 @properties['acl_enabled'] 386 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ServiceContext] ServiceContext
for this ServiceInstance
# File lib/twilio-ruby/rest/preview/sync/service.rb 327 def context 328 unless @instance_context 329 @instance_context = ServiceContext.new(@version, @params['sid'], ) 330 end 331 @instance_context 332 end
@return [Time] The date_created
# File lib/twilio-ruby/rest/preview/sync/service.rb 354 def date_created 355 @properties['date_created'] 356 end
@return [Time] The date_updated
# File lib/twilio-ruby/rest/preview/sync/service.rb 360 def date_updated 361 @properties['date_updated'] 362 end
Delete the ServiceInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/sync/service.rb 404 def delete 405 context.delete 406 end
Access the documents @return [documents] documents
# File lib/twilio-ruby/rest/preview/sync/service.rb 427 def documents 428 context.documents 429 end
Fetch the ServiceInstance
@return [ServiceInstance] Fetched ServiceInstance
# File lib/twilio-ruby/rest/preview/sync/service.rb 397 def fetch 398 context.fetch 399 end
@return [String] The friendly_name
# File lib/twilio-ruby/rest/preview/sync/service.rb 348 def friendly_name 349 @properties['friendly_name'] 350 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service.rb 454 def inspect 455 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 456 "<Twilio.Preview.Sync.ServiceInstance #{values}>" 457 end
@return [String] The links
# File lib/twilio-ruby/rest/preview/sync/service.rb 390 def links 391 @properties['links'] 392 end
@return [Boolean] The reachability_webhooks_enabled
# File lib/twilio-ruby/rest/preview/sync/service.rb 378 def reachability_webhooks_enabled 379 @properties['reachability_webhooks_enabled'] 380 end
@return [String] The sid
# File lib/twilio-ruby/rest/preview/sync/service.rb 336 def sid 337 @properties['sid'] 338 end
Access the sync_lists
@return [sync_lists] sync_lists
# File lib/twilio-ruby/rest/preview/sync/service.rb 434 def sync_lists 435 context.sync_lists 436 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service.rb 447 def to_s 448 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 449 "<Twilio.Preview.Sync.ServiceInstance #{values}>" 450 end
Update the ServiceInstance
@param [String] webhook_url
The webhook_url
@param [String] friendly_name
The friendly_name
@param [Boolean] reachability_webhooks_enabled
The reachability_webhooks_enabled
@param [Boolean] acl_enabled
The acl_enabled
@return [ServiceInstance] Updated ServiceInstance
# File lib/twilio-ruby/rest/preview/sync/service.rb 415 def update(webhook_url: :unset, friendly_name: :unset, reachability_webhooks_enabled: :unset, acl_enabled: :unset) 416 context.update( 417 webhook_url: webhook_url, 418 friendly_name: friendly_name, 419 reachability_webhooks_enabled: reachability_webhooks_enabled, 420 acl_enabled: acl_enabled, 421 ) 422 end
@return [String] The url
# File lib/twilio-ruby/rest/preview/sync/service.rb 366 def url 367 @properties['url'] 368 end
@return [String] The webhook_url
# File lib/twilio-ruby/rest/preview/sync/service.rb 372 def webhook_url 373 @properties['webhook_url'] 374 end