Skip to content

Latest commit

 

History

History
324 lines (252 loc) · 13.6 KB

TimeOffApi.md

File metadata and controls

324 lines (252 loc) · 13.6 KB

TimeOffApi

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

Method HTTP request Description
timeOffCreate POST /time-off
timeOffList GET /time-off
timeOffMetaPostRetrieve GET /time-off/meta/post
timeOffRetrieve GET /time-off/{id}

timeOffCreate

TimeOffResponse timeOffCreate(xAccountToken, timeOffEndpointRequest, isDebugMode, runAsync)

Creates a `TimeOff` object with the given values.

Example

// Import classes:
import merge_hris_client.ApiClient;
import merge_hris_client.ApiException;
import merge_hris_client.Configuration;
import merge_hris_client.auth.*;
import merge_hris_client.models.*;
import merge_hris_client.api.TimeOffApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.merge.dev/api/hris/v1");
    
    // Configure API key authorization: tokenAuth
    ApiKeyAuth tokenAuth = (ApiKeyAuth) defaultClient.getAuthentication("tokenAuth");
    tokenAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //tokenAuth.setApiKeyPrefix("Token");

    TimeOffApi apiInstance = new TimeOffApi(defaultClient);
    String xAccountToken = "xAccountToken_example"; // String | Token identifying the end user.
    TimeOffEndpointRequest timeOffEndpointRequest = new TimeOffEndpointRequest(); // TimeOffEndpointRequest | 
    Boolean isDebugMode = true; // Boolean | Whether to include debug fields (such as log file links) in the response.
    Boolean runAsync = true; // Boolean | Whether or not third-party updates should be run asynchronously.
    try {
      TimeOffResponse result = apiInstance.timeOffCreate(xAccountToken, timeOffEndpointRequest, isDebugMode, runAsync);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TimeOffApi#timeOffCreate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
xAccountToken String Token identifying the end user.
timeOffEndpointRequest TimeOffEndpointRequest
isDebugMode Boolean Whether to include debug fields (such as log file links) in the response. [optional]
runAsync 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

HTTP response details

Status code Description Response headers
201 -

timeOffList

PaginatedTimeOffList timeOffList(xAccountToken, approverId, createdAfter, createdBefore, cursor, employeeId, includeDeletedData, includeRemoteData, modifiedAfter, modifiedBefore, pageSize, remoteId, requestType, status)

Returns a list of `TimeOff` objects.

Example

// Import classes:
import merge_hris_client.ApiClient;
import merge_hris_client.ApiException;
import merge_hris_client.Configuration;
import merge_hris_client.auth.*;
import merge_hris_client.models.*;
import merge_hris_client.api.TimeOffApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.merge.dev/api/hris/v1");
    
    // Configure API key authorization: tokenAuth
    ApiKeyAuth tokenAuth = (ApiKeyAuth) defaultClient.getAuthentication("tokenAuth");
    tokenAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //tokenAuth.setApiKeyPrefix("Token");

    TimeOffApi apiInstance = new TimeOffApi(defaultClient);
    String xAccountToken = "xAccountToken_example"; // String | Token identifying the end user.
    String approverId = "approverId_example"; // String | If provided, will only return time off for this approver.
    OffsetDateTime createdAfter = OffsetDateTime.now(); // OffsetDateTime | If provided, will only return objects created after this datetime.
    OffsetDateTime createdBefore = OffsetDateTime.now(); // OffsetDateTime | If provided, will only return objects created before this datetime.
    String cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw"; // String | The pagination cursor value.
    String employeeId = "employeeId_example"; // String | If provided, will only return time off for this employee.
    Boolean includeDeletedData = true; // Boolean | Whether to include data that was deleted in the third-party service.
    Boolean includeRemoteData = true; // Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
    OffsetDateTime modifiedAfter = OffsetDateTime.now(); // OffsetDateTime | If provided, will only return objects modified after this datetime.
    OffsetDateTime modifiedBefore = OffsetDateTime.now(); // OffsetDateTime | If provided, will only return objects modified before this datetime.
    Integer pageSize = 56; // Integer | Number of results to return per page.
    String remoteId = "remoteId_example"; // String | The API provider's ID for the given object.
    String requestType = "requestType_example"; // String | If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT')
    String status = "status_example"; // String | If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED')
    try {
      PaginatedTimeOffList result = apiInstance.timeOffList(xAccountToken, approverId, createdAfter, createdBefore, cursor, employeeId, includeDeletedData, includeRemoteData, modifiedAfter, modifiedBefore, pageSize, remoteId, requestType, status);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TimeOffApi#timeOffList");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
xAccountToken String Token identifying the end user.
approverId String If provided, will only return time off for this approver. [optional]
createdAfter OffsetDateTime If provided, will only return objects created after this datetime. [optional]
createdBefore OffsetDateTime If provided, will only return objects created before this datetime. [optional]
cursor String The pagination cursor value. [optional]
employeeId String If provided, will only return time off for this employee. [optional]
includeDeletedData Boolean Whether to include data that was deleted in the third-party service. [optional]
includeRemoteData Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]
modifiedAfter OffsetDateTime If provided, will only return objects modified after this datetime. [optional]
modifiedBefore OffsetDateTime If provided, will only return objects modified before this datetime. [optional]
pageSize Integer Number of results to return per page. [optional]
remoteId String The API provider's ID for the given object. [optional]
requestType String If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') [optional] [enum: BEREAVEMENT, JURY_DUTY, PERSONAL, SICK, VACATION, VOLUNTEER]
status String If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') [optional] [enum: APPROVED, CANCELLED, DECLINED, DELETED, REQUESTED]

Return type

PaginatedTimeOffList

Authorization

tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

timeOffMetaPostRetrieve

MetaResponse timeOffMetaPostRetrieve(xAccountToken)

Returns metadata for `TimeOff` POSTs.

Example

// Import classes:
import merge_hris_client.ApiClient;
import merge_hris_client.ApiException;
import merge_hris_client.Configuration;
import merge_hris_client.auth.*;
import merge_hris_client.models.*;
import merge_hris_client.api.TimeOffApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.merge.dev/api/hris/v1");
    
    // Configure API key authorization: tokenAuth
    ApiKeyAuth tokenAuth = (ApiKeyAuth) defaultClient.getAuthentication("tokenAuth");
    tokenAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //tokenAuth.setApiKeyPrefix("Token");

    TimeOffApi apiInstance = new TimeOffApi(defaultClient);
    String xAccountToken = "xAccountToken_example"; // String | Token identifying the end user.
    try {
      MetaResponse result = apiInstance.timeOffMetaPostRetrieve(xAccountToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TimeOffApi#timeOffMetaPostRetrieve");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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

Return type

MetaResponse

Authorization

tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

timeOffRetrieve

TimeOff timeOffRetrieve(xAccountToken, id, includeRemoteData)

Returns a `TimeOff` object with the given `id`.

Example

// Import classes:
import merge_hris_client.ApiClient;
import merge_hris_client.ApiException;
import merge_hris_client.Configuration;
import merge_hris_client.auth.*;
import merge_hris_client.models.*;
import merge_hris_client.api.TimeOffApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.merge.dev/api/hris/v1");
    
    // Configure API key authorization: tokenAuth
    ApiKeyAuth tokenAuth = (ApiKeyAuth) defaultClient.getAuthentication("tokenAuth");
    tokenAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //tokenAuth.setApiKeyPrefix("Token");

    TimeOffApi apiInstance = new TimeOffApi(defaultClient);
    String xAccountToken = "xAccountToken_example"; // String | Token identifying the end user.
    UUID id = new UUID(); // UUID | 
    Boolean includeRemoteData = true; // Boolean | Whether to include the original data Merge fetched from the third-party to produce these models.
    try {
      TimeOff result = apiInstance.timeOffRetrieve(xAccountToken, id, includeRemoteData);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TimeOffApi#timeOffRetrieve");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
xAccountToken String Token identifying the end user.
id UUID
includeRemoteData Boolean Whether to include the original data Merge fetched from the third-party to produce these models. [optional]

Return type

TimeOff

Authorization

tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -