class Bfwd::UnitofmeasureApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_unit_of_measure(unit_of_measure, opts = {}) click to toggle source

Create a unit-of-measure. {"nickname":"Create a new unit of measure","request":"createUnitOfMeasureRequest.html","response":"createUnitOfMeasureResponse.html"} @param unit_of_measure The unit-of-measure object to be created. @param [Hash] opts the optional parameters @return [UnitOfMeasurePagedMetadata]

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 28
def create_unit_of_measure(unit_of_measure, opts = {})
  data, _status_code, _headers = create_unit_of_measure_with_http_info(unit_of_measure, opts)
  return data
end
create_unit_of_measure_with_http_info(unit_of_measure, opts = {}) click to toggle source

Create a unit-of-measure. {&quot;nickname&quot;:&quot;Create a new unit of measure&quot;,&quot;request&quot;:&quot;createUnitOfMeasureRequest.html&quot;,&quot;response&quot;:&quot;createUnitOfMeasureResponse.html&quot;} @param unit_of_measure The unit-of-measure object to be created. @param [Hash] opts the optional parameters @return [Array<(UnitOfMeasurePagedMetadata, Fixnum, Hash)>] UnitOfMeasurePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 38
def create_unit_of_measure_with_http_info(unit_of_measure, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UnitofmeasureApi.create_unit_of_measure ..."
  end
  # verify the required parameter 'unit_of_measure' is set
  if @api_client.config.client_side_validation && unit_of_measure.nil?
    fail ArgumentError, "Missing the required parameter 'unit_of_measure' when calling UnitofmeasureApi.create_unit_of_measure"
  end
  # resource path
  local_var_path = "/units-of-measure"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(unit_of_measure)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UnitOfMeasurePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UnitofmeasureApi#create_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_all_units_of_measure(opts = {}) click to toggle source

Returns a collection of all unit-of-measure objects. By default 10 values are returned. Records are returned in natural order. {"nickname":"Get all units of measure","response":"getUnitOfMeasureAll.html"} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. (default to 0) @option opts [Integer] :records The maximum number of taxation-links to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @option opts [BOOLEAN] :include_retired Whether retired products should be returned. (default to true) @return [UnitOfMeasurePagedMetadata]

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 88
def get_all_units_of_measure(opts = {})
  data, _status_code, _headers = get_all_units_of_measure_with_http_info(opts)
  return data
end
get_all_units_of_measure_with_http_info(opts = {}) click to toggle source

Returns a collection of all unit-of-measure objects. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;Get all units of measure&quot;,&quot;response&quot;:&quot;getUnitOfMeasureAll.html&quot;} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first taxation-link to return. @option opts [Integer] :records The maximum number of taxation-links to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @option opts [BOOLEAN] :include_retired Whether retired products should be returned. @return [Array<(UnitOfMeasurePagedMetadata, Fixnum, Hash)>] UnitOfMeasurePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 103
def get_all_units_of_measure_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UnitofmeasureApi.get_all_units_of_measure ..."
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/units-of-measure"

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UnitOfMeasurePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UnitofmeasureApi#get_all_units_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_unit_of_measure_by_id(unit_of_measure_identifier, opts = {}) click to toggle source

Returns a single unit-of-measure corresponding to the unique id or name specified. {"nickname":"Retrieve an existing unit of measure","response":"getUnitOfMeasureByID.html"} @param unit_of_measure_identifier The unique id or name of the unit-of-measure. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [UnitOfMeasurePagedMetadata]

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 152
def get_unit_of_measure_by_id(unit_of_measure_identifier, opts = {})
  data, _status_code, _headers = get_unit_of_measure_by_id_with_http_info(unit_of_measure_identifier, opts)
  return data
end
get_unit_of_measure_by_id_with_http_info(unit_of_measure_identifier, opts = {}) click to toggle source

Returns a single unit-of-measure corresponding to the unique id or name specified. {&quot;nickname&quot;:&quot;Retrieve an existing unit of measure&quot;,&quot;response&quot;:&quot;getUnitOfMeasureByID.html&quot;} @param unit_of_measure_identifier The unique id or name of the unit-of-measure. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @return [Array<(UnitOfMeasurePagedMetadata, Fixnum, Hash)>] UnitOfMeasurePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 163
def get_unit_of_measure_by_id_with_http_info(unit_of_measure_identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UnitofmeasureApi.get_unit_of_measure_by_id ..."
  end
  # verify the required parameter 'unit_of_measure_identifier' is set
  if @api_client.config.client_side_validation && unit_of_measure_identifier.nil?
    fail ArgumentError, "Missing the required parameter 'unit_of_measure_identifier' when calling UnitofmeasureApi.get_unit_of_measure_by_id"
  end
  # resource path
  local_var_path = "/units-of-measure/{unit-of-measure-identifier}".sub('{' + 'unit-of-measure-identifier' + '}', unit_of_measure_identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UnitOfMeasurePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UnitofmeasureApi#get_unit_of_measure_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_unit_of_measure(unit_of_measure, opts = {}) click to toggle source

Update a unit-of-measure. {"nickname":"Update a unit of measure","request":"updateUnitOfMeasureRequest.html","response":"updateUnitOfMeasureResponse.html"} @param unit_of_measure The unit-of-measure object to be updated. @param [Hash] opts the optional parameters @return [UnitOfMeasurePagedMetadata]

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 209
def update_unit_of_measure(unit_of_measure, opts = {})
  data, _status_code, _headers = update_unit_of_measure_with_http_info(unit_of_measure, opts)
  return data
end
update_unit_of_measure_with_http_info(unit_of_measure, opts = {}) click to toggle source

Update a unit-of-measure. {&quot;nickname&quot;:&quot;Update a unit of measure&quot;,&quot;request&quot;:&quot;updateUnitOfMeasureRequest.html&quot;,&quot;response&quot;:&quot;updateUnitOfMeasureResponse.html&quot;} @param unit_of_measure The unit-of-measure object to be updated. @param [Hash] opts the optional parameters @return [Array<(UnitOfMeasurePagedMetadata, Fixnum, Hash)>] UnitOfMeasurePagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/unitofmeasure_api.rb, line 219
def update_unit_of_measure_with_http_info(unit_of_measure, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UnitofmeasureApi.update_unit_of_measure ..."
  end
  # verify the required parameter 'unit_of_measure' is set
  if @api_client.config.client_side_validation && unit_of_measure.nil?
    fail ArgumentError, "Missing the required parameter 'unit_of_measure' when calling UnitofmeasureApi.update_unit_of_measure"
  end
  # resource path
  local_var_path = "/units-of-measure"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(unit_of_measure)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UnitOfMeasurePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UnitofmeasureApi#update_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end