Class: CircuitApi::Client
- Inherits:
- 
      Object
      
        - Object
- CircuitApi::Client
 
- Defined in:
- lib/circuit_api/client.rb
Instance Attribute Summary collapse
- 
  
    
      #client_id  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute client_id. 
- 
  
    
      #client_secret  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute client_secret. 
- 
  
    
      #instance_url  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute instance_url. 
- 
  
    
      #sandbox  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute sandbox. 
- 
  
    
      #token  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute token. 
Instance Method Summary collapse
- #api_url ⇒ Object
- #base_url ⇒ Object
- #connect(token) ⇒ Object
- #conversations ⇒ Object
- 
  
    
      #initialize(client_id: nil, client_secret: nil, sandbox: nil, instance_url: nil)  ⇒ Client 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Client. 
- #labels ⇒ Object
- #message_items ⇒ Object
- #messages ⇒ Object
- #presence ⇒ Object
- #rtc_sessions ⇒ Object
- #users ⇒ Object
- #webhooks ⇒ Object
Constructor Details
#initialize(client_id: nil, client_secret: nil, sandbox: nil, instance_url: nil) ⇒ Client
Returns a new instance of Client.
| 5 6 7 8 9 10 | # 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 | 
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
| 3 4 5 | # File 'lib/circuit_api/client.rb', line 3 def client_id @client_id end | 
#client_secret ⇒ Object
Returns the value of attribute client_secret.
| 3 4 5 | # File 'lib/circuit_api/client.rb', line 3 def client_secret @client_secret end | 
#instance_url ⇒ Object
Returns the value of attribute instance_url.
| 3 4 5 | # File 'lib/circuit_api/client.rb', line 3 def instance_url @instance_url end | 
#sandbox ⇒ Object
Returns the value of attribute sandbox.
| 3 4 5 | # File 'lib/circuit_api/client.rb', line 3 def sandbox @sandbox end | 
#token ⇒ Object
Returns the value of attribute token.
| 3 4 5 | # File 'lib/circuit_api/client.rb', line 3 def token @token end | 
Instance Method Details
#api_url ⇒ Object
| 24 25 26 | # File 'lib/circuit_api/client.rb', line 24 def api_url URI.join(base_url, CircuitApi::API_PATH_BASE) end | 
#base_url ⇒ Object
| 17 18 19 20 21 22 | # 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) ⇒ Object
| 12 13 14 15 | # File 'lib/circuit_api/client.rb', line 12 def connect(token) # TODO: fetch oauth token @token = token end | 
#conversations ⇒ Object
| 28 29 30 | # File 'lib/circuit_api/client.rb', line 28 def conversations CircuitApi::Resources::Conversation.new(self) end | 
#labels ⇒ Object
| 32 33 34 | # File 'lib/circuit_api/client.rb', line 32 def labels CircuitApi::Resources::Label.new(self) end | 
#message_items ⇒ Object
| 40 41 42 | # File 'lib/circuit_api/client.rb', line 40 def CircuitApi::Resources::MessageItem.new(self) end | 
#messages ⇒ Object
| 36 37 38 | # File 'lib/circuit_api/client.rb', line 36 def CircuitApi::Resources::Message.new(self) end | 
#presence ⇒ Object
| 44 45 46 | # File 'lib/circuit_api/client.rb', line 44 def presence CircuitApi::Resources::Presence.new(self) end | 
#rtc_sessions ⇒ Object
| 48 49 50 | # File 'lib/circuit_api/client.rb', line 48 def rtc_sessions CircuitApi::Resources::RtcSession.new(self) end | 
#users ⇒ Object
| 52 53 54 | # File 'lib/circuit_api/client.rb', line 52 def users CircuitApi::Resources::User.new(self) end | 
#webhooks ⇒ Object
| 56 57 58 | # File 'lib/circuit_api/client.rb', line 56 def webhooks CircuitApi::Resources::Webhook.new(self) end |