Skip to content

Latest commit

 

History

History
193 lines (142 loc) · 8.92 KB

EmploymentsApi.md

File metadata and controls

193 lines (142 loc) · 8.92 KB

MergeHRISClient::EmploymentsApi

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

Method HTTP request Description
employments_list GET /employments
employments_retrieve GET /employments/{id}

employments_list

employments_list(x_account_token, opts)

Returns a list of Employment 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::EmploymentsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
opts = {
  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 employments for this employee.
  expand: 'employee', # 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.
  order_by: '-effective_date', # String | Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date.
  page_size: 56, # Integer | Number of results to return per page.
  remote_fields: 'employment_type', # String | Deprecated. Use show_enum_origins.
  remote_id: 'remote_id_example', # String | The API provider's ID for the given object.
  show_enum_origins: 'employment_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.employments_list(x_account_token, opts)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling EmploymentsApi->employments_list: #{e}"
end

Using the employments_list_with_http_info variant

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

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

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

Parameters

Name Type Description Notes
x_account_token String Token identifying the end user.
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 employments for this employee. [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]
order_by String Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date. [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]
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

PaginatedEmploymentList

Authorization

tokenAuth

HTTP request headers

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

employments_retrieve

employments_retrieve(x_account_token, id, opts)

Returns an Employment 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::EmploymentsApi.new
x_account_token = 'x_account_token_example' # String | Token identifying the end user.
id = TODO # String | 
opts = {
  expand: 'employee', # 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: 'employment_type', # String | Deprecated. Use show_enum_origins.
  show_enum_origins: 'employment_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.employments_retrieve(x_account_token, id, opts)
  p result
rescue MergeHRISClient::ApiError => e
  puts "Error when calling EmploymentsApi->employments_retrieve: #{e}"
end

Using the employments_retrieve_with_http_info variant

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

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

begin
  
  data, status_code, headers = api_instance.employments_retrieve_with_http_info(x_account_token, id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Employment>
rescue MergeHRISClient::ApiError => e
  puts "Error when calling EmploymentsApi->employments_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

Employment

Authorization

tokenAuth

HTTP request headers

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