class KoronaClient::OrganizationalUnitsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, body, opts = {}) click to toggle source

adds a batch of new day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param body an array of new day ratings @param [Hash] opts the optional parameters @return [Array<AddOrUpdateResult>]

# File lib/korona_client/api/organizational_units_api.rb, line 29
def add_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, body, opts = {})
  data, _status_code, _headers = add_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts)
  data
end
add_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts = {}) click to toggle source

adds a batch of new day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param body an array of new day ratings @param [Hash] opts the optional parameters @return [Array<(Array<AddOrUpdateResult>, Fixnum, Hash)>] Array<AddOrUpdateResult> data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 41
def add_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.add_organizational_unit_day_ratings ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.add_organizational_unit_day_ratings"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.add_organizational_unit_day_ratings"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationalUnitsApi.add_organizational_unit_day_ratings"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  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 => 'Array<AddOrUpdateResult>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#add_organizational_unit_day_ratings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {}) click to toggle source

deletes the single day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param [Hash] opts the optional parameters @return [nil]

# File lib/korona_client/api/organizational_units_api.rb, line 95
def delete_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {})
  delete_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts)
  nil
end
delete_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {}) click to toggle source

deletes the single day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 107
def delete_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.delete_organizational_unit_day_rating ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.delete_organizational_unit_day_rating"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.delete_organizational_unit_day_rating"
  end
  # verify the required parameter 'day_rating_id_or_date' is set
  if @api_client.config.client_side_validation && day_rating_id_or_date.nil?
    fail ArgumentError, "Missing the required parameter 'day_rating_id_or_date' when calling OrganizationalUnitsApi.delete_organizational_unit_day_rating"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings/{dayRatingIdOrDate}'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s).sub('{' + 'dayRatingIdOrDate' + '}', day_rating_id_or_date.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#delete_organizational_unit_day_rating\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

returns the single organizational unit

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @return [OrganizationalUnit]

# File lib/korona_client/api/organizational_units_api.rb, line 159
def get_organizational_unit(korona_account_id, organizational_unit_id, opts = {})
  data, _status_code, _headers = get_organizational_unit_with_http_info(korona_account_id, organizational_unit_id, opts)
  data
end
get_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {}) click to toggle source

returns the single day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param [Hash] opts the optional parameters @return [DayRating]

# File lib/korona_client/api/organizational_units_api.rb, line 220
def get_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {})
  data, _status_code, _headers = get_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts)
  data
end
get_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {}) click to toggle source

returns the single day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param [Hash] opts the optional parameters @return [Array<(DayRating, Fixnum, Hash)>] DayRating data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 232
def get_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit_day_rating ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit_day_rating"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit_day_rating"
  end
  # verify the required parameter 'day_rating_id_or_date' is set
  if @api_client.config.client_side_validation && day_rating_id_or_date.nil?
    fail ArgumentError, "Missing the required parameter 'day_rating_id_or_date' when calling OrganizationalUnitsApi.get_organizational_unit_day_rating"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings/{dayRatingIdOrDate}'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s).sub('{' + 'dayRatingIdOrDate' + '}', day_rating_id_or_date.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'DayRating')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit_day_rating\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists all organizational unit related day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @return [ResultListDayRating]

# File lib/korona_client/api/organizational_units_api.rb, line 288
def get_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, opts = {})
  data, _status_code, _headers = get_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, opts)
  data
end
get_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists all organizational unit related day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @return [Array<(ResultListDayRating, Fixnum, Hash)>] ResultListDayRating data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 302
def get_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit_day_ratings ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit_day_ratings"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit_day_ratings"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'ResultListDayRating')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit_day_ratings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit_inventory_lists(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the inventory lists belonging to the organizational unit (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [DateTime] :min_create_time min (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_create_time max (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :min_booking_time min (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_booking_time max (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [String] :booking_status booking status (possible values: BOOKED, IN_PROGRESS) @return [ResultListInventoryList]

# File lib/korona_client/api/organizational_units_api.rb, line 364
def get_organizational_unit_inventory_lists(korona_account_id, organizational_unit_id, opts = {})
  data, _status_code, _headers = get_organizational_unit_inventory_lists_with_http_info(korona_account_id, organizational_unit_id, opts)
  data
end
get_organizational_unit_inventory_lists_with_http_info(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the inventory lists belonging to the organizational unit (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [DateTime] :min_create_time min (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_create_time max (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :min_booking_time min (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_booking_time max (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [String] :booking_status booking status (possible values: BOOKED, IN_PROGRESS) @return [Array<(ResultListInventoryList, Fixnum, Hash)>] ResultListInventoryList data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 385
def get_organizational_unit_inventory_lists_with_http_info(korona_account_id, organizational_unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit_inventory_lists ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit_inventory_lists"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit_inventory_lists"
  end
  if @api_client.config.client_side_validation && opts[:'booking_status'] && !['BOOKED', 'IN_PROGRESS'].include?(opts[:'booking_status'])
    fail ArgumentError, 'invalid value for "booking_status", must be one of BOOKED, IN_PROGRESS'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/inventoryLists'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?
  query_params[:'includeDeleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'minCreateTime'] = opts[:'min_create_time'] if !opts[:'min_create_time'].nil?
  query_params[:'maxCreateTime'] = opts[:'max_create_time'] if !opts[:'max_create_time'].nil?
  query_params[:'minBookingTime'] = opts[:'min_booking_time'] if !opts[:'min_booking_time'].nil?
  query_params[:'maxBookingTime'] = opts[:'max_booking_time'] if !opts[:'max_booking_time'].nil?
  query_params[:'bookingStatus'] = opts[:'booking_status'] if !opts[:'booking_status'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'ResultListInventoryList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit_inventory_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit_product_stocks(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the product stocks of the organizational unit, in case it contains a warehouse (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @return [ResultListProductStock]

# File lib/korona_client/api/organizational_units_api.rb, line 451
def get_organizational_unit_product_stocks(korona_account_id, organizational_unit_id, opts = {})
  data, _status_code, _headers = get_organizational_unit_product_stocks_with_http_info(korona_account_id, organizational_unit_id, opts)
  data
end
get_organizational_unit_product_stocks_with_http_info(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the product stocks of the organizational unit, in case it contains a warehouse (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @return [Array<(ResultListProductStock, Fixnum, Hash)>] ResultListProductStock data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 466
def get_organizational_unit_product_stocks_with_http_info(korona_account_id, organizational_unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit_product_stocks ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit_product_stocks"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit_product_stocks"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/productStocks'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'ResultListProductStock')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit_product_stocks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit_stock_receipts(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the stock receipts belonging to the organizational unit (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [DateTime] :min_create_time min (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_create_time max (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :min_booking_time min (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_booking_time max (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [String] :source_organizational_unit source organizational unit @option opts [String] :booking_status booking status (possible values: BOOKED, IN_PROGRESS) @option opts [String] :number number of the related object @return [ResultListStockReceipt]

# File lib/korona_client/api/organizational_units_api.rb, line 531
def get_organizational_unit_stock_receipts(korona_account_id, organizational_unit_id, opts = {})
  data, _status_code, _headers = get_organizational_unit_stock_receipts_with_http_info(korona_account_id, organizational_unit_id, opts)
  data
end
get_organizational_unit_stock_receipts_with_http_info(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

lists the stock receipts belonging to the organizational unit (KORONA.retail required)

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [DateTime] :min_create_time min (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_create_time max (inclusive) create time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :min_booking_time min (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [DateTime] :max_booking_time max (inclusive) booking time of the receipt (ISO 8601; date, time and timezone) @option opts [String] :source_organizational_unit source organizational unit @option opts [String] :booking_status booking status (possible values: BOOKED, IN_PROGRESS) @option opts [String] :number number of the related object @return [Array<(ResultListStockReceipt, Fixnum, Hash)>] ResultListStockReceipt data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 554
def get_organizational_unit_stock_receipts_with_http_info(korona_account_id, organizational_unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit_stock_receipts ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit_stock_receipts"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit_stock_receipts"
  end
  if @api_client.config.client_side_validation && opts[:'booking_status'] && !['BOOKED', 'IN_PROGRESS'].include?(opts[:'booking_status'])
    fail ArgumentError, 'invalid value for "booking_status", must be one of BOOKED, IN_PROGRESS'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/stockReceipts'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?
  query_params[:'includeDeleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'minCreateTime'] = opts[:'min_create_time'] if !opts[:'min_create_time'].nil?
  query_params[:'maxCreateTime'] = opts[:'max_create_time'] if !opts[:'max_create_time'].nil?
  query_params[:'minBookingTime'] = opts[:'min_booking_time'] if !opts[:'min_booking_time'].nil?
  query_params[:'maxBookingTime'] = opts[:'max_booking_time'] if !opts[:'max_booking_time'].nil?
  query_params[:'sourceOrganizationalUnit'] = opts[:'source_organizational_unit'] if !opts[:'source_organizational_unit'].nil?
  query_params[:'bookingStatus'] = opts[:'booking_status'] if !opts[:'booking_status'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'ResultListStockReceipt')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit_stock_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_unit_with_http_info(korona_account_id, organizational_unit_id, opts = {}) click to toggle source

returns the single organizational unit

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param [Hash] opts the optional parameters @return [Array<(OrganizationalUnit, Fixnum, Hash)>] OrganizationalUnit data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 170
def get_organizational_unit_with_http_info(korona_account_id, organizational_unit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_unit ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_unit"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.get_organizational_unit"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'OrganizationalUnit')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_unit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_organizational_units(korona_account_id, opts = {}) click to toggle source

lists all organizational units

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [String] :number number of the related object @return [ResultListOrganizationalUnit]

# File lib/korona_client/api/organizational_units_api.rb, line 623
def get_organizational_units(korona_account_id, opts = {})
  data, _status_code, _headers = get_organizational_units_with_http_info(korona_account_id, opts)
  data
end
get_organizational_units_with_http_info(korona_account_id, opts = {}) click to toggle source

lists all organizational units

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [Integer] :page number of the page to fetch @option opts [Integer] :size amount of objects to return per page @option opts [String] :sort attribute to sort by (multiple separated by comma; max. 5) @option opts [Integer] :revision last revision number, objects with a greater revision than this will be returned @option opts [BOOLEAN] :include_deleted indicates deleted objects should be loaded or not (default: false) @option opts [String] :number number of the related object @return [Array<(ResultListOrganizationalUnit, Fixnum, Hash)>] ResultListOrganizationalUnit data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 639
def get_organizational_units_with_http_info(korona_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.get_organizational_units ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.get_organizational_units"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'revision'] = opts[:'revision'] if !opts[:'revision'].nil?
  query_params[:'includeDeleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  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 => 'ResultListOrganizationalUnit')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#get_organizational_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, body, opts = {}) click to toggle source

updates the day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param body the properties to update of the day rating @param [Hash] opts the optional parameters @return [nil]

# File lib/korona_client/api/organizational_units_api.rb, line 692
def update_organizational_unit_day_rating(korona_account_id, organizational_unit_id, day_rating_id_or_date, body, opts = {})
  update_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, body, opts)
  nil
end
update_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, body, opts = {}) click to toggle source

updates the day rating by its id or date

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param day_rating_id_or_date the id or date (YYYY-MM-DD) of the day rating @param body the properties to update of the day rating @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 705
def update_organizational_unit_day_rating_with_http_info(korona_account_id, organizational_unit_id, day_rating_id_or_date, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.update_organizational_unit_day_rating ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.update_organizational_unit_day_rating"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.update_organizational_unit_day_rating"
  end
  # verify the required parameter 'day_rating_id_or_date' is set
  if @api_client.config.client_side_validation && day_rating_id_or_date.nil?
    fail ArgumentError, "Missing the required parameter 'day_rating_id_or_date' when calling OrganizationalUnitsApi.update_organizational_unit_day_rating"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationalUnitsApi.update_organizational_unit_day_rating"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings/{dayRatingIdOrDate}'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s).sub('{' + 'dayRatingIdOrDate' + '}', day_rating_id_or_date.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#update_organizational_unit_day_rating\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, body, opts = {}) click to toggle source

updates a batch of day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param body an array of new day ratings @param [Hash] opts the optional parameters @return [Array<AddOrUpdateResult>]

# File lib/korona_client/api/organizational_units_api.rb, line 762
def update_organizational_unit_day_ratings(korona_account_id, organizational_unit_id, body, opts = {})
  data, _status_code, _headers = update_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts)
  data
end
update_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts = {}) click to toggle source

updates a batch of day ratings

@param korona_account_id account id of the KORONA.cloud account @param organizational_unit_id id of the related object (important: id should match the uuid-format) @param body an array of new day ratings @param [Hash] opts the optional parameters @return [Array<(Array<AddOrUpdateResult>, Fixnum, Hash)>] Array<AddOrUpdateResult> data, response status code and response headers

# File lib/korona_client/api/organizational_units_api.rb, line 774
def update_organizational_unit_day_ratings_with_http_info(korona_account_id, organizational_unit_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationalUnitsApi.update_organizational_unit_day_ratings ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling OrganizationalUnitsApi.update_organizational_unit_day_ratings"
  end
  # verify the required parameter 'organizational_unit_id' is set
  if @api_client.config.client_side_validation && organizational_unit_id.nil?
    fail ArgumentError, "Missing the required parameter 'organizational_unit_id' when calling OrganizationalUnitsApi.update_organizational_unit_day_ratings"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationalUnitsApi.update_organizational_unit_day_ratings"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/organizationalUnits/{organizationalUnitId}/dayRatings'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s).sub('{' + 'organizationalUnitId' + '}', organizational_unit_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<AddOrUpdateResult>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationalUnitsApi#update_organizational_unit_day_ratings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end