class Morpheus::OptionTypeListsInterface

Public Instance Methods

base_path() click to toggle source
# File lib/morpheus/api/option_type_lists_interface.rb, line 5
def base_path
  "/api/library/option-type-lists"
end
create(payload) click to toggle source
# File lib/morpheus/api/option_type_lists_interface.rb, line 33
def create(payload)
  url = "#{base_path}"
  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_type_lists_interface.rb, line 47
def destroy(id)
  url = "#{base_path}/#{id}"
  headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  opts = {method: :delete, url: url, headers: headers}
  execute(opts)
end
get(id, params={}) click to toggle source
# File lib/morpheus/api/option_type_lists_interface.rb, line 9
def get(id, params={})
  raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
  url = "#{base_path}/#{id}"
  headers = { params: 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_type_lists_interface.rb, line 17
def list(params={})
  url = "#{base_path}"
  headers = { params: {}, authorization: "Bearer #{@access_token}" }
  headers[:params].merge!(params)
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end
list_items(id, params={}) click to toggle source
# File lib/morpheus/api/option_type_lists_interface.rb, line 25
def list_items(id, params={})
  raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
  url = "#{base_path}/#{id}/items"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  opts = {method: :get, url: url, headers: headers}
  execute(opts)
end
update(id, payload) click to toggle source
# File lib/morpheus/api/option_type_lists_interface.rb, line 40
def update(id, payload)
  url = "#{base_path}/#{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