An open API service indexing awesome lists of open source software.

https://github.com/apideck-libraries/sdk-java


https://github.com/apideck-libraries/sdk-java

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# openapi

Developer-friendly & type-safe Java SDK specifically catered to leverage *openapi* API.






## Summary

Apideck: The Apideck OpenAPI Spec: SDK Optimized

For more information about the API: [Apideck Developer Docs](https://developers.apideck.com)

## Table of Contents

* [openapi](#openapi)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Pagination](#pagination)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Asynchronous Support](#asynchronous-support)
* [Authentication](#authentication)
* [Custom HTTP Client](#custom-http-client)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)

## SDK Installation

### Getting started

JDK 11 or later is required.

The samples below show how a published SDK artifact is used:

Gradle:
```groovy
implementation 'com.apideck:unify:0.29.0'
```

Maven:
```xml

com.apideck
unify
0.29.0

```

### How to build
After cloning the git repository to your file system you can build the SDK artifact from source to the `build` directory by running `./gradlew build` on *nix systems or `gradlew.bat` on Windows systems.

If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally):

On *nix:
```bash
./gradlew publishToMavenLocal -Pskip.signing
```
On Windows:
```bash
gradlew.bat publishToMavenLocal -Pskip.signing
```

## SDK Example Usage

### Example

```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import java.lang.Exception;
import java.util.Map;

public class Application {

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

Apideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

}
}
```
#### Asynchronous Call
An asynchronous SDK client is also available that returns a [`CompletableFuture`][comp-fut]. See [Asynchronous Support](#asynchronous-support) for more details on async benefits and reactive library integration.
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.AsyncApideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.async.AccountingTaxRatesAllResponse;
import java.util.Map;
import reactor.core.publisher.Flux;

public class Application {

public static void main(String[] args) {

AsyncApideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build()
.async();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

var b = sdk.accounting().taxRates().list();

// Example using Project Reactor (illustrative) - pages
Flux pageFlux = Flux.from(b.callAsPublisher());
pageFlux.subscribe(
page -> System.out.println(page),
error -> error.printStackTrace(),
() -> System.out.println("Pagination completed")
);

}
}
```

[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html

## Available Resources and Operations

Available methods

### [Accounting.AgedCreditors](docs/sdks/agedcreditors/README.md)

* [get](docs/sdks/agedcreditors/README.md#get) - Get Aged Creditors

### [Accounting.AgedDebtors](docs/sdks/ageddebtors/README.md)

* [get](docs/sdks/ageddebtors/README.md#get) - Get Aged Debtors

### [Accounting.Attachments](docs/sdks/attachments/README.md)

* [list](docs/sdks/attachments/README.md#list) - List Attachments
* [upload](docs/sdks/attachments/README.md#upload) - Upload attachment
* [get](docs/sdks/attachments/README.md#get) - Get Attachment
* [delete](docs/sdks/attachments/README.md#delete) - Delete Attachment
* [download](docs/sdks/attachments/README.md#download) - Download Attachment

### [Accounting.BalanceSheet](docs/sdks/balancesheet/README.md)

* [get](docs/sdks/balancesheet/README.md#get) - Get BalanceSheet

### [Accounting.BankAccounts](docs/sdks/bankaccounts/README.md)

* [list](docs/sdks/bankaccounts/README.md#list) - List Bank Accounts
* [create](docs/sdks/bankaccounts/README.md#create) - Create Bank Account
* [get](docs/sdks/bankaccounts/README.md#get) - Get Bank Account
* [update](docs/sdks/bankaccounts/README.md#update) - Update Bank Account
* [delete](docs/sdks/bankaccounts/README.md#delete) - Delete Bank Account

### [Accounting.BankFeedAccounts](docs/sdks/bankfeedaccounts/README.md)

* [list](docs/sdks/bankfeedaccounts/README.md#list) - List Bank Feed Accounts
* [create](docs/sdks/bankfeedaccounts/README.md#create) - Create Bank Feed Account
* [get](docs/sdks/bankfeedaccounts/README.md#get) - Get Bank Feed Account
* [update](docs/sdks/bankfeedaccounts/README.md#update) - Update Bank Feed Account
* [delete](docs/sdks/bankfeedaccounts/README.md#delete) - Delete Bank Feed Account

### [Accounting.BankFeedStatements](docs/sdks/bankfeedstatements/README.md)

* [list](docs/sdks/bankfeedstatements/README.md#list) - List Bank Feed Statements
* [create](docs/sdks/bankfeedstatements/README.md#create) - Create Bank Feed Statement
* [get](docs/sdks/bankfeedstatements/README.md#get) - Get Bank Feed Statement
* [update](docs/sdks/bankfeedstatements/README.md#update) - Update Bank Feed Statement
* [delete](docs/sdks/bankfeedstatements/README.md#delete) - Delete Bank Feed Statement

### [Accounting.BillPayments](docs/sdks/billpayments/README.md)

* [list](docs/sdks/billpayments/README.md#list) - List Bill Payments
* [create](docs/sdks/billpayments/README.md#create) - Create Bill Payment
* [get](docs/sdks/billpayments/README.md#get) - Get Bill Payment
* [update](docs/sdks/billpayments/README.md#update) - Update Bill Payment
* [delete](docs/sdks/billpayments/README.md#delete) - Delete Bill Payment

### [Accounting.Bills](docs/sdks/bills/README.md)

* [list](docs/sdks/bills/README.md#list) - List Bills
* [create](docs/sdks/bills/README.md#create) - Create Bill
* [get](docs/sdks/bills/README.md#get) - Get Bill
* [update](docs/sdks/bills/README.md#update) - Update Bill
* [delete](docs/sdks/bills/README.md#delete) - Delete Bill

### [Accounting.Categories](docs/sdks/categories/README.md)

* [list](docs/sdks/categories/README.md#list) - List Categories
* [get](docs/sdks/categories/README.md#get) - Get Category

### [Accounting.CompanyInfo](docs/sdks/companyinfo/README.md)

* [get](docs/sdks/companyinfo/README.md#get) - Get company info

### [Accounting.CreditNotes](docs/sdks/creditnotes/README.md)

* [list](docs/sdks/creditnotes/README.md#list) - List Credit Notes
* [create](docs/sdks/creditnotes/README.md#create) - Create Credit Note
* [get](docs/sdks/creditnotes/README.md#get) - Get Credit Note
* [update](docs/sdks/creditnotes/README.md#update) - Update Credit Note
* [delete](docs/sdks/creditnotes/README.md#delete) - Delete Credit Note

### [Accounting.Customers](docs/sdks/customers/README.md)

* [list](docs/sdks/customers/README.md#list) - List Customers
* [create](docs/sdks/customers/README.md#create) - Create Customer
* [get](docs/sdks/customers/README.md#get) - Get Customer
* [update](docs/sdks/customers/README.md#update) - Update Customer
* [delete](docs/sdks/customers/README.md#delete) - Delete Customer

### [Accounting.Departments](docs/sdks/departments/README.md)

* [list](docs/sdks/departments/README.md#list) - List Departments
* [create](docs/sdks/departments/README.md#create) - Create Department
* [get](docs/sdks/departments/README.md#get) - Get Department
* [update](docs/sdks/departments/README.md#update) - Update Department
* [delete](docs/sdks/departments/README.md#delete) - Delete Department

### [Accounting.Expenses](docs/sdks/expenses/README.md)

* [list](docs/sdks/expenses/README.md#list) - List Expenses
* [create](docs/sdks/expenses/README.md#create) - Create Expense
* [get](docs/sdks/expenses/README.md#get) - Get Expense
* [update](docs/sdks/expenses/README.md#update) - Update Expense
* [delete](docs/sdks/expenses/README.md#delete) - Delete Expense

### [Accounting.InvoiceItems](docs/sdks/invoiceitems/README.md)

* [list](docs/sdks/invoiceitems/README.md#list) - List Invoice Items
* [create](docs/sdks/invoiceitems/README.md#create) - Create Invoice Item
* [get](docs/sdks/invoiceitems/README.md#get) - Get Invoice Item
* [update](docs/sdks/invoiceitems/README.md#update) - Update Invoice Item
* [delete](docs/sdks/invoiceitems/README.md#delete) - Delete Invoice Item

### [Accounting.Invoices](docs/sdks/invoices/README.md)

* [list](docs/sdks/invoices/README.md#list) - List Invoices
* [create](docs/sdks/invoices/README.md#create) - Create Invoice
* [get](docs/sdks/invoices/README.md#get) - Get Invoice
* [update](docs/sdks/invoices/README.md#update) - Update Invoice
* [delete](docs/sdks/invoices/README.md#delete) - Delete Invoice

### [Accounting.JournalEntries](docs/sdks/journalentries/README.md)

* [list](docs/sdks/journalentries/README.md#list) - List Journal Entries
* [create](docs/sdks/journalentries/README.md#create) - Create Journal Entry
* [get](docs/sdks/journalentries/README.md#get) - Get Journal Entry
* [update](docs/sdks/journalentries/README.md#update) - Update Journal Entry
* [delete](docs/sdks/journalentries/README.md#delete) - Delete Journal Entry

### [Accounting.LedgerAccounts](docs/sdks/ledgeraccounts/README.md)

* [list](docs/sdks/ledgeraccounts/README.md#list) - List Ledger Accounts
* [create](docs/sdks/ledgeraccounts/README.md#create) - Create Ledger Account
* [get](docs/sdks/ledgeraccounts/README.md#get) - Get Ledger Account
* [update](docs/sdks/ledgeraccounts/README.md#update) - Update Ledger Account
* [delete](docs/sdks/ledgeraccounts/README.md#delete) - Delete Ledger Account

### [Accounting.Locations](docs/sdks/locations/README.md)

* [list](docs/sdks/locations/README.md#list) - List Locations
* [create](docs/sdks/locations/README.md#create) - Create Location
* [get](docs/sdks/locations/README.md#get) - Get Location
* [update](docs/sdks/locations/README.md#update) - Update Location
* [delete](docs/sdks/locations/README.md#delete) - Delete Location

### [Accounting.Payments](docs/sdks/payments/README.md)

* [list](docs/sdks/payments/README.md#list) - List Payments
* [create](docs/sdks/payments/README.md#create) - Create Payment
* [get](docs/sdks/payments/README.md#get) - Get Payment
* [update](docs/sdks/payments/README.md#update) - Update Payment
* [delete](docs/sdks/payments/README.md#delete) - Delete Payment

### [Accounting.ProfitAndLoss](docs/sdks/profitandloss/README.md)

* [get](docs/sdks/profitandloss/README.md#get) - Get Profit and Loss

### [Accounting.Projects](docs/sdks/projects/README.md)

* [list](docs/sdks/projects/README.md#list) - List projects
* [create](docs/sdks/projects/README.md#create) - Create project
* [get](docs/sdks/projects/README.md#get) - Get project
* [update](docs/sdks/projects/README.md#update) - Update project
* [delete](docs/sdks/projects/README.md#delete) - Delete project

### [Accounting.PurchaseOrders](docs/sdks/purchaseorders/README.md)

* [list](docs/sdks/purchaseorders/README.md#list) - List Purchase Orders
* [create](docs/sdks/purchaseorders/README.md#create) - Create Purchase Order
* [get](docs/sdks/purchaseorders/README.md#get) - Get Purchase Order
* [update](docs/sdks/purchaseorders/README.md#update) - Update Purchase Order
* [delete](docs/sdks/purchaseorders/README.md#delete) - Delete Purchase Order

### [Accounting.Quotes](docs/sdks/quotes/README.md)

* [list](docs/sdks/quotes/README.md#list) - List Quotes
* [create](docs/sdks/quotes/README.md#create) - Create Quote
* [get](docs/sdks/quotes/README.md#get) - Get Quote
* [update](docs/sdks/quotes/README.md#update) - Update Quote
* [delete](docs/sdks/quotes/README.md#delete) - Delete Quote

### [Accounting.Subsidiaries](docs/sdks/subsidiaries/README.md)

* [list](docs/sdks/subsidiaries/README.md#list) - List Subsidiaries
* [create](docs/sdks/subsidiaries/README.md#create) - Create Subsidiary
* [get](docs/sdks/subsidiaries/README.md#get) - Get Subsidiary
* [update](docs/sdks/subsidiaries/README.md#update) - Update Subsidiary
* [delete](docs/sdks/subsidiaries/README.md#delete) - Delete Subsidiary

### [Accounting.Suppliers](docs/sdks/suppliers/README.md)

* [list](docs/sdks/suppliers/README.md#list) - List Suppliers
* [create](docs/sdks/suppliers/README.md#create) - Create Supplier
* [get](docs/sdks/suppliers/README.md#get) - Get Supplier
* [update](docs/sdks/suppliers/README.md#update) - Update Supplier
* [delete](docs/sdks/suppliers/README.md#delete) - Delete Supplier

### [Accounting.TaxRates](docs/sdks/taxrates/README.md)

* [list](docs/sdks/taxrates/README.md#list) - List Tax Rates
* [create](docs/sdks/taxrates/README.md#create) - Create Tax Rate
* [get](docs/sdks/taxrates/README.md#get) - Get Tax Rate
* [update](docs/sdks/taxrates/README.md#update) - Update Tax Rate
* [delete](docs/sdks/taxrates/README.md#delete) - Delete Tax Rate

### [Accounting.TrackingCategories](docs/sdks/trackingcategories/README.md)

* [list](docs/sdks/trackingcategories/README.md#list) - List Tracking Categories
* [create](docs/sdks/trackingcategories/README.md#create) - Create Tracking Category
* [get](docs/sdks/trackingcategories/README.md#get) - Get Tracking Category
* [update](docs/sdks/trackingcategories/README.md#update) - Update Tracking Category
* [delete](docs/sdks/trackingcategories/README.md#delete) - Delete Tracking Category

### [Ats.Applicants](docs/sdks/applicants/README.md)

* [list](docs/sdks/applicants/README.md#list) - List Applicants
* [create](docs/sdks/applicants/README.md#create) - Create Applicant
* [get](docs/sdks/applicants/README.md#get) - Get Applicant
* [update](docs/sdks/applicants/README.md#update) - Update Applicant
* [delete](docs/sdks/applicants/README.md#delete) - Delete Applicant

### [Ats.Applications](docs/sdks/applications/README.md)

* [list](docs/sdks/applications/README.md#list) - List Applications
* [create](docs/sdks/applications/README.md#create) - Create Application
* [get](docs/sdks/applications/README.md#get) - Get Application
* [update](docs/sdks/applications/README.md#update) - Update Application
* [delete](docs/sdks/applications/README.md#delete) - Delete Application

### [Ats.Jobs](docs/sdks/jobs/README.md)

* [list](docs/sdks/jobs/README.md#list) - List Jobs
* [get](docs/sdks/jobs/README.md#get) - Get Job

### [Connector.ApiResourceCoverage](docs/sdks/apiresourcecoverage/README.md)

* [get](docs/sdks/apiresourcecoverage/README.md#get) - Get API Resource Coverage

### [Connector.ApiResources](docs/sdks/apiresources/README.md)

* [get](docs/sdks/apiresources/README.md#get) - Get API Resource

### [Connector.Apis](docs/sdks/apis/README.md)

* [list](docs/sdks/apis/README.md#list) - List APIs
* [get](docs/sdks/apis/README.md#get) - Get API

### [Connector.ConnectorDocs](docs/sdks/connectordocs/README.md)

* [get](docs/sdks/connectordocs/README.md#get) - Get Connector Doc content

### [Connector.ConnectorResources](docs/sdks/connectorresources/README.md)

* [get](docs/sdks/connectorresources/README.md#get) - Get Connector Resource

### [Connector.Connectors](docs/sdks/connectors/README.md)

* [list](docs/sdks/connectors/README.md#list) - List Connectors
* [get](docs/sdks/connectors/README.md#get) - Get Connector

### [Crm.Activities](docs/sdks/activities/README.md)

* [list](docs/sdks/activities/README.md#list) - List activities
* [create](docs/sdks/activities/README.md#create) - Create activity
* [get](docs/sdks/activities/README.md#get) - Get activity
* [update](docs/sdks/activities/README.md#update) - Update activity
* [delete](docs/sdks/activities/README.md#delete) - Delete activity

### [Crm.Companies](docs/sdks/companies/README.md)

* [list](docs/sdks/companies/README.md#list) - List companies
* [create](docs/sdks/companies/README.md#create) - Create company
* [get](docs/sdks/companies/README.md#get) - Get company
* [update](docs/sdks/companies/README.md#update) - Update company
* [delete](docs/sdks/companies/README.md#delete) - Delete company

### [Crm.Contacts](docs/sdks/contacts/README.md)

* [list](docs/sdks/contacts/README.md#list) - List contacts
* [create](docs/sdks/contacts/README.md#create) - Create contact
* [get](docs/sdks/contacts/README.md#get) - Get contact
* [update](docs/sdks/contacts/README.md#update) - Update contact
* [delete](docs/sdks/contacts/README.md#delete) - Delete contact

### [Crm.CustomObjects](docs/sdks/customobjects/README.md)

* [list](docs/sdks/customobjects/README.md#list) - List custom objects
* [create](docs/sdks/customobjects/README.md#create) - Create custom object
* [get](docs/sdks/customobjects/README.md#get) - Get custom object
* [update](docs/sdks/customobjects/README.md#update) - Update custom object
* [delete](docs/sdks/customobjects/README.md#delete) - Delete custom object

### [Crm.CustomObjectSchemas](docs/sdks/customobjectschemas/README.md)

* [list](docs/sdks/customobjectschemas/README.md#list) - List custom object schemas
* [create](docs/sdks/customobjectschemas/README.md#create) - Create custom object schema
* [get](docs/sdks/customobjectschemas/README.md#get) - Get custom object schema
* [update](docs/sdks/customobjectschemas/README.md#update) - Update custom object schema
* [delete](docs/sdks/customobjectschemas/README.md#delete) - Delete custom object schema

### [Crm.Leads](docs/sdks/leads/README.md)

* [list](docs/sdks/leads/README.md#list) - List leads
* [create](docs/sdks/leads/README.md#create) - Create lead
* [get](docs/sdks/leads/README.md#get) - Get lead
* [update](docs/sdks/leads/README.md#update) - Update lead
* [delete](docs/sdks/leads/README.md#delete) - Delete lead

### [Crm.Notes](docs/sdks/notes/README.md)

* [list](docs/sdks/notes/README.md#list) - List notes
* [create](docs/sdks/notes/README.md#create) - Create note
* [get](docs/sdks/notes/README.md#get) - Get note
* [update](docs/sdks/notes/README.md#update) - Update note
* [delete](docs/sdks/notes/README.md#delete) - Delete note

### [Crm.Opportunities](docs/sdks/opportunities/README.md)

* [list](docs/sdks/opportunities/README.md#list) - List opportunities
* [create](docs/sdks/opportunities/README.md#create) - Create opportunity
* [get](docs/sdks/opportunities/README.md#get) - Get opportunity
* [update](docs/sdks/opportunities/README.md#update) - Update opportunity
* [delete](docs/sdks/opportunities/README.md#delete) - Delete opportunity

### [Crm.Pipelines](docs/sdks/pipelines/README.md)

* [list](docs/sdks/pipelines/README.md#list) - List pipelines
* [create](docs/sdks/pipelines/README.md#create) - Create pipeline
* [get](docs/sdks/pipelines/README.md#get) - Get pipeline
* [update](docs/sdks/pipelines/README.md#update) - Update pipeline
* [delete](docs/sdks/pipelines/README.md#delete) - Delete pipeline

### [Crm.Users](docs/sdks/users/README.md)

* [list](docs/sdks/users/README.md#list) - List users
* [create](docs/sdks/users/README.md#create) - Create user
* [get](docs/sdks/users/README.md#get) - Get user
* [update](docs/sdks/users/README.md#update) - Update user
* [delete](docs/sdks/users/README.md#delete) - Delete user

### [Ecommerce.Customers](docs/sdks/apideckcustomers/README.md)

* [list](docs/sdks/apideckcustomers/README.md#list) - List Customers
* [get](docs/sdks/apideckcustomers/README.md#get) - Get Customer

### [Ecommerce.Orders](docs/sdks/orders/README.md)

* [list](docs/sdks/orders/README.md#list) - List Orders
* [get](docs/sdks/orders/README.md#get) - Get Order

### [Ecommerce.Products](docs/sdks/products/README.md)

* [list](docs/sdks/products/README.md#list) - List Products
* [get](docs/sdks/products/README.md#get) - Get Product

### [Ecommerce.Stores](docs/sdks/stores/README.md)

* [get](docs/sdks/stores/README.md#get) - Get Store

### [FileStorage.DriveGroups](docs/sdks/drivegroups/README.md)

* [list](docs/sdks/drivegroups/README.md#list) - List DriveGroups
* [create](docs/sdks/drivegroups/README.md#create) - Create DriveGroup
* [get](docs/sdks/drivegroups/README.md#get) - Get DriveGroup
* [update](docs/sdks/drivegroups/README.md#update) - Update DriveGroup
* [delete](docs/sdks/drivegroups/README.md#delete) - Delete DriveGroup

### [FileStorage.Drives](docs/sdks/drives/README.md)

* [list](docs/sdks/drives/README.md#list) - List Drives
* [create](docs/sdks/drives/README.md#create) - Create Drive
* [get](docs/sdks/drives/README.md#get) - Get Drive
* [update](docs/sdks/drives/README.md#update) - Update Drive
* [delete](docs/sdks/drives/README.md#delete) - Delete Drive

### [FileStorage.Files](docs/sdks/files/README.md)

* [list](docs/sdks/files/README.md#list) - List Files
* [search](docs/sdks/files/README.md#search) - Search Files
* [get](docs/sdks/files/README.md#get) - Get File
* [update](docs/sdks/files/README.md#update) - Rename or move File
* [delete](docs/sdks/files/README.md#delete) - Delete File
* [download](docs/sdks/files/README.md#download) - Download File
* [export](docs/sdks/files/README.md#export) - Export File

### [FileStorage.Folders](docs/sdks/folders/README.md)

* [create](docs/sdks/folders/README.md#create) - Create Folder
* [get](docs/sdks/folders/README.md#get) - Get Folder
* [update](docs/sdks/folders/README.md#update) - Rename or move Folder
* [delete](docs/sdks/folders/README.md#delete) - Delete Folder
* [copy](docs/sdks/folders/README.md#copy) - Copy Folder

### [FileStorage.SharedLinks](docs/sdks/sharedlinks/README.md)

* [list](docs/sdks/sharedlinks/README.md#list) - List Shared Links
* [create](docs/sdks/sharedlinks/README.md#create) - Create Shared Link
* [get](docs/sdks/sharedlinks/README.md#get) - Get Shared Link
* [update](docs/sdks/sharedlinks/README.md#update) - Update Shared Link
* [delete](docs/sdks/sharedlinks/README.md#delete) - Delete Shared Link

### [FileStorage.UploadSessions](docs/sdks/uploadsessions/README.md)

* [create](docs/sdks/uploadsessions/README.md#create) - Start Upload Session
* [get](docs/sdks/uploadsessions/README.md#get) - Get Upload Session
* [upload](docs/sdks/uploadsessions/README.md#upload) - Upload part of File to Upload Session
* [delete](docs/sdks/uploadsessions/README.md#delete) - Abort Upload Session
* [finish](docs/sdks/uploadsessions/README.md#finish) - Finish Upload Session

### [Hris.Companies](docs/sdks/apideckcompanies/README.md)

* [list](docs/sdks/apideckcompanies/README.md#list) - List Companies
* [create](docs/sdks/apideckcompanies/README.md#create) - Create Company
* [get](docs/sdks/apideckcompanies/README.md#get) - Get Company
* [update](docs/sdks/apideckcompanies/README.md#update) - Update Company
* [delete](docs/sdks/apideckcompanies/README.md#delete) - Delete Company

### [Hris.Departments](docs/sdks/apideckdepartments/README.md)

* [list](docs/sdks/apideckdepartments/README.md#list) - List Departments
* [create](docs/sdks/apideckdepartments/README.md#create) - Create Department
* [get](docs/sdks/apideckdepartments/README.md#get) - Get Department
* [update](docs/sdks/apideckdepartments/README.md#update) - Update Department
* [delete](docs/sdks/apideckdepartments/README.md#delete) - Delete Department

### [Hris.EmployeePayrolls](docs/sdks/employeepayrolls/README.md)

* [list](docs/sdks/employeepayrolls/README.md#list) - List Employee Payrolls
* [get](docs/sdks/employeepayrolls/README.md#get) - Get Employee Payroll

### [Hris.Employees](docs/sdks/employees/README.md)

* [list](docs/sdks/employees/README.md#list) - List Employees
* [create](docs/sdks/employees/README.md#create) - Create Employee
* [get](docs/sdks/employees/README.md#get) - Get Employee
* [update](docs/sdks/employees/README.md#update) - Update Employee
* [delete](docs/sdks/employees/README.md#delete) - Delete Employee

### [Hris.EmployeeSchedules](docs/sdks/employeeschedules/README.md)

* [list](docs/sdks/employeeschedules/README.md#list) - List Employee Schedules

### [Hris.Payrolls](docs/sdks/payrolls/README.md)

* [list](docs/sdks/payrolls/README.md#list) - List Payroll
* [get](docs/sdks/payrolls/README.md#get) - Get Payroll

### [Hris.TimeOffRequests](docs/sdks/timeoffrequests/README.md)

* [list](docs/sdks/timeoffrequests/README.md#list) - List Time Off Requests
* [create](docs/sdks/timeoffrequests/README.md#create) - Create Time Off Request
* [get](docs/sdks/timeoffrequests/README.md#get) - Get Time Off Request
* [update](docs/sdks/timeoffrequests/README.md#update) - Update Time Off Request
* [delete](docs/sdks/timeoffrequests/README.md#delete) - Delete Time Off Request

### [IssueTracking.Collections](docs/sdks/collections/README.md)

* [list](docs/sdks/collections/README.md#list) - List Collections
* [get](docs/sdks/collections/README.md#get) - Get Collection

### [IssueTracking.CollectionTags](docs/sdks/collectiontags/README.md)

* [list](docs/sdks/collectiontags/README.md#list) - List Tags

### [IssueTracking.CollectionTicketComments](docs/sdks/collectionticketcomments/README.md)

* [list](docs/sdks/collectionticketcomments/README.md#list) - List Comments
* [create](docs/sdks/collectionticketcomments/README.md#create) - Create Comment
* [get](docs/sdks/collectionticketcomments/README.md#get) - Get Comment
* [update](docs/sdks/collectionticketcomments/README.md#update) - Update Comment
* [delete](docs/sdks/collectionticketcomments/README.md#delete) - Delete Comment

### [IssueTracking.CollectionTickets](docs/sdks/collectiontickets/README.md)

* [list](docs/sdks/collectiontickets/README.md#list) - List Tickets
* [create](docs/sdks/collectiontickets/README.md#create) - Create Ticket
* [get](docs/sdks/collectiontickets/README.md#get) - Get Ticket
* [update](docs/sdks/collectiontickets/README.md#update) - Update Ticket
* [delete](docs/sdks/collectiontickets/README.md#delete) - Delete Ticket

### [IssueTracking.CollectionUsers](docs/sdks/collectionusers/README.md)

* [list](docs/sdks/collectionusers/README.md#list) - List Users
* [get](docs/sdks/collectionusers/README.md#get) - Get user

### [Sms.Messages](docs/sdks/messages/README.md)

* [list](docs/sdks/messages/README.md#list) - List Messages
* [create](docs/sdks/messages/README.md#create) - Create Message
* [get](docs/sdks/messages/README.md#get) - Get Message
* [update](docs/sdks/messages/README.md#update) - Update Message
* [delete](docs/sdks/messages/README.md#delete) - Delete Message

### [Vault.ConnectionConsent](docs/sdks/connectionconsent/README.md)

* [update](docs/sdks/connectionconsent/README.md#update) - Update consent state

### [Vault.ConnectionConsents](docs/sdks/connectionconsents/README.md)

* [list](docs/sdks/connectionconsents/README.md#list) - Get consent records

### [Vault.ConnectionCustomMappings](docs/sdks/connectioncustommappings/README.md)

* [list](docs/sdks/connectioncustommappings/README.md#list) - List connection custom mappings

### [Vault.Connections](docs/sdks/connections/README.md)

* [list](docs/sdks/connections/README.md#list) - Get all connections
* [get](docs/sdks/connections/README.md#get) - Get connection
* [update](docs/sdks/connections/README.md#update) - Update connection
* [delete](docs/sdks/connections/README.md#delete) - Deletes a connection
* [imports](docs/sdks/connections/README.md#imports) - Import connection
* [token](docs/sdks/connections/README.md#token) - Authorize Access Token

### [Vault.ConnectionSettings](docs/sdks/connectionsettings/README.md)

* [list](docs/sdks/connectionsettings/README.md#list) - Get resource settings
* [update](docs/sdks/connectionsettings/README.md#update) - Update settings

### [Vault.ConsumerRequestCounts](docs/sdks/consumerrequestcounts/README.md)

* [list](docs/sdks/consumerrequestcounts/README.md#list) - Consumer request counts

### [Vault.Consumers](docs/sdks/consumers/README.md)

* [create](docs/sdks/consumers/README.md#create) - Create consumer
* [list](docs/sdks/consumers/README.md#list) - Get all consumers
* [get](docs/sdks/consumers/README.md#get) - Get consumer
* [update](docs/sdks/consumers/README.md#update) - Update consumer
* [delete](docs/sdks/consumers/README.md#delete) - Delete consumer

### [Vault.CreateCallback](docs/sdks/createcallback/README.md)

* [state](docs/sdks/createcallback/README.md#state) - Create Callback State

### [Vault.CustomFields](docs/sdks/customfields/README.md)

* [list](docs/sdks/customfields/README.md#list) - Get resource custom fields

### [Vault.CustomMappings](docs/sdks/custommappings/README.md)

* [list](docs/sdks/custommappings/README.md#list) - List custom mappings

### [Vault.Logs](docs/sdks/logs/README.md)

* [list](docs/sdks/logs/README.md#list) - Get all consumer request logs

### [Vault.Sessions](docs/sdks/sessions/README.md)

* [create](docs/sdks/sessions/README.md#create) - Create Session

### [Vault.ValidateConnection](docs/sdks/validateconnection/README.md)

* [state](docs/sdks/validateconnection/README.md#state) - Validate Connection State

### [Webhook.Webhooks](docs/sdks/webhooks/README.md)

* [list](docs/sdks/webhooks/README.md#list) - List webhook subscriptions
* [create](docs/sdks/webhooks/README.md#create) - Create webhook subscription
* [get](docs/sdks/webhooks/README.md#get) - Get webhook subscription
* [update](docs/sdks/webhooks/README.md#update) - Update webhook subscription
* [delete](docs/sdks/webhooks/README.md#delete) - Delete webhook subscription

## Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you can make your SDK calls using the `callAsIterable` or `callAsStream` methods.
For certain operations, you can also use the `callAsStreamUnwrapped` method that streams individual page items directly.

Here's an example depicting the different ways to use pagination:

```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import java.lang.Exception;
import java.lang.Iterable;
import java.util.Map;

public class Application {

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

Apideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

var b = sdk.accounting().taxRates().list();

// Iterate through all pages using a traditional for-each loop
// Each iteration returns a complete page response
Iterable iterable = b.callAsIterable();
for (AccountingTaxRatesAllResponse page : iterable) {
// handle page
}

// Stream through all pages and process individual items
// callAsStreamUnwrapped() flattens pages into individual items

// Stream through pages without unwrapping (each item is a complete page)
b.callAsStream()
.forEach((AccountingTaxRatesAllResponse page) -> {
// handle page
});

}
}
```
#### Asynchronous Pagination
An asynchronous SDK client is also available for pagination that returns a [`Flow.Publisher`][flow-pub]. For async pagination, you can use `callAsPublisher()` to get pages as a publisher, or `callAsPublisherUnwrapped()` to get individual items directly. See [Asynchronous Support](#asynchronous-support) for more details on async benefits and reactive library integration.
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.AsyncApideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.async.AccountingTaxRatesAllResponse;
import java.util.Map;
import reactor.core.publisher.Flux;

public class Application {

public static void main(String[] args) {

AsyncApideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build()
.async();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

var b = sdk.accounting().taxRates().list();

// Example using Project Reactor (illustrative) - pages
Flux pageFlux = Flux.from(b.callAsPublisher());
pageFlux.subscribe(
page -> System.out.println(page),
error -> error.printStackTrace(),
() -> System.out.println("Pagination completed")
);

}
}
```

[flow-pub]: https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/Flow.Publisher.html

## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, you can provide a `RetryConfig` object through the `retryConfig` builder method:
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import com.apideck.unify.utils.BackoffStrategy;
import com.apideck.unify.utils.RetryConfig;
import java.lang.Exception;
import java.util.Map;
import java.util.concurrent.TimeUnit;

public class Application {

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

Apideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

}
}
```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a configuration at SDK initialization:
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import com.apideck.unify.utils.BackoffStrategy;
import com.apideck.unify.utils.RetryConfig;
import java.lang.Exception;
import java.util.Map;
import java.util.concurrent.TimeUnit;

public class Application {

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

Apideck sdk = Apideck.builder()
.retryConfig(RetryConfig.builder()
.backoff(BackoffStrategy.builder()
.initialInterval(1L, TimeUnit.MILLISECONDS)
.maxInterval(50L, TimeUnit.MILLISECONDS)
.maxElapsedTime(1000L, TimeUnit.MILLISECONDS)
.baseFactor(1.1)
.jitterFactor(0.15)
.retryConnectError(false)
.build())
.build())
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

}
}
```

## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.

[`ApideckError`](./src/main/java/models/errors/ApideckError.java) is the base class for all HTTP error responses. It has the following properties:

| Method | Type | Description |
| ---------------- | --------------------------- | ------------------------------------------------------------------------ |
| `message()` | `String` | Error message |
| `code()` | `int` | HTTP response status code eg `404` |
| `headers` | `Map>` | HTTP response headers |
| `body()` | `byte[]` | HTTP body as a byte array. Can be empty array if no body is returned. |
| `bodyAsString()` | `String` | HTTP body as a UTF-8 string. Can be empty string if no body is returned. |
| `rawResponse()` | `HttpResponse>` | Raw HTTP response (body already read and not available for re-read) |

### Example
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import java.io.UncheckedIOException;
import java.lang.Double;
import java.lang.Exception;
import java.lang.String;
import java.util.Map;
import java.util.Optional;

public class Application {

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

Apideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();
try {

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

} catch (ApideckError ex) { // all SDK exceptions inherit from ApideckError

// ex.ToString() provides a detailed error message including
// HTTP status code, headers, and error payload (if any)
System.out.println(ex);

// Base exception fields
var rawResponse = ex.rawResponse();
var headers = ex.headers();
var contentType = headers.first("Content-Type");
int statusCode = ex.code();
Optional responseBody = ex.body();

// different error subclasses may be thrown
// depending on the service call
if (ex instanceof BadRequestResponse) {
var e = (BadRequestResponse) ex;
// Check error data fields
e.data().ifPresent(payload -> {
Optional statusCode = payload.statusCode();
Optional error = payload.error();
// ...
});
}

// An underlying cause may be provided. If the error payload
// cannot be deserialized then the deserialization exception
// will be set as the cause.
if (ex.getCause() != null) {
var cause = ex.getCause();
}
} catch (UncheckedIOException ex) {
// handle IO error (connection, timeout, etc)
} }
}
```

### Error Classes
**Primary errors:**
* [`ApideckError`](./src/main/java/models/errors/ApideckError.java): The base class for HTTP error responses.
* [`com.apideck.unify.models.errors.UnauthorizedResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.UnauthorizedResponse.java): Unauthorized. Status code `401`.
* [`com.apideck.unify.models.errors.PaymentRequiredResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.PaymentRequiredResponse.java): Payment Required. Status code `402`.
* [`com.apideck.unify.models.errors.NotFoundResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.NotFoundResponse.java): The specified resource was not found. Status code `404`. *
* [`com.apideck.unify.models.errors.BadRequestResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.BadRequestResponse.java): Bad Request. Status code `400`. *
* [`com.apideck.unify.models.errors.UnprocessableResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.UnprocessableResponse.java): Unprocessable. Status code `422`. *

Less common errors (6)


**Network errors:**
* `java.io.IOException` (always wrapped by `java.io.UncheckedIOException`). Commonly encountered subclasses of
`IOException` include `java.net.ConnectException`, `java.net.SocketTimeoutException`, `EOFException` (there are
many more subclasses in the JDK platform).

**Inherit from [`ApideckError`](./src/main/java/models/errors/ApideckError.java)**:

\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.

## Server Selection

### Override Server URL Per-Client

The default server can be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example:
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import java.lang.Exception;
import java.util.Map;

public class Application {

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

Apideck sdk = Apideck.builder()
.serverURL("https://unify.apideck.com")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

}
}
```

### Override Server URL Per-Operation

The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AttachmentReferenceType;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingAttachmentsUploadRequest;
import com.apideck.unify.models.operations.AccountingAttachmentsUploadResponse;
import java.lang.Exception;
import java.nio.charset.StandardCharsets;

public class Application {

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

Apideck sdk = Apideck.builder()
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build();

AccountingAttachmentsUploadRequest req = AccountingAttachmentsUploadRequest.builder()
.referenceType(AttachmentReferenceType.INVOICE)
.referenceId("123456")
.requestBody("0x506D4BD16D".getBytes(StandardCharsets.UTF_8))
.xApideckMetadata("{\"name\":\"document.pdf\",\"description\":\"Invoice attachment\"}")
.serviceId("salesforce")
.build();

AccountingAttachmentsUploadResponse res = sdk.accounting().attachments().upload()
.request(req)
.serverURL("https://upload.apideck.com")
.call();

}
}
```

## Asynchronous Support

The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture`][comp-fut] and [Reactive Streams `Publisher`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library.

Why Use Async?

Asynchronous operations provide several key benefits:

- **Non-blocking I/O**: Your threads stay free for other work while operations are in flight
- **Better resource utilization**: Handle more concurrent operations with fewer threads
- **Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests
- **Reactive integration**: Works seamlessly with reactive streams and backpressure handling

Reactive Library Integration

The SDK returns [Reactive Streams `Publisher`][reactive-streams] instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams.

**Why Reactive Streams over JDK Flow?**
- **Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
- **Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java
- **Better interoperability**: Seamless integration without additional adapters for most use cases

**Integration with Popular Libraries:**
- **Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types
- **RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration
- **Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration
- **Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams
- **Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration

**For JDK Flow API Integration:**
If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
```java
// Convert Reactive Streams Publisher to Flow Publisher
Flow.Publisher flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher);

// Convert Flow Publisher to Reactive Streams Publisher
Publisher reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher);
```

For standard single-response operations, the SDK returns `CompletableFuture` for straightforward async execution.

Supported Operations

Async support is available for:

- **[Server-sent Events](#server-sent-event-streaming)**: Stream real-time events with Reactive Streams `Publisher`
- **[JSONL Streaming](#jsonl-streaming)**: Process streaming JSON lines asynchronously
- **[Pagination](#pagination)**: Iterate through paginated results using `callAsPublisher()` and `callAsPublisherUnwrapped()`
- **[File Uploads](#file-uploads)**: Upload files asynchronously with progress tracking
- **[File Downloads](#file-downloads)**: Download files asynchronously with streaming support
- **[Standard Operations](#example)**: All regular API calls return `CompletableFuture` for async execution

[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
[reactive-streams]: https://www.reactive-streams.org/

## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name | Type | Scheme |
| -------- | ---- | ----------- |
| `apiKey` | http | HTTP Bearer |

To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.TaxRatesFilter;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingTaxRatesAllRequest;
import com.apideck.unify.models.operations.AccountingTaxRatesAllResponse;
import java.lang.Exception;
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(System.getenv().getOrDefault("API_KEY", ""))
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();

AccountingTaxRatesAllRequest req = AccountingTaxRatesAllRequest.builder()
.serviceId("salesforce")
.filter(TaxRatesFilter.builder()
.assets(true)
.equity(true)
.expenses(true)
.liabilities(true)
.revenue(true)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();

sdk.accounting().taxRates().list()
.callAsStream()
.forEach((AccountingTaxRatesAllResponse item) -> {
// handle page
});

}
}
```

## Custom HTTP Client

The Java SDK makes API calls using an `HTTPClient` that wraps the native
[HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html). This
client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle
errors and response.

The `HTTPClient` interface allows you to either use the default `SpeakeasyHTTPClient` that comes with the SDK,
or provide your own custom implementation with customized configuration such as custom executors, SSL context,
connection pools, and other HTTP client settings.

The interface provides synchronous (`send`) methods and asynchronous (`sendAsync`) methods. The `sendAsync` method
is used to power the async SDK methods and returns a `CompletableFuture>` for non-blocking operations.

The following example shows how to add a custom header and handle errors:

```java
import com.apideck.unify.Apideck;
import com.apideck.unify.utils.HTTPClient;
import com.apideck.unify.utils.SpeakeasyHTTPClient;
import com.apideck.unify.utils.Utils;

import java.io.IOException;
import java.net.URISyntaxException;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.io.InputStream;
import java.time.Duration;

public class Application {
public static void main(String[] args) {
// Create a custom HTTP client with hooks
HTTPClient httpClient = new HTTPClient() {
private final HTTPClient defaultClient = new SpeakeasyHTTPClient();

@Override
public HttpResponse send(HttpRequest request) throws IOException, URISyntaxException, InterruptedException {
// Add custom header and timeout using Utils.copy()
HttpRequest modifiedRequest = Utils.copy(request)
.header("x-custom-header", "custom value")
.timeout(Duration.ofSeconds(30))
.build();

try {
HttpResponse response = defaultClient.send(modifiedRequest);
// Log successful response
System.out.println("Request successful: " + response.statusCode());
return response;
} catch (Exception error) {
// Log error
System.err.println("Request failed: " + error.getMessage());
throw error;
}
}
};

Apideck sdk = Apideck.builder()
.client(httpClient)
.build();
}
}
```

Custom HTTP Client Configuration

You can also provide a completely custom HTTP client with your own configuration:

```java
import com.apideck.unify.Apideck;
import com.apideck.unify.utils.HTTPClient;
import com.apideck.unify.utils.Blob;
import com.apideck.unify.utils.ResponseWithBody;

import java.io.IOException;
import java.net.URISyntaxException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.io.InputStream;
import java.time.Duration;
import java.util.concurrent.Executors;
import java.util.concurrent.CompletableFuture;

public class Application {
public static void main(String[] args) {
// Custom HTTP client with custom configuration
HTTPClient customHttpClient = new HTTPClient() {
private final HttpClient client = HttpClient.newBuilder()
.executor(Executors.newFixedThreadPool(10))
.connectTimeout(Duration.ofSeconds(30))
// .sslContext(customSslContext) // Add custom SSL context if needed
.build();

@Override
public HttpResponse send(HttpRequest request) throws IOException, URISyntaxException, InterruptedException {
return client.send(request, HttpResponse.BodyHandlers.ofInputStream());
}

@Override
public CompletableFuture> sendAsync(HttpRequest request) {
// Convert response to HttpResponse for async operations
return client.sendAsync(request, HttpResponse.BodyHandlers.ofPublisher())
.thenApply(resp -> new ResponseWithBody<>(resp, Blob::from));
}
};

Apideck sdk = Apideck.builder()
.client(customHttpClient)
.build();
}
}
```

You can also enable debug logging on the default `SpeakeasyHTTPClient`:

```java
import com.apideck.unify.Apideck;
import com.apideck.unify.utils.SpeakeasyHTTPClient;

public class Application {
public static void main(String[] args) {
SpeakeasyHTTPClient httpClient = new SpeakeasyHTTPClient();
httpClient.enableDebugLogging(true);

Apideck sdk = Apideck.builder()
.client(httpClient)
.build();
}
}
```

## Debugging

### Debug

You can setup your SDK to emit debug logs for SDK requests and responses.

For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so:

```java
SDK.builder()
.enableHTTPDebugLogging(true)
.build();
```
Example output:
```
Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
"authenticated": true,
"token": "global"
}
```
__WARNING__: This logging should only be used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.

__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.

Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.

# Development

## Maturity

There may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.

## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.