Skip to content

Latest commit

 

History

History
398 lines (310 loc) · 21.6 KB

README.md

File metadata and controls

398 lines (310 loc) · 21.6 KB

Departments

(accounting().departments())

Overview

Available Operations

  • list - List Departments
  • create - Create Department
  • get - Get Department
  • update - Update Department
  • delete - Delete Department

list

List Departments

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingDepartmentsFilter;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingDepartmentsAllRequest;
import com.apideck.unify.models.operations.AccountingDepartmentsAllResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        AccountingDepartmentsAllRequest req = AccountingDepartmentsAllRequest.builder()
                .serviceId("salesforce")
                .fields("id,updated_at")
                .filter(AccountingDepartmentsFilter.builder()
                    .subsidiary("1")
                    .build())
                .build();

        AccountingDepartmentsAllResponse res = sdk.accounting().departments().list()
                .request(req)
                .call();

        if (res.getAccountingDepartmentsResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

AccountingDepartmentsAllResponse

Errors

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

create

Create Department

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingDepartmentInput;
import com.apideck.unify.models.components.DepartmentStatus;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.SubsidiaryReferenceInput;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingDepartmentsAddRequest;
import com.apideck.unify.models.operations.AccountingDepartmentsAddResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        AccountingDepartmentsAddRequest req = AccountingDepartmentsAddRequest.builder()
                .accountingDepartment(AccountingDepartmentInput.builder()
                    .parentId("12345")
                    .name("Sales")
                    .status(DepartmentStatus.ACTIVE)
                    .subsidiaries(List.of(
                        SubsidiaryReferenceInput.builder()
                            .name("SpaceX")
                            .build()))
                    .rowVersion("1-12345")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        AccountingDepartmentsAddResponse res = sdk.accounting().departments().create()
                .request(req)
                .call();

        if (res.createAccountingDepartmentResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

AccountingDepartmentsAddResponse

Errors

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

get

Get Department

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingDepartmentsOneRequest;
import com.apideck.unify.models.operations.AccountingDepartmentsOneResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        AccountingDepartmentsOneRequest req = AccountingDepartmentsOneRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .fields("id,updated_at")
                .build();

        AccountingDepartmentsOneResponse res = sdk.accounting().departments().get()
                .request(req)
                .call();

        if (res.getAccountingDepartmentResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

AccountingDepartmentsOneResponse

Errors

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

update

Update Department

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingDepartmentInput;
import com.apideck.unify.models.components.DepartmentStatus;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.SubsidiaryReferenceInput;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingDepartmentsUpdateRequest;
import com.apideck.unify.models.operations.AccountingDepartmentsUpdateResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        AccountingDepartmentsUpdateRequest req = AccountingDepartmentsUpdateRequest.builder()
                .id("<id>")
                .accountingDepartment(AccountingDepartmentInput.builder()
                    .parentId("12345")
                    .name("Sales")
                    .status(DepartmentStatus.ACTIVE)
                    .subsidiaries(List.of(
                        SubsidiaryReferenceInput.builder()
                            .name("SpaceX")
                            .build()))
                    .rowVersion("1-12345")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        AccountingDepartmentsUpdateResponse res = sdk.accounting().departments().update()
                .request(req)
                .call();

        if (res.updateAccountingDepartmentResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

AccountingDepartmentsUpdateResponse

Errors

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

delete

Delete Department

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingDepartmentsDeleteRequest;
import com.apideck.unify.models.operations.AccountingDepartmentsDeleteResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .apiKey("<YOUR_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        AccountingDepartmentsDeleteRequest req = AccountingDepartmentsDeleteRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .build();

        AccountingDepartmentsDeleteResponse res = sdk.accounting().departments().delete()
                .request(req)
                .call();

        if (res.deleteAccountingDepartmentResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

AccountingDepartmentsDeleteResponse

Errors

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