Method: TripletexRubyClient::InventorystocktakingApi#post_with_http_info

Defined in:
lib/tripletex_ruby_client/api/inventorystocktaking_api.rb

#post_with_http_info(opts = {}) ⇒ Array<(ResponseWrapperStocktaking, Fixnum, Hash)>

BETA

Create new stocktaking.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type_of_stocktaking (String)
  • :body (Stocktaking)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:

  • (Array<(ResponseWrapperStocktaking, Fixnum, Hash)>)

    ResponseWrapperStocktaking data, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/tripletex_ruby_client/api/inventorystocktaking_api.rb', line 141

def post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InventorystocktakingApi.post ...'
  end
  if @api_client.config.client_side_validation && opts[:'type_of_stocktaking'] && !['ALL_PRODUCTS_WITH_INVENTORIES', 'INCLUDE_PRODUCTS', 'NO_PRODUCTS'].include?(opts[:'type_of_stocktaking'])
    fail ArgumentError, 'invalid value for "type_of_stocktaking", must be one of ALL_PRODUCTS_WITH_INVENTORIES, INCLUDE_PRODUCTS, NO_PRODUCTS'
  end
  # resource path
  local_var_path = '/inventory/stocktaking'

  # query parameters
  query_params = {}
  query_params[:'typeOfStocktaking'] = opts[:'type_of_stocktaking'] if !opts[:'type_of_stocktaking'].nil?

  # header parameters
  header_params = {}
  # 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(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  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 => 'ResponseWrapperStocktaking')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InventorystocktakingApi#post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end