class CircuitApi::Client
Attributes
client_id[RW]
client_secret[RW]
instance_url[RW]
sandbox[RW]
token[RW]
Public Class Methods
new(client_id: nil, client_secret: nil, sandbox: nil, instance_url: nil)
click to toggle source
# File lib/circuit_api/client.rb, line 5 def initialize(client_id: nil, client_secret: nil, sandbox: nil, instance_url: nil) @client_id = client_id @client_secret = client_secret @sandbox = sandbox @instance_url = instance_url end
Public Instance Methods
api_url()
click to toggle source
# File lib/circuit_api/client.rb, line 24 def api_url URI.join(base_url, CircuitApi::API_PATH_BASE) end
base_url()
click to toggle source
# File lib/circuit_api/client.rb, line 17 def base_url return instance_url if instance_url return CircuitApi::API_SANDBOX_BASE_URL if sandbox CircuitApi::API_BASE_URL end
connect(token)
click to toggle source
# File lib/circuit_api/client.rb, line 12 def connect(token) # TODO: fetch oauth token @token = token end
conversations()
click to toggle source
# File lib/circuit_api/client.rb, line 28 def conversations CircuitApi::Resources::Conversation.new(self) end
labels()
click to toggle source
# File lib/circuit_api/client.rb, line 32 def labels CircuitApi::Resources::Label.new(self) end
message_items()
click to toggle source
# File lib/circuit_api/client.rb, line 40 def message_items CircuitApi::Resources::MessageItem.new(self) end
messages()
click to toggle source
# File lib/circuit_api/client.rb, line 36 def messages CircuitApi::Resources::Message.new(self) end
presence()
click to toggle source
# File lib/circuit_api/client.rb, line 44 def presence CircuitApi::Resources::Presence.new(self) end
rtc_sessions()
click to toggle source
# File lib/circuit_api/client.rb, line 48 def rtc_sessions CircuitApi::Resources::RtcSession.new(self) end
users()
click to toggle source
# File lib/circuit_api/client.rb, line 52 def users CircuitApi::Resources::User.new(self) end
webhooks()
click to toggle source
# File lib/circuit_api/client.rb, line 56 def webhooks CircuitApi::Resources::Webhook.new(self) end