Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ publishing {
maven(MavenPublication) {
groupId = 'dev.merge'
artifactId = 'merge-java-client'
version = '1.0.17'
version = '1.0.18'
from components.java
pom {
scm {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/merge/api/MergeApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public class MergeApiClient {

protected final Supplier<CrmClient> crmClient;

protected final Supplier<HrisClient> hrisClient;

protected final Supplier<FilestorageClient> filestorageClient;

protected final Supplier<TicketingClient> ticketingClient;

protected final Supplier<HrisClient> hrisClient;

protected final Supplier<AccountingClient> accountingClient;

public MergeApiClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions));
this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions));
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions));
this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions));
this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions));
this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions));
}

Expand All @@ -46,6 +46,10 @@ public CrmClient crm() {
return this.crmClient.get();
}

public HrisClient hris() {
return this.hrisClient.get();
}

public FilestorageClient filestorage() {
return this.filestorageClient.get();
}
Expand All @@ -54,10 +58,6 @@ public TicketingClient ticketing() {
return this.ticketingClient.get();
}

public HrisClient hris() {
return this.hrisClient.get();
}

public AccountingClient accounting() {
return this.accountingClient.get();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/merge/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private ClientOptions(
{
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.merge.fern:api-sdk");
put("X-Fern-SDK-Version", "1.0.17");
put("X-Fern-SDK-Version", "1.0.18");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
import com.merge.api.resources.accounting.accounttoken.AccountTokenClient;
import com.merge.api.resources.accounting.addresses.AddressesClient;
import com.merge.api.resources.accounting.asyncpassthrough.AsyncPassthroughClient;
import com.merge.api.resources.accounting.asynctasks.AsyncTasksClient;
import com.merge.api.resources.accounting.attachments.AttachmentsClient;
import com.merge.api.resources.accounting.audittrail.AuditTrailClient;
import com.merge.api.resources.accounting.availableactions.AvailableActionsClient;
import com.merge.api.resources.accounting.balancesheets.BalanceSheetsClient;
import com.merge.api.resources.accounting.bankfeedaccounts.BankFeedAccountsClient;
import com.merge.api.resources.accounting.bankfeedtransactions.BankFeedTransactionsClient;
import com.merge.api.resources.accounting.cashflowstatements.CashFlowStatementsClient;
import com.merge.api.resources.accounting.companyinfo.CompanyInfoClient;
import com.merge.api.resources.accounting.contacts.ContactsClient;
import com.merge.api.resources.accounting.creditnotes.CreditNotesClient;
import com.merge.api.resources.accounting.deleteaccount.DeleteAccountClient;
import com.merge.api.resources.accounting.employees.EmployeesClient;
import com.merge.api.resources.accounting.expenses.ExpensesClient;
import com.merge.api.resources.accounting.fieldmapping.FieldMappingClient;
import com.merge.api.resources.accounting.forceresync.ForceResyncClient;
import com.merge.api.resources.accounting.generalledgertransactions.GeneralLedgerTransactionsClient;
import com.merge.api.resources.accounting.generatekey.GenerateKeyClient;
import com.merge.api.resources.accounting.incomestatements.IncomeStatementsClient;
import com.merge.api.resources.accounting.invoices.InvoicesClient;
Expand Down Expand Up @@ -60,6 +65,8 @@ public class AccountingClient {

protected final Supplier<AsyncPassthroughClient> asyncPassthroughClient;

protected final Supplier<AsyncTasksClient> asyncTasksClient;

protected final Supplier<AttachmentsClient> attachmentsClient;

protected final Supplier<AuditTrailClient> auditTrailClient;
Expand All @@ -68,6 +75,10 @@ public class AccountingClient {

protected final Supplier<BalanceSheetsClient> balanceSheetsClient;

protected final Supplier<BankFeedAccountsClient> bankFeedAccountsClient;

protected final Supplier<BankFeedTransactionsClient> bankFeedTransactionsClient;

protected final Supplier<CashFlowStatementsClient> cashFlowStatementsClient;

protected final Supplier<CompanyInfoClient> companyInfoClient;
Expand All @@ -80,10 +91,14 @@ public class AccountingClient {

protected final Supplier<DeleteAccountClient> deleteAccountClient;

protected final Supplier<EmployeesClient> employeesClient;

protected final Supplier<ExpensesClient> expensesClient;

protected final Supplier<FieldMappingClient> fieldMappingClient;

protected final Supplier<GeneralLedgerTransactionsClient> generalLedgerTransactionsClient;

protected final Supplier<GenerateKeyClient> generateKeyClient;

protected final Supplier<IncomeStatementsClient> incomeStatementsClient;
Expand Down Expand Up @@ -132,18 +147,24 @@ public AccountingClient(ClientOptions clientOptions) {
this.accountsClient = Suppliers.memoize(() -> new AccountsClient(clientOptions));
this.addressesClient = Suppliers.memoize(() -> new AddressesClient(clientOptions));
this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions));
this.asyncTasksClient = Suppliers.memoize(() -> new AsyncTasksClient(clientOptions));
this.attachmentsClient = Suppliers.memoize(() -> new AttachmentsClient(clientOptions));
this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions));
this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions));
this.balanceSheetsClient = Suppliers.memoize(() -> new BalanceSheetsClient(clientOptions));
this.bankFeedAccountsClient = Suppliers.memoize(() -> new BankFeedAccountsClient(clientOptions));
this.bankFeedTransactionsClient = Suppliers.memoize(() -> new BankFeedTransactionsClient(clientOptions));
this.cashFlowStatementsClient = Suppliers.memoize(() -> new CashFlowStatementsClient(clientOptions));
this.companyInfoClient = Suppliers.memoize(() -> new CompanyInfoClient(clientOptions));
this.contactsClient = Suppliers.memoize(() -> new ContactsClient(clientOptions));
this.creditNotesClient = Suppliers.memoize(() -> new CreditNotesClient(clientOptions));
this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions));
this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions));
this.employeesClient = Suppliers.memoize(() -> new EmployeesClient(clientOptions));
this.expensesClient = Suppliers.memoize(() -> new ExpensesClient(clientOptions));
this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions));
this.generalLedgerTransactionsClient =
Suppliers.memoize(() -> new GeneralLedgerTransactionsClient(clientOptions));
this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions));
this.incomeStatementsClient = Suppliers.memoize(() -> new IncomeStatementsClient(clientOptions));
this.invoicesClient = Suppliers.memoize(() -> new InvoicesClient(clientOptions));
Expand Down Expand Up @@ -190,6 +211,10 @@ public AsyncPassthroughClient asyncPassthrough() {
return this.asyncPassthroughClient.get();
}

public AsyncTasksClient asyncTasks() {
return this.asyncTasksClient.get();
}

public AttachmentsClient attachments() {
return this.attachmentsClient.get();
}
Expand All @@ -206,6 +231,14 @@ public BalanceSheetsClient balanceSheets() {
return this.balanceSheetsClient.get();
}

public BankFeedAccountsClient bankFeedAccounts() {
return this.bankFeedAccountsClient.get();
}

public BankFeedTransactionsClient bankFeedTransactions() {
return this.bankFeedTransactionsClient.get();
}

public CashFlowStatementsClient cashFlowStatements() {
return this.cashFlowStatementsClient.get();
}
Expand All @@ -230,6 +263,10 @@ public DeleteAccountClient deleteAccount() {
return this.deleteAccountClient.get();
}

public EmployeesClient employees() {
return this.employeesClient.get();
}

public ExpensesClient expenses() {
return this.expensesClient.get();
}
Expand All @@ -238,6 +275,10 @@ public FieldMappingClient fieldMapping() {
return this.fieldMappingClient.get();
}

public GeneralLedgerTransactionsClient generalLedgerTransactions() {
return this.generalLedgerTransactionsClient.get();
}

public GenerateKeyClient generateKey() {
return this.generateKeyClient.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public PaginatedAccountList list(AccountsListRequest request, RequestOptions req
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("accounting/v1/accounts");
if (request.getAccountType().isPresent()) {
httpUrl.addQueryParameter("account_type", request.getAccountType().get());
}
if (request.getCompanyId().isPresent()) {
httpUrl.addQueryParameter("company_id", request.getCompanyId().get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = AccountsListRequest.Builder.class)
public final class AccountsListRequest {
private final Optional<String> accountType;

private final Optional<String> companyId;

private final Optional<OffsetDateTime> createdAfter;
Expand Down Expand Up @@ -54,6 +56,7 @@ public final class AccountsListRequest {
private final Map<String, Object> additionalProperties;

private AccountsListRequest(
Optional<String> accountType,
Optional<String> companyId,
Optional<OffsetDateTime> createdAfter,
Optional<OffsetDateTime> createdBefore,
Expand All @@ -69,6 +72,7 @@ private AccountsListRequest(
Optional<String> remoteId,
Optional<AccountsListRequestShowEnumOrigins> showEnumOrigins,
Map<String, Object> additionalProperties) {
this.accountType = accountType;
this.companyId = companyId;
this.createdAfter = createdAfter;
this.createdBefore = createdBefore;
Expand All @@ -86,6 +90,14 @@ private AccountsListRequest(
this.additionalProperties = additionalProperties;
}

/**
* @return If provided, will only provide accounts with the passed in enum.
*/
@JsonProperty("account_type")
public Optional<String> getAccountType() {
return accountType;
}

/**
* @return If provided, will only return accounts for this company.
*/
Expand Down Expand Up @@ -210,7 +222,8 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(AccountsListRequest other) {
return companyId.equals(other.companyId)
return accountType.equals(other.accountType)
&& companyId.equals(other.companyId)
&& createdAfter.equals(other.createdAfter)
&& createdBefore.equals(other.createdBefore)
&& cursor.equals(other.cursor)
Expand All @@ -229,6 +242,7 @@ private boolean equalTo(AccountsListRequest other) {
@java.lang.Override
public int hashCode() {
return Objects.hash(
this.accountType,
this.companyId,
this.createdAfter,
this.createdBefore,
Expand Down Expand Up @@ -256,6 +270,8 @@ public static Builder builder() {

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional<String> accountType = Optional.empty();

private Optional<String> companyId = Optional.empty();

private Optional<OffsetDateTime> createdAfter = Optional.empty();
Expand Down Expand Up @@ -290,6 +306,7 @@ public static final class Builder {
private Builder() {}

public Builder from(AccountsListRequest other) {
accountType(other.getAccountType());
companyId(other.getCompanyId());
createdAfter(other.getCreatedAfter());
createdBefore(other.getCreatedBefore());
Expand All @@ -307,6 +324,17 @@ public Builder from(AccountsListRequest other) {
return this;
}

@JsonSetter(value = "account_type", nulls = Nulls.SKIP)
public Builder accountType(Optional<String> accountType) {
this.accountType = accountType;
return this;
}

public Builder accountType(String accountType) {
this.accountType = Optional.of(accountType);
return this;
}

@JsonSetter(value = "company_id", nulls = Nulls.SKIP)
public Builder companyId(Optional<String> companyId) {
this.companyId = companyId;
Expand Down Expand Up @@ -463,6 +491,7 @@ public Builder showEnumOrigins(AccountsListRequestShowEnumOrigins showEnumOrigin

public AccountsListRequest build() {
return new AccountsListRequest(
accountType,
companyId,
createdAfter,
createdBefore,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.merge.api.resources.accounting.asynctasks;

import com.merge.api.core.ApiError;
import com.merge.api.core.ClientOptions;
import com.merge.api.core.MergeException;
import com.merge.api.core.ObjectMappers;
import com.merge.api.core.RequestOptions;
import com.merge.api.resources.accounting.types.AsyncPostTask;
import java.io.IOException;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;

public class AsyncTasksClient {
protected final ClientOptions clientOptions;

public AsyncTasksClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}

/**
* Returns an <code>AsyncPostTask</code> object with the given <code>id</code>.
*/
public AsyncPostTask retrieve(String id) {
return retrieve(id, null);
}

/**
* Returns an <code>AsyncPostTask</code> object with the given <code>id</code>.
*/
public AsyncPostTask retrieve(String id, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("accounting/v1/async-tasks")
.addPathSegment(id)
.build();
Request okhttpRequest = new Request.Builder()
.url(httpUrl)
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
if (response.isSuccessful()) {
return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPostTask.class);
}
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
throw new ApiError(
"Error with status code " + response.code(),
response.code(),
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
} catch (IOException e) {
throw new MergeException("Network error executing HTTP request", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Optional<String> getEndDate() {
}

/**
* @return If included, will only include events with the given event type. Possible values include: <code>CREATED_REMOTE_PRODUCTION_API_KEY</code>, <code>DELETED_REMOTE_PRODUCTION_API_KEY</code>, <code>CREATED_TEST_API_KEY</code>, <code>DELETED_TEST_API_KEY</code>, <code>REGENERATED_PRODUCTION_API_KEY</code>, <code>INVITED_USER</code>, <code>TWO_FACTOR_AUTH_ENABLED</code>, <code>TWO_FACTOR_AUTH_DISABLED</code>, <code>DELETED_LINKED_ACCOUNT</code>, <code>CREATED_DESTINATION</code>, <code>DELETED_DESTINATION</code>, <code>CHANGED_DESTINATION</code>, <code>CHANGED_SCOPES</code>, <code>CHANGED_PERSONAL_INFORMATION</code>, <code>CHANGED_ORGANIZATION_SETTINGS</code>, <code>ENABLED_INTEGRATION</code>, <code>DISABLED_INTEGRATION</code>, <code>ENABLED_CATEGORY</code>, <code>DISABLED_CATEGORY</code>, <code>CHANGED_PASSWORD</code>, <code>RESET_PASSWORD</code>, <code>ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION</code>, <code>ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT</code>, <code>DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION</code>, <code>DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT</code>, <code>CREATED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>CREATED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>CHANGED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>CHANGED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>DELETED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>DELETED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>FORCED_LINKED_ACCOUNT_RESYNC</code>, <code>MUTED_ISSUE</code>, <code>GENERATED_MAGIC_LINK</code>, <code>ENABLED_MERGE_WEBHOOK</code>, <code>DISABLED_MERGE_WEBHOOK</code>, <code>MERGE_WEBHOOK_TARGET_CHANGED</code>, <code>END_USER_CREDENTIALS_ACCESSED</code>
* @return If included, will only include events with the given event type. Possible values include: <code>CREATED_REMOTE_PRODUCTION_API_KEY</code>, <code>DELETED_REMOTE_PRODUCTION_API_KEY</code>, <code>CREATED_TEST_API_KEY</code>, <code>DELETED_TEST_API_KEY</code>, <code>REGENERATED_PRODUCTION_API_KEY</code>, <code>INVITED_USER</code>, <code>TWO_FACTOR_AUTH_ENABLED</code>, <code>TWO_FACTOR_AUTH_DISABLED</code>, <code>DELETED_LINKED_ACCOUNT</code>, <code>CREATED_DESTINATION</code>, <code>DELETED_DESTINATION</code>, <code>CHANGED_DESTINATION</code>, <code>CHANGED_SCOPES</code>, <code>CHANGED_PERSONAL_INFORMATION</code>, <code>CHANGED_ORGANIZATION_SETTINGS</code>, <code>ENABLED_INTEGRATION</code>, <code>DISABLED_INTEGRATION</code>, <code>ENABLED_CATEGORY</code>, <code>DISABLED_CATEGORY</code>, <code>CHANGED_PASSWORD</code>, <code>RESET_PASSWORD</code>, <code>ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION</code>, <code>ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT</code>, <code>DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION</code>, <code>DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT</code>, <code>CREATED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>CREATED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>CHANGED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>CHANGED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>DELETED_INTEGRATION_WIDE_FIELD_MAPPING</code>, <code>DELETED_LINKED_ACCOUNT_FIELD_MAPPING</code>, <code>CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE</code>, <code>CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE</code>, <code>DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE</code>, <code>FORCED_LINKED_ACCOUNT_RESYNC</code>, <code>MUTED_ISSUE</code>, <code>GENERATED_MAGIC_LINK</code>, <code>ENABLED_MERGE_WEBHOOK</code>, <code>DISABLED_MERGE_WEBHOOK</code>, <code>MERGE_WEBHOOK_TARGET_CHANGED</code>, <code>END_USER_CREDENTIALS_ACCESSED</code>
*/
@JsonProperty("event_type")
public Optional<String> getEventType() {
Expand Down
Loading
Loading