class Twilio::REST::Preview::Sync::ServiceContext::DocumentInstance

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

new(version, payload, service_sid: nil, sid: nil) click to toggle source

Initialize the DocumentInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The service_sid @param [String] sid The sid @return [DocumentInstance] DocumentInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
258 def initialize(version, payload, service_sid: nil, sid: nil)
259   super(version)
260 
261   # Marshaled Properties
262   @properties = {
263       'sid' => payload['sid'],
264       'unique_name' => payload['unique_name'],
265       'account_sid' => payload['account_sid'],
266       'service_sid' => payload['service_sid'],
267       'url' => payload['url'],
268       'links' => payload['links'],
269       'revision' => payload['revision'],
270       'data' => payload['data'],
271       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
272       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
273       'created_by' => payload['created_by'],
274   }
275 
276   # Context
277   @instance_context = nil
278   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
279 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
306 def account_sid
307   @properties['account_sid']
308 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DocumentContext] DocumentContext for this DocumentInstance

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
285 def context
286   unless @instance_context
287     @instance_context = DocumentContext.new(@version, @params['service_sid'], @params['sid'], )
288   end
289   @instance_context
290 end
created_by() click to toggle source

@return [String] The created_by

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
354 def created_by
355   @properties['created_by']
356 end
data() click to toggle source

@return [Hash] The data

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
336 def data
337   @properties['data']
338 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
342 def date_created
343   @properties['date_created']
344 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
348 def date_updated
349   @properties['date_updated']
350 end
delete() click to toggle source

Delete the DocumentInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
368 def delete
369   context.delete
370 end
document_permissions() click to toggle source

Access the document_permissions @return [document_permissions] document_permissions

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
384 def document_permissions
385   context.document_permissions
386 end
fetch() click to toggle source

Fetch the DocumentInstance @return [DocumentInstance] Fetched DocumentInstance

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
361 def fetch
362   context.fetch
363 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
397 def inspect
398   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
399   "<Twilio.Preview.Sync.DocumentInstance #{values}>"
400 end
revision() click to toggle source

@return [String] The revision

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
330 def revision
331   @properties['revision']
332 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
312 def service_sid
313   @properties['service_sid']
314 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
294 def sid
295   @properties['sid']
296 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
390 def to_s
391   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
392   "<Twilio.Preview.Sync.DocumentInstance #{values}>"
393 end
unique_name() click to toggle source

@return [String] The unique_name

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
300 def unique_name
301   @properties['unique_name']
302 end
update(data: nil, if_match: :unset) click to toggle source

Update the DocumentInstance @param [Hash] data The data @param [String] if_match The If-Match HTTP request header @return [DocumentInstance] Updated DocumentInstance

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
377 def update(data: nil, if_match: :unset)
378   context.update(data: data, if_match: if_match, )
379 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/sync/service/document.rb
318 def url
319   @properties['url']
320 end