Module: MgmtConsole::Client::SpigitConfigs
- Included in:
- MgmtConsole::Client
- Defined in:
- lib/mgmt_console/client/spigit_configs.rb
Overview
Methods for the SpigitConfigs API
Instance Method Summary collapse
-
#create_spigit_config(options = {}) ⇒ Sawyer::Resource
Create Spigit Config.
-
#spigit_configs(options = {}) ⇒ Array<Sawyer::Resource>
Get Spigit Configs list.
-
#update_spigit_config(id = nil, options = {}) ⇒ Sawyer::Resource
Update Spigit Config.
Instance Method Details
#create_spigit_config(options = {}) ⇒ Sawyer::Resource
Create Spigit Config
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/mgmt_console/client/spigit_configs.rb', line 21 def create_spigit_config( = {}) # Required engage_instance_id = .delete(:engage_instance_id) siteid = .delete(:siteid) raise MgmtConsole::BadRequest.new('You must provide the Engage Instance ID as :engage_instance_id') unless engage_instance_id raise MgmtConsole::BadRequest.new('You must provide the Site ID as :siteid') unless siteid # Optional config = .delete(:config) params = { engage_instance_id: engage_instance_id, siteid: siteid, config: config, }.reject { |k,v| v.nil? } data = post("#{api_endpoint}/spigit_configs", .merge(params)) end |
#spigit_configs(options = {}) ⇒ Array<Sawyer::Resource>
Get Spigit Configs list
12 13 14 |
# File 'lib/mgmt_console/client/spigit_configs.rb', line 12 def spigit_configs( = {}) paginate("#{api_endpoint}/spigit_configs", ) end |
#update_spigit_config(id = nil, options = {}) ⇒ Sawyer::Resource
Update Spigit Config
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/mgmt_console/client/spigit_configs.rb', line 46 def update_spigit_config(id=nil, = {}) # Required raise MgmtConsole::BadRequest.new('You must provide the Spigit Config ID as :id') unless id # Optional engage_instance_id = .delete(:engage_instance_id) siteid = .delete(:siteid) config = .delete(:config) params = { engage_instance_id: engage_instance_id, siteid: siteid, config: config, }.reject { |k,v| v.nil? } data = patch("#{api_endpoint}/spigit_configs/#{id}", .merge(params)) end |