Class: Twilio::REST::Chat::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat/v1.rb,
lib/twilio-ruby/rest/chat/v1/service.rb,
lib/twilio-ruby/rest/chat/v1/credential.rb,
lib/twilio-ruby/rest/chat/v1/service/role.rb,
lib/twilio-ruby/rest/chat/v1/service/user.rb,
lib/twilio-ruby/rest/chat/v1/service/channel.rb,
lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb,
lib/twilio-ruby/rest/chat/v1/service/channel/member.rb,
lib/twilio-ruby/rest/chat/v1/service/channel/message.rb,
lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb

Defined Under Namespace

Classes: CredentialContext, CredentialInstance, CredentialList, CredentialPage, 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 Chat


15
16
17
18
19
20
# File 'lib/twilio-ruby/rest/chat/v1.rb', line 15

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

Instance Method Details

#credentials(sid = :unset) ⇒ Twilio::REST::Chat::V1::CredentialContext, Twilio::REST::Chat::V1::CredentialList

Parameters:

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

    The Twilio-provided string that uniquely identifies the Credential resource to fetch.

Returns:


27
28
29
30
31
32
33
34
35
36
# File 'lib/twilio-ruby/rest/chat/v1.rb', line 27

def credentials(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @credentials ||= CredentialList.new self
  else
      CredentialContext.new(self, sid)
  end
end

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

Parameters:

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

    The Twilio-provided string that uniquely identifies the Service resource to fetch.

Returns:


43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/chat/v1.rb', line 43

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


56
57
58
# File 'lib/twilio-ruby/rest/chat/v1.rb', line 56

def to_s
  '<Twilio::REST::Chat::V1>'
end