Class: Twilio::REST::Chat

Inherits:
Domain
  • Object
show all
Defined in:
lib/twilio-ruby/rest/chat.rb,
lib/twilio-ruby/rest/chat/v1.rb,
lib/twilio-ruby/rest/chat/v2.rb,
lib/twilio-ruby/rest/chat/v1/service.rb,
lib/twilio-ruby/rest/chat/v2/service.rb,
lib/twilio-ruby/rest/chat/v1/credential.rb,
lib/twilio-ruby/rest/chat/v2/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/v2/service/role.rb,
lib/twilio-ruby/rest/chat/v2/service/user.rb,
lib/twilio-ruby/rest/chat/v1/service/channel.rb,
lib/twilio-ruby/rest/chat/v2/service/binding.rb,
lib/twilio-ruby/rest/chat/v2/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/v2/service/channel/invite.rb,
lib/twilio-ruby/rest/chat/v2/service/channel/member.rb,
lib/twilio-ruby/rest/chat/v1/service/channel/message.rb,
lib/twilio-ruby/rest/chat/v2/service/channel/message.rb,
lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb,
lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb,
lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb,
lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb

Defined Under Namespace

Classes: V1, V2

Instance Attribute Summary

Attributes inherited from Domain

#client

Instance Method Summary collapse

Methods inherited from Domain

#absolute_url, #request

Constructor Details

#initialize(twilio) ⇒ Chat

Initialize the Chat Domain


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/twilio-ruby/rest/chat.rb', line 14

def initialize(twilio)
  super

  @base_url = 'https://chat.twilio.com'
  @host = 'chat.twilio.com'
  @port = 443

  # Versions
  @v1 = nil
  @v2 = nil
end

Instance Method Details

#credentials(sid = :unset) ⇒ Twilio::REST::Chat::V2::CredentialInstance, Twilio::REST::Chat::V2::CredentialList

Parameters:

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

    The unique string that we created to identify the Credential resource.

Returns:


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

def credentials(sid=:unset)
  self.v2.credentials(sid)
end

#services(sid = :unset) ⇒ Twilio::REST::Chat::V2::ServiceInstance, Twilio::REST::Chat::V2::ServiceList

Parameters:

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

    The unique string that we created to identify the Service resource.

Returns:


52
53
54
# File 'lib/twilio-ruby/rest/chat.rb', line 52

def services(sid=:unset)
  self.v2.services(sid)
end

#to_sObject

Provide a user friendly representation


58
59
60
# File 'lib/twilio-ruby/rest/chat.rb', line 58

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

#v1Object

Version v1 of chat


28
29
30
# File 'lib/twilio-ruby/rest/chat.rb', line 28

def v1
  @v1 ||= V1.new self
end

#v2Object

Version v2 of chat


34
35
36
# File 'lib/twilio-ruby/rest/chat.rb', line 34

def v2
  @v2 ||= V2.new self
end