Skip to content

Latest commit

 

History

History
357 lines (258 loc) · 15.6 KB

TimeOffApi.md

File metadata and controls

357 lines (258 loc) · 15.6 KB

MergeHRISClient::TimeOffApi

All URIs are relative to https://api.merge.dev/api/hris/v1

Method HTTP request Description
time_off_create POST /time-off
time_off_list GET /time-off
time_off_meta_post_retrieve GET /time-off/meta/post
time_off_retrieve GET /time-off/{id}

time_off_create

time_off_create(x_account_token, time_off_endpoint_request, opts)

Creates a TimeOff object with the given values.

Examples

require 'time'
require 'merge_hris_client'
# setup authorization
MergeHRISClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeHRISClient::TimeOffApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
time_off_endpoint_request = MergeHRISClient::TimeOffEndpointRequest.new({model: MergeHRISClient::TimeOffRequest.new}) # TimeOffEndpointRequest | 
opts = {
  is_debug_mode: true, # Boolean | Whether to include debug fields (such as log file links) in the response.
  run_async: true # Boolean | Whether or not third-party updates should be run asynchronously.
}

begin
  
  result = api_instance.time_off_create(x_account_token, time_off_endpoint_request, opts)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_create: #{e}"
end

Using the time_off_create_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> time_off_create_with_http_info(x_account_token, time_off_endpoint_request, opts)

begin
  
  data, status_code, headers = api_instance.time_off_create_with_http_info(x_account_token, time_off_endpoint_request, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TimeOffResponse>
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_create_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
time_off_endpoint_request TimeOffEndpointRequest
is_debug_mode Boolean Whether to include debug fields (such as log file links) in the response. [optional]
run_async Boolean Whether or not third-party updates should be run asynchronously. [optional]

Return type

TimeOffResponse

Authorization

tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

time_off_list

time_off_list(x_account_token, opts)

Returns a list of TimeOff objects.

Examples

require 'time'
require 'merge_hris_client'
# setup authorization
MergeHRISClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeHRISClient::TimeOffApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
opts = {
  approver_id: 'approver_id_example', # String | If provided, will only return time off for this approver.
  created_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created after this datetime.
  created_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return objects created before this datetime.
  cursor: 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', # String | The pagination cursor value.
  employee_id: 'employee_id_example', # String | If provided, will only return time off for this employee.
  ended_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return employees that ended after this datetime.
  ended_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return time-offs that ended before this datetime.
  expand: 'approver', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
  include_deleted_data: true, # Boolean | Whether to include data that was marked as deleted by third party webhooks.
  include_remote_data: true, # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
  modified_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, only objects synced by Merge after this date time will be returned.
  modified_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, only objects synced by Merge before this date time will be returned.
  page_size: 56, # Integer | Number of results to return per page.
  remote_fields: 'request_type', # String | Deprecated. Use show_enum_origins.
  remote_id: 'remote_id_example', # String | The API provider's ID for the given object.
  request_type: 'BEREAVEMENT', # String | If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT')  * `VACATION` - VACATION * `SICK` - SICK * `PERSONAL` - PERSONAL * `JURY_DUTY` - JURY_DUTY * `VOLUNTEER` - VOLUNTEER * `BEREAVEMENT` - BEREAVEMENT
  show_enum_origins: 'request_type', # String | A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
  started_after: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return time-offs that started after this datetime.
  started_before: Time.parse('2013-10-20T19:20:30+01:00'), # Time | If provided, will only return time-offs that started before this datetime.
  status: 'APPROVED' # String | If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED')  * `REQUESTED` - REQUESTED * `APPROVED` - APPROVED * `DECLINED` - DECLINED * `CANCELLED` - CANCELLED * `DELETED` - DELETED
}

begin
  
  result = api_instance.time_off_list(x_account_token, opts)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_list: #{e}"
end

Using the time_off_list_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> time_off_list_with_http_info(x_account_token, opts)

begin
  
  data, status_code, headers = api_instance.time_off_list_with_http_info(x_account_token, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <PaginatedTimeOffList>
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_list_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
approver_id String If provided, will only return time off for this approver. [optional]
created_after Time If provided, will only return objects created after this datetime. [optional]
created_before Time If provided, will only return objects created before this datetime. [optional]
cursor String The pagination cursor value. [optional]
employee_id String If provided, will only return time off for this employee. [optional]
ended_after Time If provided, will only return employees that ended after this datetime. [optional]
ended_before Time If provided, will only return time-offs that ended before this datetime. [optional]
expand String Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. [optional]
include_deleted_data Boolean Whether to include data that was marked as deleted by third party webhooks. [optional]
include_remote_data Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]
modified_after Time If provided, only objects synced by Merge after this date time will be returned. [optional]
modified_before Time If provided, only objects synced by Merge before this date time will be returned. [optional]
page_size Integer Number of results to return per page. [optional]
remote_fields String Deprecated. Use show_enum_origins. [optional]
remote_id String The API provider's ID for the given object. [optional]
request_type String If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') * `VACATION` - VACATION * `SICK` - SICK * `PERSONAL` - PERSONAL * `JURY_DUTY` - JURY_DUTY * `VOLUNTEER` - VOLUNTEER * `BEREAVEMENT` - BEREAVEMENT [optional]
show_enum_origins String A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more [optional]
started_after Time If provided, will only return time-offs that started after this datetime. [optional]
started_before Time If provided, will only return time-offs that started before this datetime. [optional]
status String If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') * `REQUESTED` - REQUESTED * `APPROVED` - APPROVED * `DECLINED` - DECLINED * `CANCELLED` - CANCELLED * `DELETED` - DELETED [optional]

Return type

PaginatedTimeOffList

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

time_off_meta_post_retrieve

time_off_meta_post_retrieve(x_account_token)

Returns metadata for TimeOff POSTs.

Examples

require 'time'
require 'merge_hris_client'
# setup authorization
MergeHRISClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeHRISClient::TimeOffApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.

begin
  
  result = api_instance.time_off_meta_post_retrieve(x_account_token)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_meta_post_retrieve: #{e}"
end

Using the time_off_meta_post_retrieve_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> time_off_meta_post_retrieve_with_http_info(x_account_token)

begin
  
  data, status_code, headers = api_instance.time_off_meta_post_retrieve_with_http_info(x_account_token)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MetaResponse>
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_meta_post_retrieve_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.

Return type

MetaResponse

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

time_off_retrieve

time_off_retrieve(x_account_token, id, opts)

Returns a TimeOff object with the given id.

Examples

require 'time'
require 'merge_hris_client'
# setup authorization
MergeHRISClient.configure do |config|
  # Configure API key authorization: tokenAuth
  config.api_key['tokenAuth'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['tokenAuth'] = 'Bearer'
end

api_instance = MergeHRISClient::TimeOffApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
id = TODO # String | 
opts = {
  expand: 'approver', # String | Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
  include_remote_data: true, # Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
  remote_fields: 'request_type', # String | Deprecated. Use show_enum_origins.
  show_enum_origins: 'request_type' # String | A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
}

begin
  
  result = api_instance.time_off_retrieve(x_account_token, id, opts)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_retrieve: #{e}"
end

Using the time_off_retrieve_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> time_off_retrieve_with_http_info(x_account_token, id, opts)

begin
  
  data, status_code, headers = api_instance.time_off_retrieve_with_http_info(x_account_token, id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TimeOff>
rescue MergeHRISClient::ApiError => e
  puts "Error when calling TimeOffApi->time_off_retrieve_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
id String
expand String Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. [optional]
include_remote_data Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]
remote_fields String Deprecated. Use show_enum_origins. [optional]
show_enum_origins String A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more [optional]

Return type

TimeOff

Authorization

tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json