Skip to content

Latest commit

 

History

History
342 lines (268 loc) · 18.8 KB

README.md

File metadata and controls

342 lines (268 loc) · 18.8 KB

TimeOffRequests

(Hris.TimeOffRequests)

Overview

Available Operations

  • List - List Time Off Requests
  • Create - Create Time Off Request
  • Get - Get Time Off Request
  • Update - Update Time Off Request
  • Delete - Delete Time Off Request

List

List Time Off Requests

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    apiKey: "<YOUR_BEARER_TOKEN_HERE>",
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);

HrisTimeOffRequestsAllRequest req = new HrisTimeOffRequestsAllRequest() {
    ServiceId = "salesforce",
    Filter = new TimeOffRequestsFilter() {
        StartDate = "2022-04-08",
        EndDate = "2022-04-21",
        UpdatedSince = "2020-09-30T07:43:32.000Z",
        EmployeeId = "1234",
        TimeOffRequestStatus = TimeOffRequestStatus.Approved,
        CompanyId = "1234",
    },
    PassThrough = new Dictionary<string, object>() {
        { "search", "San Francisco" },
    },
    Fields = "id,updated_at",
};

HrisTimeOffRequestsAllResponse? res = await sdk.Hris.TimeOffRequests.ListAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

Parameter Type Required Description
request HrisTimeOffRequestsAllRequest ✔️ The request object to use for the request.

Response

HrisTimeOffRequestsAllResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.BadRequestResponse 400 application/json
ApideckUnifySdk.Models.Errors.UnauthorizedResponse 401 application/json
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse 402 application/json
ApideckUnifySdk.Models.Errors.NotFoundResponse 404 application/json
ApideckUnifySdk.Models.Errors.UnprocessableResponse 422 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*

Create

Create Time Off Request

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    apiKey: "<YOUR_BEARER_TOKEN_HERE>",
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);

HrisTimeOffRequestsAddRequest req = new HrisTimeOffRequestsAddRequest() {
    TimeOffRequest = new TimeOffRequestInput() {
        EmployeeId = "12345",
        PolicyId = "12345",
        Status = TimeOffRequestStatusStatus.Approved,
        Description = "Enjoying some sun.",
        StartDate = "2022-04-01",
        EndDate = "2022-04-01",
        RequestDate = "2022-03-21",
        RequestType = RequestType.Vacation,
        ApprovalDate = "2022-03-21",
        Units = Units.Hours,
        Amount = 3.5D,
        DayPart = "morning",
        Notes = new Models.Components.Notes() {
            Employee = "Relaxing on the beach for a few hours.",
            Manager = "Enjoy!",
        },
        PassThrough = new List<PassThroughBody>() {
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
        },
        PolicyType = "sick",
    },
    ServiceId = "salesforce",
};

var res = await sdk.Hris.TimeOffRequests.CreateAsync(req);

// handle response

Parameters

Parameter Type Required Description
request HrisTimeOffRequestsAddRequest ✔️ The request object to use for the request.

Response

HrisTimeOffRequestsAddResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.BadRequestResponse 400 application/json
ApideckUnifySdk.Models.Errors.UnauthorizedResponse 401 application/json
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse 402 application/json
ApideckUnifySdk.Models.Errors.NotFoundResponse 404 application/json
ApideckUnifySdk.Models.Errors.UnprocessableResponse 422 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*

Get

Get Time Off Request

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    apiKey: "<YOUR_BEARER_TOKEN_HERE>",
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);

HrisTimeOffRequestsOneRequest req = new HrisTimeOffRequestsOneRequest() {
    Id = "<id>",
    EmployeeId = "<id>",
    ServiceId = "salesforce",
    Fields = "id,updated_at",
};

var res = await sdk.Hris.TimeOffRequests.GetAsync(req);

// handle response

Parameters

Parameter Type Required Description
request HrisTimeOffRequestsOneRequest ✔️ The request object to use for the request.

Response

HrisTimeOffRequestsOneResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.BadRequestResponse 400 application/json
ApideckUnifySdk.Models.Errors.UnauthorizedResponse 401 application/json
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse 402 application/json
ApideckUnifySdk.Models.Errors.NotFoundResponse 404 application/json
ApideckUnifySdk.Models.Errors.UnprocessableResponse 422 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*

Update

Update Time Off Request

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    apiKey: "<YOUR_BEARER_TOKEN_HERE>",
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);

HrisTimeOffRequestsUpdateRequest req = new HrisTimeOffRequestsUpdateRequest() {
    Id = "<id>",
    EmployeeId = "<id>",
    TimeOffRequest = new TimeOffRequestInput() {
        EmployeeId = "12345",
        PolicyId = "12345",
        Status = TimeOffRequestStatusStatus.Approved,
        Description = "Enjoying some sun.",
        StartDate = "2022-04-01",
        EndDate = "2022-04-01",
        RequestDate = "2022-03-21",
        RequestType = RequestType.Vacation,
        ApprovalDate = "2022-03-21",
        Units = Units.Hours,
        Amount = 3.5D,
        DayPart = "morning",
        Notes = new Models.Components.Notes() {
            Employee = "Relaxing on the beach for a few hours.",
            Manager = "Enjoy!",
        },
        PassThrough = new List<PassThroughBody>() {
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
        },
        PolicyType = "sick",
    },
    ServiceId = "salesforce",
};

var res = await sdk.Hris.TimeOffRequests.UpdateAsync(req);

// handle response

Parameters

Parameter Type Required Description
request HrisTimeOffRequestsUpdateRequest ✔️ The request object to use for the request.

Response

HrisTimeOffRequestsUpdateResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.BadRequestResponse 400 application/json
ApideckUnifySdk.Models.Errors.UnauthorizedResponse 401 application/json
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse 402 application/json
ApideckUnifySdk.Models.Errors.NotFoundResponse 404 application/json
ApideckUnifySdk.Models.Errors.UnprocessableResponse 422 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*

Delete

Delete Time Off Request

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    apiKey: "<YOUR_BEARER_TOKEN_HERE>",
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);

HrisTimeOffRequestsDeleteRequest req = new HrisTimeOffRequestsDeleteRequest() {
    Id = "<id>",
    EmployeeId = "<id>",
    ServiceId = "salesforce",
};

var res = await sdk.Hris.TimeOffRequests.DeleteAsync(req);

// handle response

Parameters

Parameter Type Required Description
request HrisTimeOffRequestsDeleteRequest ✔️ The request object to use for the request.

Response

HrisTimeOffRequestsDeleteResponse

Errors

Error Type Status Code Content Type
ApideckUnifySdk.Models.Errors.BadRequestResponse 400 application/json
ApideckUnifySdk.Models.Errors.UnauthorizedResponse 401 application/json
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse 402 application/json
ApideckUnifySdk.Models.Errors.NotFoundResponse 404 application/json
ApideckUnifySdk.Models.Errors.UnprocessableResponse 422 application/json
ApideckUnifySdk.Models.Errors.APIException 4XX, 5XX */*