Skip to content

Latest commit

 

History

History
398 lines (320 loc) · 100 KB

README.md

File metadata and controls

398 lines (320 loc) · 100 KB

TimeOffRequests

(hris.time_off_requests)

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

import apideck_unify
from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.hris.time_off_requests.list(service_id="salesforce", filter_={
        "start_date": "2022-04-08",
        "end_date": "2022-04-21",
        "updated_since": "2020-09-30T07:43:32.000Z",
        "employee_id": "1234",
        "time_off_request_status": apideck_unify.TimeOffRequestStatus.APPROVED,
        "company_id": "1234",
    }, pass_through={
        "search": "San Francisco",
    }, fields="id,updated_at")

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
cursor OptionalNullable[str] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit Optional[int] Number of results to return. Minimum 1, Maximum 200, Default 20
filter_ Optional[models.TimeOffRequestsFilter] Apply filters {
"start_date": "2022-04-08",
"end_date": "2022-04-21",
"updated_since": "2020-09-30T07:43:32.000Z",
"employee_id": "1234",
"time_off_request_status": "approved",
"company_id": "1234"
}
pass_through Dict[str, Any] Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads {
"search": "San Francisco"
}
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.HrisTimeOffRequestsAllResponse

Errors

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

create

Create Time Off Request

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.hris.time_off_requests.create(service_id="salesforce", employee_id="12345", policy_id="12345", status=apideck_unify.TimeOffRequestStatusStatus.APPROVED, description="Enjoying some sun.", start_date="2022-04-01", end_date="2022-04-01", request_date="2022-03-21", request_type=apideck_unify.RequestType.VACATION, approval_date="2022-03-21", units=apideck_unify.Units.HOURS, amount=3.5, day_part="morning", notes={
        "employee": "Relaxing on the beach for a few hours.",
        "manager": "Enjoy!",
    }, pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ], policy_type="sick")

    assert res.create_time_off_request_response is not None

    # Handle response
    print(res.create_time_off_request_response)

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
employee_id OptionalNullable[str] ID of the employee 12345
policy_id OptionalNullable[str] ID of the policy 12345
status OptionalNullable[models.TimeOffRequestStatusStatus] The status of the time off request. approved
description OptionalNullable[str] Description of the time off request. Enjoying some sun.
start_date OptionalNullable[str] The start date of the time off request. 2022-04-01
end_date OptionalNullable[str] The end date of the time off request. 2022-04-01
request_date OptionalNullable[str] The date the request was made. 2022-03-21
request_type OptionalNullable[models.RequestType] The type of request vacation
approval_date OptionalNullable[str] The date the request was approved 2022-03-21
units OptionalNullable[models.Units] The unit of time off requested. Possible values include: hours, days, or other. hours
amount OptionalNullable[float] The amount of time off requested. 3.5
day_part OptionalNullable[str] The day part of the time off request. morning
notes Optional[models.NotesModel] N/A
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
policy_type Optional[str] The policy type of the time off request sick
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.HrisTimeOffRequestsAddResponse

Errors

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

get

Get Time Off Request

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.hris.time_off_requests.get(id="<id>", employee_id="<id>", service_id="salesforce", fields="id,updated_at")

    assert res.get_time_off_request_response is not None

    # Handle response
    print(res.get_time_off_request_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
employee_id str ✔️ ID of the employee you are acting upon.
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.HrisTimeOffRequestsOneResponse

Errors

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

update

Update Time Off Request

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.hris.time_off_requests.update(id="<id>", employee_id_param="<id>", service_id="salesforce", employee_id="12345", policy_id="12345", status=apideck_unify.TimeOffRequestStatusStatus.APPROVED, description="Enjoying some sun.", start_date="2022-04-01", end_date="2022-04-01", request_date="2022-03-21", request_type=apideck_unify.RequestType.VACATION, approval_date="2022-03-21", units=apideck_unify.Units.HOURS, amount=3.5, day_part="morning", notes={
        "employee": "Relaxing on the beach for a few hours.",
        "manager": "Enjoy!",
    }, pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ], policy_type="sick")

    assert res.update_time_off_request_response is not None

    # Handle response
    print(res.update_time_off_request_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
employee_id_param str ✔️ ID of the employee you are acting upon.
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
employee_id OptionalNullable[str] ID of the employee 12345
policy_id OptionalNullable[str] ID of the policy 12345
status OptionalNullable[models.TimeOffRequestStatusStatus] The status of the time off request. approved
description OptionalNullable[str] Description of the time off request. Enjoying some sun.
start_date OptionalNullable[str] The start date of the time off request. 2022-04-01
end_date OptionalNullable[str] The end date of the time off request. 2022-04-01
request_date OptionalNullable[str] The date the request was made. 2022-03-21
request_type OptionalNullable[models.RequestType] The type of request vacation
approval_date OptionalNullable[str] The date the request was approved 2022-03-21
units OptionalNullable[models.Units] The unit of time off requested. Possible values include: hours, days, or other. hours
amount OptionalNullable[float] The amount of time off requested. 3.5
day_part OptionalNullable[str] The day part of the time off request. morning
notes Optional[models.NotesModel] N/A
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
policy_type Optional[str] The policy type of the time off request sick
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.HrisTimeOffRequestsUpdateResponse

Errors

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

delete

Delete Time Off Request

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.hris.time_off_requests.delete(id="<id>", employee_id="<id>", service_id="salesforce")

    assert res.delete_time_off_request_response is not None

    # Handle response
    print(res.delete_time_off_request_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
employee_id str ✔️ ID of the employee you are acting upon.
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.HrisTimeOffRequestsDeleteResponse

Errors

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