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

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1.rb,
lib/twilio-ruby/rest/sync/v1/service.rb,
lib/twilio-ruby/rest/sync/v1/service/document.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb,
lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb

Defined Under Namespace

Classes: ServiceContext, ServiceInstance, ServiceList, ServicePage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Sync



21
22
23
24
25
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 21

def initialize(domain)
    super
    @version = 'v1'
    @services = nil
end

Instance Method Details

#services(sid = :unset) ⇒ Twilio::REST::Sync::V1::ServiceContext, Twilio::REST::Sync::V1::ServiceList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the Service resource to fetch.

Returns:



31
32
33
34
35
36
37
38
39
40
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 31

def services(sid=:unset)
    if sid.nil?
        raise ArgumentError, 'sid cannot be nil'
    end
    if sid == :unset
        @services ||= ServiceList.new self
    else
        ServiceContext.new(self, sid)
    end
end

#to_sObject

Provide a user friendly representation



43
44
45
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 43

def to_s
    '<Twilio::REST::Sync::V1>';
end