Method: PureCloud::WorkforceManagementApi#get_timeoffrequests_with_http_info

Defined in:
lib/purecloud/api/workforce_management_api.rb

#get_timeoffrequests_with_http_info(opts = {}) ⇒ Array<(TimeOffRequestList, Fixnum, Hash)>

Get a list of time off requests for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :recently_reviewed (BOOLEAN)

    Limit results to requests that have been reviewed within the preceding 30 days

Returns:

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

    TimeOffRequestList data, response status code and response headers



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/purecloud/api/workforce_management_api.rb', line 304

def get_timeoffrequests_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_timeoffrequests ..."
  end
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/timeoffrequests".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'recentlyReviewed'] = opts[:'recently_reviewed'] if opts[:'recently_reviewed']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'TimeOffRequestList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_timeoffrequests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end