Class: MagicWrite::Agents
- Inherits:
-
Object
- Object
- MagicWrite::Agents
- Defined in:
- lib/magicwrite/agents.rb
Instance Method Summary collapse
- #create(parameters: {}) ⇒ Object
- #delete(id:) ⇒ Object
-
#initialize(client:) ⇒ Agents
constructor
A new instance of Agents.
- #list(parameters: {}) ⇒ Object
- #public_create(company_id:, agent_id:, parameters: {}) ⇒ Object
- #public_list(company_id:, parameters: {}) ⇒ Object
- #public_retrieve(company_id:, agent_id:) ⇒ Object
- #retrieve(id:) ⇒ Object
- #update(id:, parameters: {}) ⇒ Object
Constructor Details
#initialize(client:) ⇒ Agents
Returns a new instance of Agents.
3 4 5 |
# File 'lib/magicwrite/agents.rb', line 3 def initialize(client:) @client = client end |
Instance Method Details
#create(parameters: {}) ⇒ Object
11 12 13 |
# File 'lib/magicwrite/agents.rb', line 11 def create(parameters: {}) client.json_post(path: '/agents', parameters: parameters) end |
#delete(id:) ⇒ Object
23 24 25 |
# File 'lib/magicwrite/agents.rb', line 23 def delete(id:) client.delete(path: "/agents/#{id}") end |
#list(parameters: {}) ⇒ Object
7 8 9 |
# File 'lib/magicwrite/agents.rb', line 7 def list(parameters: {}) client.get(path: '/agents', parameters: parameters) end |
#public_create(company_id:, agent_id:, parameters: {}) ⇒ Object
35 36 37 |
# File 'lib/magicwrite/agents.rb', line 35 def public_create(company_id:, agent_id:, parameters: {}) client.json_post(path: "/agents/#{company_id}/#{agent_id}", parameters: parameters) end |
#public_list(company_id:, parameters: {}) ⇒ Object
27 28 29 |
# File 'lib/magicwrite/agents.rb', line 27 def public_list(company_id:, parameters: {}) client.get(path: "/agents/#{company_id}", parameters: parameters) end |
#public_retrieve(company_id:, agent_id:) ⇒ Object
31 32 33 |
# File 'lib/magicwrite/agents.rb', line 31 def public_retrieve(company_id:, agent_id:) client.get(path: "/agents/#{company_id}/#{agent_id}") end |
#retrieve(id:) ⇒ Object
15 16 17 |
# File 'lib/magicwrite/agents.rb', line 15 def retrieve(id:) client.get(path: "/agents/#{id}") end |
#update(id:, parameters: {}) ⇒ Object
19 20 21 |
# File 'lib/magicwrite/agents.rb', line 19 def update(id:, parameters: {}) client.json_put(path: "/agents/#{id}", parameters: parameters) end |