class Morpheus::OptionTypesInterface
Public Instance Methods
create(payload)
click to toggle source
# File lib/morpheus/api/option_types_interface.rb, line 21 def create(payload) url = "#{@base_url}/api/library/option-types" headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :post, url: url, headers: headers, payload: payload.to_json} execute(opts) end
destroy(id)
click to toggle source
# File lib/morpheus/api/option_types_interface.rb, line 35 def destroy(id) url = "#{@base_url}/api/library/option-types/#{id}" headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :delete, url: url, headers: headers} execute(opts) end
get(id)
click to toggle source
# File lib/morpheus/api/option_types_interface.rb, line 5 def get(id) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' url = "#{@base_url}/api/library/option-types/#{id}" headers = { params: {}, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
list(params={})
click to toggle source
# File lib/morpheus/api/option_types_interface.rb, line 13 def list(params={}) url = "#{@base_url}/api/library/option-types" headers = { params: {}, authorization: "Bearer #{@access_token}" } headers[:params].merge!(params) opts = {method: :get, url: url, headers: headers} execute(opts) end
update(id, payload)
click to toggle source
# File lib/morpheus/api/option_types_interface.rb, line 28 def update(id, payload) url = "#{@base_url}/api/library/option-types/#{id}" headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end